OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Fun With Shoutcast
ironstorm
post Nov 19 2005, 12:42 AM
Post #1





Group: Members
Posts: 86
Joined: 10-August 03
Member No.: 331



I'm running OZ 3.5.4RC...

I've been trying to employ my Z5500 as a shoutcast reciever to pump sound into my stereo.

Unfortunately, the state of shoutcast in OZ is somewhat weak... That is to say neither XMMS (doesn't recognize streams at all) nor Opie-Player2 (crashes right away) can handle shoutcast streams.

This has forced me to fall back to the console, making use of mpg321... And while mpg321 recognizes streams and plays them back, it also skips during playback... I suspect either the Z is too slow or it suffers from the bug described here -> http://angerman.net/articles/jukebox/#mpg321 ...

Are there any other alternatives known to support shoutcast streams?

While we are at it is there any way to script volume changes?

I used to use aumix in the old days, however trying it now just gives an error (SOUND_MIXER_READ_RECSRC) ... I thought about trying to script the volume applet, but there is no documentation anywhere for it's support or lack of support for QCOP calls.

Cheers,

-G
Go to the top of the page
 
+Quote Post
humit
post Nov 19 2005, 10:59 AM
Post #2





Group: Members
Posts: 27
Joined: 9-February 04
Member No.: 1,774



Hi,

I recommend to use mplayer to listen stream media, if you have mplayer running on your Z, you can play shoutcast streams.

Actually I'm planning to write some scripts when I got time to get the pls links from shoutcast site to search, list & play them.

To give some quick&dirty hints, one can obtain the playlist urls on the frontapage of www.shoutcast.com with:

CODE
links -source www.shoutcast.com|grep shoutcast-playlist.pls|awk -F\" '{print "http://www.shoutcast.com"$6}'


it produces something like that:

CODE
http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=3281&file=filename.pls
http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=2297&file=filename.pls
http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=1346&file=filename.pls
http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=928&file=filename.pls


and this output could be used with mplayer (notice the double quotes)
CODE
mplayer -playlist "http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=8010&file=filename.pls"


the output from the command:
CODE
# mplayer -playlist "http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=8010&file=filename.pls"
MPlayer 1.0pre7-3.4.2 (C) 2000-2005 MPlayer Team
for Zaurus 1.1.5 (C) 2004-2005 AGAWA Koji (atty)
CPU: ARM
CPUflags: iWMMXt

Resolving www.shoutcast.com for AF_INET...
Connecting to server www.shoutcast.com[207.200.98.25]:80 ...
Cache size set to 320 KBytes
Connected to server: www.shoutcast.com
Unknown entry type Version=2
85 audio & 196 video codecs
CommandLine: '-playlist' 'http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=8010&file=filename.pls'
Failed to open /dev/rtc: Device or resource busy (it should be readable by the user.)
Playing http://194.158.114.66:8000.
Connecting to server 194.158.114.66[194.158.114.66]:8000 ...
Name   : FREQUENCE3 - www.frequence3.fr - No ads ! It's only HITS live from Paris France ! - French Webradio
Genre  : Top 40 Dance Pop Rock
Website: http://www.frequence3.fr
Public : yes
Bitrate: 192kbit/s
Cache size set to 320 KBytes
Connected to server: 194.158.114.66
Cache fill: 17.50% (57344 bytes)    Audio file detected.
==========================================================================
Requested audio codec family [mp3] (afm=mp3lib) not available.
Enable it at compilation.
Opening audio decoder: [libmad] libmad mpeg audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 192.0 kbit/13.61% (ratio: 24000->176400)
Selected audio codec: [mad] afm:libmad (libMAD MPEG layer 1-2-3)
# mplayer -playlist "http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=3281&file=filename.pls"
MPlayer 1.0pre7-3.4.2 (C) 2000-2005 MPlayer Team
for Zaurus 1.1.5 (C) 2004-2005 AGAWA Koji (atty)
CPU: ARM
CPUflags: iWMMXt

Resolving www.shoutcast.com for AF_INET...
Connecting to server www.shoutcast.com[207.200.98.25]:80 ...
Cache size set to 320 KBytes
Connected to server: www.shoutcast.com
Unknown entry type Version=2
85 audio & 196 video codecs
CommandLine: '-playlist' 'http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=3281&file=filename.pls'
Failed to open /dev/rtc: Device or resource busy (it should be readable by the user.)
Playing http://64.236.34.196:80/stream/1074.
Connecting to server 64.236.34.196[64.236.34.196]:80 ...
Name   : CLUB 977 The Hitz Channel (HIGH BANDWIDTH)
Genre  : Pop Rock Top 40
Website: http://www.hitsradio.com
Public : yes
Bitrate: 128kbit/s
Cache size set to 320 KBytes
Connected to server: 64.236.34.196
Cache fill: 17.50% (57344 bytes)    Audio file detected.
==========================================================================
Requested audio codec family [mp3] (afm=mp3lib) not available.
Enable it at compilation.
Opening audio decoder: [libmad] libmad mpeg audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mad] afm:libmad (libMAD MPEG layer 1-2-3)
==========================================================================
Checking audio filter chain for 44100Hz/2ch/s16le -> 44100Hz/2ch/s16le...
AF_pre: 44100Hz/2ch/s16le
AO: [oss] 44100Hz 2ch s16le (2 bps)
Building audio filter chain for 44100Hz/2ch/s16le -> 44100Hz/2ch/s16le...
Video: no video
Starting playback...
A:   3.0 (03.0)  9.2% 16%                                                                                            


