Go Back   Sonos Forums > Internet Radio

Reply
 
Thread Tools Display Modes
  #1  
Old Jan 25th, 2006, 04:57 AM
dksoft dksoft is offline
Digital Expert
 
Join Date: Jan 2006
Location: Germany
Posts: 18
Default Howto listen to digital radio (dvb) on SONOS

I am new to SONOS and one thing I miss is to listen to digital broadcast radio like dvb-s.

The solution to connect a radio receiver to the audio-input is not acceptable to me as I don't want to convert the digital radio signal to analog and back to digital on the SONOS. Also I want to switch channels and control volume via the SONOS remote and not with an additional remote.

Therefore I programmed a Linux shell script that simulates an internet radio to the SONOS. The script receives an url like "http://<nas-server>/cgi-bin/dvbradio.m3u?DBOX:HRINFO" from the SONOS and then switches the satellite receiver channel, retrieves the stream, re-encodes it, feeds stream and returns a m3u playlist to the SONOS, so it connects to my intranet radio. For each radio channel I have one entry in the Favorites list with another argument like HRINFO, SRJAZZ etc.

The "DBOX" option does lookup the satellite channel parameters from a table in the script. This only works for dreamboxes.

The "V4L" option does exactly the same but does not need a dreambox. It uses a dvb card using the Linux V4L2 interface. I am using an inexpensive Twinhead VP-1022A dvb-s card on Fedora Core 4 for that. The VLC you are using must have been compiled with dvb-enabled.

There is another option "URL" which allows to retrieve a stream given by argument. This stream is retrieved and re-encoded by VLC (video lan client). Thus the SONOS is able to play all file formats that VLC can decode. The url is passed after the "URL" option: "http://<nas-server>/cgi-bin/dvbradio.m3u?URL:http://213.254.239.60/swr3$livestream.wma" will retrieve the WMA stream and re-encode it to MPEG 1 layer III (MP3) so that the SONOS can play it. As the SONOS does play WMA anyway, this option is usefull for other internet radio formats like realplayer, AC3 or ogg-vorbis as long as VLC has support to decode it.

The last option is "STOP". This will stop the script and associated jobs. E.g. "http://<nas-server>/cgi-bin/dvbradio.m3u?STOP"

