SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I had this post entirely written, but I decided to reframe the question in terms of the solution I'm going to try vs. what else I could be doing. This solution will be replaceable without consequence, or I can extend it to the rest of my network.
I have a laptop that I want to connect to my stereo via USB, and I want the other computers on my network to be able to send sound to it somewhat transparently. By "transparently" I mean that I want to be able to send literally any audio that would go through my local speakers to the stereo via the network. As far as I know, PulseAudio can do this without rebuilding any multimedia packages. No one really has anything good to say about PulseAudio, though.
As of now I'm ready to wipe the laptop (Pentium 4) and put pretty much anything (*nix) on it. I know PulseAudio is pretty easy to get running on *buntu, so I might end up doing that. I just want to be able to turn on the laptop and connect the stereo (in any order) and without doing anything else, have it ready to go on the network. Of course, I'm willing to put in some work to get it running. I prefer Slackware and FreeBSD, but the machine will literally just be there to send sound to the stereo.
Someone on forums.freebsd.org suggested NAS as a solution to a similar problem; however, I can't find anything useful regarding how to configure it, troubleshoot it, etc. I've only found random threads on the web by people who know how to use it or by people who can't find any resources for it.
Anyway, I'll be busy setting up PulseAudio to see how that works out. I can always wipe the laptop later, and I have a Kubuntu boot on my main laptop that I don't really care about.
Also, based on the way you describe your setup, I think it would make more sense to put MPD and the music library on the laptop, and set the laptop up with a web-based MPD frontend. Then the other computers will be able to use their web browsers to remotely control which songs the laptop plays over the stereo.
Also, based on the way you describe your setup, I think it would make more sense to put MPD and the music library on the laptop, and set the laptop up with a web-based MPD frontend. Then the other computers will be able to use their web browsers to remotely control which songs the laptop plays over the stereo.
Thanks for the suggestions. I'm not setting up a media server, however. Just a sound server. For example, with my solution above (implemented since that post)
I'm able to send my npviewer.bin and DVD sound output to the stereo via wifi. The point being that I'll be able to stream sound to the server.
I set up Xubuntu and PulseAudio on the laptop and the setup works semi-good connecting from my Kubuntu boot, but I'm hoping to not have to set up PulseAudio on my Slackware and FreeBSD machines.
So far I have only a slight lag in sound and it's choppy here and there, but I don't know if that's a WAN problem or the setup I have going.
Kevin Barry
update: It turns out the screensaver, xfce-mixer, and/or xfce-volumed completely bogged down the old laptop (some combination of each at different times.) Fixing those and increasing the priority of both machines with the router got rid of the choppiness in web streaming but not Kaffeine. Dragon Player doesn't have choppy sound and the sync with video is fine. The only problem I have now is snd_usb_audio crashes when I do relatively minor things like click the XFCE menu or open pavucontrol.
Sorry, I know this post is oooooold, but for the benefit of others.
For streaming media content over a LAN I found there are several possible avenues. I haven't tried all of them, so you may want to do a bit of experimentation:
VLC player. Vlc player provides streaming out of the box. I did a little experiment and was able to successfully play an audio file on my laptop which I streamed from my desktop machine - I used VLC player on both machines. See http://wiki.videolan.org/Documentati...ming_HowTo_New
Did you know you could stream audio or video on linux without any configuration? Note that this is a push model. So we have to start the streaming client first. This is what you have to do. On the streaming client, setup the listener.
$ nc -l -p 1234 | mplayer -cache 8192 -
This will wait for media from the network to play.
On the streaming server, push the media data (any mplayer playable file) thusly.
$ cat video.mpg | nc <ip/dns of streaming client> 1234
I just did a successfull netcat trial using netcat and sox:
On the receiving machine, I used an infinite loop:
$ while true; do nc -l 1234 | sox -t mp3 - -t ossdsp /dev/dsp; sleep 1; done
Playing audio over a pair of dinky little speakers is not all that satisfying. So how can you get it playing over a proper sound system? The kind that can rattle the walls and break crystal glasses?
Say, all your music resides on a large disk drive on a noisy server machine in the basement, while another silent PC is relatively close to your HiFi system, then you can run a cable from the sound adaptor line out to the auxiliary input of the amplifier, but you then still need a convenient way to send audio from the server over a LAN. This can be done using a combination of Sound Exchange (sox) and Netcat (nc).
On the HiFi connected PC, sox can play a file like this:
sox file.mp3 -t ossdsp /dev/dsp
However, you want sox to play music coming from the LAN, so it needs to be hooked to a server, that will listen for incoming data. Netcat can do that very conveniently.
To make sox and netcat work together, you need to tell sox the incoming file type (-t mp3, or -t vorbis) and you need to tell sox to grab the data from standard input (the empty '-'):
| sox -t mp3 - -t ossdsp /dev/dsp
Then you need to add a netcat listener before the pipe, to listen on a specific IP address and port:
nc -l -w 10 192.168.1.10 -p 12345
To be really good, you need to put an infinite loop around it, so that if netcat or sox exits, that they will start again:
Put the above at the end of file /etc/rc.d/rc.local and it will always run when the PC is restarted and the PC will play whatever comes over the LAN - so make sure the volume is turned down a bit...
Now, on the server with the music repository, you can use netcat to send the music to the HiFi like this:
cat *.mp3 | nc 192.168.1.10 12345
That will cause netcat to pipe the music from the basement to the HiFi. Some more scripting can make the system run a playlist, or simply play everything at random.
As a neat trick, you can also show the actual data on the console whilst it's streaming to the receiver. tee to the rescue:
TTY=`tty`; while true; do cat ./00.mp3 | tee >(xxd > $TTY) | nc 10.18.22.250 1234; sleep 1; done
this sends the mp3 stream to netcat as well as to xxd, which then (in turn) sends the output to the console used. This shows a live hexdump of the data being sent to the playout machine.
Good to hear it works for webm files, too! Thanks for that!
It would be interesting to do some latency studies when transferring digital audio over a wireless connection. In the past I've had to cable-connect audio systems to each other that were running from different mains phases. This needs great care! In Europe, we have 380V between phases and all we need is a faulty power supply! One cannot always avoid such inter-phase situations, but it's risky. A friend of mine connected a sound system running from one mains connection to a system running from another mains connection and got some burnt electronics in response.
For such situations a wireless bridge is a welcome tool. Unfortunately, a professional transmitter/receiver pair for audio is quite expensive. Using a WLAN bridge is much cheaper.
With digital audio latency can become an issue. For example, when I send a microphone feed from my mixer to an FOH amp I should really have less than 30 ms latency; I really need a near-instantaneous audio transfer from my microphone to the FOH speakers.
I'm sure there are ready--to-buy professional low latency WLAN solutions for audio transmissions, but most of them will be expensive plus it's much more exciting to experiment than to buy. Alas, it'll be a while before I will come round to do the fiddling...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.