PDA

View Full Version : Linux RealAudio streaming



Andy Kelk
2004-01-20, 06:10
Colin Burn-Murdoch wrote:
> Do you also get the error (or no sound at least) when you use
> the link in SlimServer? Also did you try it in any other
> player? mpg123, xmms, winamp, etc?

I've now got all of the BBC radio stations playlisted.

Interestingly, when I try and play Radio 4, it comes out double-speed.
I've tried this from the command line and grabbing the data from
trplayer and saving to an .au file works fine. Piping it into lame
causes the speed increase. So it looks like there's some kind of sample
rate inconsistency between the rest of the BBC streams and Radio 4. Not
that I mind as if I listen to R4 I'll do it on the radio...

Couple of other things I spotted, the main process gives lots of
warnings such as: "Wide character in print at
/usr/local/bin/rm2mp3proxy.pl line 66, <GEN5> line 2." This doesn't
affect the output as I can tell and seems to be something to do with
Perl's unicode (This is perl, v5.8.0 built for i386-linux-thread-multi)
on a RH9 box.

Also, I don't know why but the trplayer/vsound setup only seems to work
when running as root. I thought it was something to do with the
permissions on /dev/dsp or /dev/audio as I've had problems with that
before with mpg123. But I fixed up those and also I don't think that
vsound uses those devices (From what I can gather, the calls to /dev/dsp
are overloaded and written to disk/stdout instead).

But I am very happy to be able to get realaudio via slimserver, it opens
up a whole world of opportunity.

Andy


--
Andy Kelk
Head of Integration, Venda
andy (AT) venda (DOT) com

Colin Burn-Murdoch
2004-01-20, 06:20
> Also, I don't know why but the trplayer/vsound setup only seems to work
> when running as root. I thought it was something to do with the
> permissions on /dev/dsp or /dev/audio as I've had problems with that
> before with mpg123. But I fixed up those and also I don't think that
> vsound uses those devices (From what I can gather, the calls to /dev/dsp
> are overloaded and written to disk/stdout instead).


Hmm, that's odd.... /dev/dsp doesn't enter into it you're right... I'm
running it fine on a gentoo box as a regular user and it's working fine. I
don't know enough about trplayer/vsound to suggest anything though. I'll
check out the radio 4 issue tonight.

One thing to be careful of... i have done no checking on the url requested,
so if someone made a dodgy request, eg
http://yourmachine:2020/file;rm%20-r%20/; it would probably wipe your system
seeing as you're running as root!! Purely theoretical as i doubt this is
accessible from the net, but thought i'd mention it anyway.... might fix
that at some point too :)

Colin.

Roy M. Silvernail
2004-01-20, 06:27
Andy Kelk said:

> Interestingly, when I try and play Radio 4, it comes out double-speed.
> I've tried this from the command line and grabbing the data from
> trplayer and saving to an .au file works fine. Piping it into lame
> causes the speed increase.

Lame assumes a 44.1 kHz sample rate and 2-channel input when accepting raw
data. You can specify the input sample rate with '-s x' (where x is the
rate), but hardcoding things like that is a hassle. Better to feed lame
an aiff stream, so the header will set things correctly.
--
Roy M. Silvernail is roy (AT) rant-central (DOT) com, and you're not
http://www.rant-central.com is the new scytale
Never Forget: It's Only 1's and 0's!
SpamAssassin->procmail->/dev/null->bliss

Roy M. Silvernail
2004-01-20, 06:32
Andy Kelk said:

> Interestingly, when I try and play Radio 4, it comes out double-speed.

Can't let this go without a solution. :)

'vsound -r 44100' will resample its input to 44100 Hz. That should take
care of the double-speed problem with lame, without breaking streams that
are already 44.1.
--
Roy M. Silvernail is roy (AT) rant-central (DOT) com, and you're not
http://www.rant-central.com is the new scytale
Never Forget: It's Only 1's and 0's!
SpamAssassin->procmail->/dev/null->bliss