Streaming Music to the Chumby with PulseAudio and GStreamer

I spent a little while today figuring out how to stream the music I was playing in Rhythmbox (in the living room) to my Chumby (in the kitchen) . I found a nice article that explains how to set up a GStreamer pipeline for streaming the monitor output from PulseAudio through Icecast. It works quite well for streaming to the Chumby (except for a pretty significant lag). Here's the quick start guide for Ubuntu Intrepid:
  • Set up PulseAudio.
  • $ sudo apt-get install icecast2
  • Edit /etc/default/icecast2 to enable Icecast and /etc/icecast2/icecast.xml to set a password (defaults to "hackme").
  • $ sudo /etc/init.d/icecast2 start
  • Find the name of your PulseAudio monitor device by opening the manager from the PulseAudio applet. It should start with alsa_output.pci and end with monitor.
  • $ gst-launch pulsesrc device=<alsa_output.pci...monitor> ! audioconvert ! vorbisenc ! oggmux ! shout2send mount=/stream.ogg port=8000 password=hackme ip=127.0.0.1
  • Start sshd on your Chumby.
  • $ ssh root@<chumby_ip> btplay --output=alsa:plug:dmixer http://<server_ip>:8000/stream.ogg
I'm working on a Rhythmbox plugin for this. Stay tuned :)

Update
Plugin written.

3 comments:

  1. when i tried to cd /etc/icecast2
    it should permission denied

    ReplyDelete
  2. thank you, I am running Lucid 64bit, and if I type in:
    gst-launch-0.10 pulsesrc device=alsa_output.pci-0000_00_05.0.analog-stereo.monitor ! audioconvert ! vorbisenc ! oggmux ! shout2send mount=/testit.ogg port=8000 password=foo ip=127.0.0.1

    the command runs without error.
    (I am sure that I use the right pulseaudio-device, as it is the only one that shows up in my system which starts with "alsa_output.pci" and ends with "monitor".)

    I can connect to the stream, but then the clients shut down saying something like "no content"

    If I look at icecast2 error.log, it says:

    [2010-12-06 20:16:35] INFO format-vorbis/initial_vorbis_page seen initial vorbis header
    [2010-12-06 20:21:44] INFO format-vorbis/initial_vorbis_page seen initial vorbis header
    [2010-12-06 20:28:54] INFO connection/_handle_source_request Source logging in at mountpoint "/testit.ogg"
    [2010-12-06 20:28:54] INFO format-vorbis/initial_vorbis_page seen initial vorbis header
    [2010-12-06 20:28:55] INFO source/source_main listener count on /testit.ogg now 0
    [2010-12-06 20:29:05] WARN source/get_next_buffer Disconnecting source due to socket timeout
    [2010-12-06 20:29:05] INFO source/source_shutdown Source "/testit.ogg" exiting

    It seems as if nothing is send to icecast, and therefore the mountpoint shuts down 30 seconds later.

    ReplyDelete
  3. @Karl This is a known bug in Ubuntu that has been overlooked for over 7 months. See bug report: https://bugs.launchpad.net/ubuntu/+source/gst-plugins-good0.10/+bug/569651

    ReplyDelete