p.s: I tested this on my sl-C3000 but i think once you install the mplayer it runs on any Z.
Go to the top of the page
 
+Quote Post
lpotter
post Nov 20 2005, 09:58 AM
Post #3





Group: Members
Posts: 451
Joined: 27-November 03
From: Brisbane, Australia
Member No.: 1,001



opieplayer (1) handles shoutcast streams
Go to the top of the page
 
+Quote Post
ironstorm
post Nov 20 2005, 11:06 AM
Post #4





Group: Members
Posts: 86
Joined: 10-August 03
Member No.: 331



QUOTE(humit @ Nov 19 2005, 10:59 AM)
p.s: I tested this on my sl-C3000 but i think once you install the mplayer it runs on any Z.
*


It installs on my z5500, starts up as if it's going to play, but all I get is 'click... click,click ... click' as far sound goes.... sad.gif

With the screen being so small on the 5500, there's really not much use in a text browser... so I stick with `wget -qO -` for pulling down html source...

QUOTE(lpotter @ Nov 20 2005, 09:58 AM)
opieplayer (1) handles shoutcast streams
*


Yeah, I figured this out last night... It seems its the only option that handles streams properly - it doesn't skip at all. biggrin.gif
It doesn't like remote playlists but it doesn't mind local playlists with remote streams, which is alright.

Wrote a script to start up the player using qcop:
CODE
#!/bin/sh

# XTC Radio
wget -qO - http://stream.xtcradio.com:8069/listen.pls > /tmp/playlist.pls
qcop QPE/Application/opieplayer 'setDocument(QString)' '/tmp/playlist.pls'


Apparently it supports the following QCOP commands:
CODE
qcop QPE/Application/opieplayer 'play()
qcop QPE/Application/opieplayer 'stop()
qcop QPE/Application/opieplayer 'togglePause()
qcop QPE/Application/opieplayer 'next()
qcop QPE/Application/opieplayer 'prev()
qcop QPE/Application/opieplayer 'toggleLooping()
qcop QPE/Application/opieplayer 'toggleShuffled()
qcop QPE/Application/opieplayer 'play(QString)' 'fullpath_to_local_audio_or_m3u_or_pls'
qcop QPE/Application/opieplayer 'add(QString)' 'fullpath_to_local_audio_or_m3u_or_pls'
qcop QPE/Application/opieplayer 'rem(QString)' 'fullpath_to_local_audio_or_m3u_or_pls'
qcop QPE/Application/opieplayer 'setDocument(QString)' 'fullpath_to_local_audio_or_m3u_or_pls'


It looks as if 'volUp()' & 'volDown()' might work given there close position inside the opieplayer binary (when using `strings` on it), however they don't seem to do anything when invoked.

So, I have no way as of yet to control volume/mute... since aumix is broken and I can't figure out if VolumeApplet has any qcop interface...
Go to the top of the page
 
+Quote Post
ironstorm
post Nov 27 2005, 11:39 AM
Post #5





Group: Members
Posts: 86
Joined: 10-August 03
Member No.: 331



Thanks to rabies in the IRC channel, I found out why my Mplayer playback was failing, the default codec doesn't work on OZ3.5.4RC/Collie...

CODE
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 44100 Hz, 2 ch, 16 bit (0x10), ratio: 20000->176400 (160.0 kbit)
Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)

^^^ - that's the default non-working codec...

Using:
CODE
mplayer -ac mad SONG_or_STREAM


forces the codec over to libmad:
CODE
Forced audio codec: mad
Opening audio decoder: [libmad] libmad mpeg audio decoder
AUDIO: 44100 Hz, 2 ch, 16 bit (0x10), ratio: 20000->176400 (160.0 kbit)
Selected audio codec: [mad] afm:libmad (libMAD MPEG layer 1-2-3)


which plays back local MP3s and remote shoutcast streams without any skipping. smile.gif

I can control the volume using / (down),* (up), m (mute) ... so I'm pretty happy with this solution for now.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 12th July 2014 - 06:57 AM