As I'm not allowed to code last days (studies >:() I tried to get something working I wanted for a long time: be able to run my favorite media player on my desktop (I must confess that's Amarok), and playback the music using a hifi chain in another room.
As currently I don't have a wifi network at home, I can't do "the real thing" yet, but testing can be done using usbnet (little howto on how to set up that might follow later).
After lots of searching and great help on several IRC channels, I got things working fine now.
Let's start with a little overview of the setup.
- Music player: Amarok using the Xine backend, using alsa
- Streaming server: Icecast2
- Icecast source: gst-launch using the shout2cast sink
- Just the standard audio player
Here's how to set up things correctly:
- Install icecast2 on your system (this is distribution dependant)
- Configure the server. You can run icecast as a system service, or as a normal user. I chose to run it as a normal user:
- Copy /etc/icecast2/icecast.xml to some directory
- Change "logdir" to some directory you got write permissions for
- Start the server: icecast -c icecast.xml (add -b to daemonize)
- Start some media player
Now we got to get the media player's output to our icecast server. As the 770 cannot playback ogg/vorbis, but can handle mp3, we'll use mp3 here. I know that might be non-free etc, but let's be pragmatic.
To get the alsa sound to the server, one might use DarkIce, but I could not get this working, so I used a simple gstreamer pipeline instead:
gst-launch-0.10 alsasrc device=plughw:0,0 ! audioconvert ! lame ! shout2send mount=amarok
You might need to change the "device" parameter, you can change the "mount" parameter of shout2send too (although you'll have to adjust the URI used later too, of course). I'm using the default password ("hackme") in this setup, if you don't, or want to set other options, see
gst-inspect-0.10 shout2sendfor more info.
- When that's running fine, open a browser, and go to http://localhost:8000. If all goes well, the "amarok" mount should be listed there. Do not open the stream, as this'd create a loop!
- Finally, launch the audio player on your 770 device, open the menu, "Playlist -> Add Stream...", and enter here the URI of the stream. In my setup, this is http://192.168.2.1:8000/amarok. Now start playback.
- The 770 should buffer some data, then start playback.
Currently, I stream my Amarok's output to my device using usbnet, and got my normal computer speaker connected to the jack output. Works fine :-)
If you're using Amarok too, take a look at the "Web Control" script. When running this script, you can open the 770's browser, and browse to http://192.168.2.1:4774 (adjust the IP). Now you're able to control Amarok from your device, and look at the current playlist. No need to walk to your desktop. The web interface might need some love though.
That's about it, have fun!