1

I am programming a Rasberry to Pi to become a radio player. It is meant to be used to play the local college radio in the student union hangout.

INPUT: Power is turn on.

OUTPUT: Audio is played through the 3,5 mm jack.

PROCESS: 1) Device boot Raspdebian 2) ... 3) Start playing an ogg stream (/radiocampus_local.m3u)

How can I do this?

  • you have tried something already? my approach would be to write a small script (bash,perl,python) which is able to start the stream playing. if this is done you can invoke your script after boot. i described how to do it with a jar file here: raspberrypi.stackexchange.com/questions/13034/… – Alex Tape Mar 5 '14 at 10:08
1

OK. You can do this by adding a few commands to /etc/rc.local:

amixer cset numid=3 1 # force audio through the headphone jack
ogg123 -@ /home/pi/radiocampus_local.m3u # start playing music!

You may also need to edit /boot/config.txt so that hdmi_drive=0 to ensure audio comes out the 3.5 mm jack.

This assumes that your network is configured correctly, of course.

  • I forgot, if ogg123 isn't installed, it can be installed by running "sudo apt-get install vorbis-tools". – Fred Mar 4 '14 at 22:47
  • You could also add a loop + sleep to make it restart, in case the network connection is unstable – Jervelund Apr 4 '14 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.