I am using a dreambox (http://www.dmmtv.de) satellite receiver for this. It sells for below 180 Euro and the smallest version DM500-s is enough. The dreambox connects via Ethernet, can be controlled by http and does return the radio channel's audio stream. There are, or will be, cable (dvb-c) and terrestrial (dvb-t) versions available beside the satellite (dvb-s) version I am using.

Nearly all german radio stations are available via dvb-s on Astra satellite. So dvb-s is the best choice over here. The problem with the SONOS is that it can not play MPEG 1 layer II format even it should as layer III decoders are to be backward compatible to layer II and I. Therefore I am decoding the dvb 128Kbs/48kHz layer II stream using lame to 320Kbs/48kHz layer III which has no real influence to the audio quality and runs amazing well on a 850MHz Pentium III PC that I use as a Linux based NAS.

The script runs under Linux on my NAS which holds all the media files. This is not plug-and-play. You need to have Linux scills to install and use it. Actually the script can be used with any MP3 player like SONOS, iTunes on PC and Mac, hifidelio or whatever is able to play an MP3 stream.

I am sharing this so some Linux guru might use it and make additions to it. The script is located at http://www.koeppen.name/SONOS/dvbradio-1.3.tz (Updated 21.2.2006, Version 1.3).

Have fun using it and share back whatever you change on it.

Last edited by dksoft; Feb 21st, 2006 at 07:02 AM.
Reply With Quote
  #2  
Old Jan 27th, 2006, 08:30 AM
Avee's Avatar
Avee Avee is offline
Moderator
 
Join Date: Oct 2005
Posts: 5,199
Cool

You get five stars from me... Very cool.

This is about the same Idea I had (the URL controlled reencoder), the only difference is that I didn't have the skills to code it.

You've got some new friends in the UK I guess, since there are a lot of people that want BBC on their Sonos badly.

Do you have the Sonos yourself, or are you sharing the stuff you made for your Hifidelio?
Reply With Quote
  #3  
Old Jan 28th, 2006, 11:45 AM
dksoft dksoft is offline
Digital Expert
 
Join Date: Jan 2006
Location: Germany
Posts: 18
Default

Quote:
Originally Posted by Avee
You get five stars from me... Very cool.

This is about the same Idea I had (the URL controlled reencoder), the only difference is that I didn't have the skills to code it.
Thanks, you have good ideas !

I have changed the script today so that it's using only VLC (no more lame, ices, icecast...). Before I did not figure out how to stream from VLC to the SONOS. Now I know and the script is very small and easy to configure, just hostname/port.

When it's running stable for a while, I will update this posting. Also I would like to see if I can get the radio stream directly from a dvb or analog TV-card in the Linux NAS. This way there is no more need for a dreambox. Let's see...

Quote:
Originally Posted by Avee
Do you have the Sonos yourself, or are you sharing the stuff you made for your Hifidelio?
I have both and started the script for the hifidelio.
Reply With Quote
  #4  
Old Feb 19th, 2006, 06:20 AM
jmccroha's Avatar
jmccroha jmccroha is offline
Digital Expert
 
Join Date: Dec 2005
Location: Paris, France
Posts: 33
Default but can it stream RealAudio

Hi DKSoft

The idea is great, and I have spent some time setting it up on my Linux box.

I have installed ices, icecast, lame, realplayer and vlc, although I suspect that I only need the last of these, as what I'm trying to achieve is to stream from a URL - specifically : http://www.bbc.co.uk/radio4/realplayer/media/fmg2.ram which is bbc radio 4 realaudio.

I've enabled VLC (disabled LAME) in the cgi script, and ensured that the paths are OK. But - even streaming WMA - I'm not getting anything. I can see the temporary files being created in /var/tmp.. but no result. I'm testing the stream by calling it from Windows XP IE - and Media Player does immediately launch - but is unable to connect to the stream.

By the way - for this to work, surely VLC would have to be able to handle realaudio, which, according to the projects website, it doesn't.

I'm still very enthusiastic - but would apreciate some help to understand if this can do what I and others are hoping it can do.

All the best

Jerry
Reply With Quote
  #5  
Old Feb 19th, 2006, 11:16 AM
dksoft dksoft is offline
Digital Expert
 
Join Date: Jan 2006
Location: Germany
Posts: 18
Default

Hi Jerry,

I have updated the above code to the latest version that I am using for a month now. This does no longer need wget, ices, icecast and lame for the transcoding. Everything, including streaming, is done by VLC only. Before I was not able to figure out how to stream from VLC to SONOS.

This should be very easy to be adopted now and you should be able to play at least the swr3 sample out of my initial posting.

As you said, the whole thing lives and dies with what VLC is able to decode. I gave your BBC4 stream a quick try and was not able to listen to it as VLC was not able to decode it. I checked in the VLC forum and there are a couple of postings referencing to BBC4. Maybe you want to have a look into that. I will have another look into that next week.

Good luck,
Dirk
Reply With Quote
  #6  
Old Feb 20th, 2006, 07:35 AM
dksoft dksoft is offline
Digital Expert
 
Join Date: Jan 2006
Location: Germany
Posts: 18
Default

Hi again, Jerry!

BBC4 is broadcasting on satellite ASTRA 2 free on air. So I added that channel to my DBOX option and can listen to it on my SONOS.

If you are really interested in that channel, you should think about using the satellite solution. You have a much better quality of 192kbs/48kHz MPEG against the 46kbs RealAudio stream what you can definitely hear. Also I found that the satellite stream is 10-15 seconds ahead of the RealAudio stream.

If you check the VLC forum you will find that VLC can definitely not decode Realaudio. Some report they can but only on Windows with the Real codec installed. Some kind of the Rhapsody solution. This configuration does also not allow to transcode the stream to MP3.
Reply With Quote
  #7  
Old Feb 21st, 2006, 11:24 PM
jmccroha's Avatar
jmccroha jmccroha is offline
Digital Expert
 
Join Date: Dec 2005
Location: Paris, France
Posts: 33
Default

Quote:
Originally Posted by dksoft
Hi again, Jerry!

BBC4 is broadcasting on satellite ASTRA 2 free on air. So I added that channel to my DBOX option and can listen to it on my SONOS.

If you are really interested in that channel, you should think about using the satellite solution. You have a much better quality of 192kbs/48kHz MPEG against the 46kbs RealAudio stream what you can definitely hear. Also I found that the satellite stream is 10-15 seconds ahead of the RealAudio stream.

If you check the VLC forum you will find that VLC can definitely not decode Realaudio. Some report they can but only on Windows with the Real codec installed. Some kind of the Rhapsody solution. This configuration does also not allow to transcode the stream to MP3.
THanks DKSoft. Looks like you've got a great solution for folks with DVB or satellite. The holy grail of BBC Radio 4 (and various other RA stations) isn't available to me over either of those media, so I'll continue to hope that Sonos will integrate a RealAudio decoder in a future release.

All the best

Jerry
Reply With Quote
  #8  
Old Feb 22nd, 2006, 12:35 PM
Avee's Avatar
Avee Avee is offline
Moderator
 
Join Date: Oct 2005
Posts: 5,199
Default

Sorry if I created confusion, I had the belief that VLC for Linux did Realaudio.

I googled a bit and found this page:
http://www.linuxdevcenter.com/pub/a/...ia.html?page=2
It describes that there are 3 console apps for Realaudio under Linux. As I understood, the Sonos runs Linux. So it is a bit of a mystery to me why Sonos still does not support real.

Maybe Graham can enlighten us... (money issues?)
Reply With Quote
  #9  
Old Feb 23rd, 2006, 03:27 AM
dksoft dksoft is offline
Digital Expert
 
Join Date: Jan 2006
Location: Germany
Posts: 18
Default

Quote:
Originally Posted by Avee
Sorry if I created confusion, I had the belief that VLC for Linux did Realaudio.
VLC does not support RealAudio natively but I compiled latest 8.5-svn with rtsp and realaudio enabled. If you want to play with it: http://www.koeppen.name/SONOS/vlc.tar (has also dvb, flac and mp4 enabled). Also you need to install the w32codec rpm to get the cook codec in /usr/lib/win32/cook.so.

This does connect to the BBC4 stream and plays it from time to time. That is I can hear word fragments every other minute. So it looks like RealAudio support in VLC is in work.
Reply With Quote
  #10  
Old Mar 9th, 2006, 11:52 AM
StuartW StuartW is offline
Member
 
Join Date: Oct 2005
Location: Windsor UK
Posts: 19
Default

A lot of this thread is hard for me to follow technically!
I , like many others want R4 ,
If I buy a DBOX . Which is the best one to buy ?
Whats a target price?
How does it get installed?

Thanks
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 06:13 PM.