Release [REPO]RetroRadio

KickAss

Very Active Member
Joined
Mar 9, 2011
Messages
580
Location
Germany
RetroRadio let's you tune in to the finest retro/c64/amiga/sid/tracker radio stations out there. With RetroRadio theres retro everywhere (well, as long as there's internet).

This time i brought zenity to its very limits. List comprehension and file operations are done by python. The actual audio streaming is done by mplayer.

Radio station data is read from a comma separated file (retroradio.cfg) in the appdata folder. It comes with some default stations but can of course be modified to your liking. The file will then be parsed the next time you start the app and the new entries will be available.

Most stations are using multiple relays, so some of the links in the list might not be working temporarily. mplayer can't stream playlists (as in .pls files and similar) and thus can't check all of the available relays at once. I will think about some mechanism to find the best working relay links of each station at given time.

Please enjoy and let me know what you think.

UPDATE: On the repo now :)
 
Last edited by a moderator:
  • Like
Reactions: THB

EvilDragon

Administrator
Staff member
Joined
Mar 4, 2003
Messages
29,245
Age
42
Location
Ingolstadt
You should mention in the description that it needs the codec pack, as you don't have mplayer included :)
 

KickAss

Very Active Member
Joined
Mar 9, 2011
Messages
580
Location
Germany
You should mention in the description that it needs the codec pack, as you don't have mplayer included :)
so true. will fix that.

what i said before about mplayer not being able to stream playlists is not true, btw. im working on this. but im stuck
right now. identic code without any pnd specific statements wont run from inside the pnd, while running nicely on the outside. strange.
 

ekianjo

Hardcore Member
Joined
May 7, 2012
Messages
8,261
Location
神戸市、日本 (Japan)
someone give me a hint: in bash: mplayer -playlist http://somesite.com/stream.m3u works like expected. in python: os.spawnl(os.P_NOWAIT,'/usr/bin/mplayer','-playlist','http://somesite.com/stream.m3u') somehow ignores the -playlist argument. cant get it done. drives me nuts!
Try this:

command = ['/usr/bin/mplayer','-playlist','http://somesite.com/stream.m3u]

os.spawnlp(os.P_NOWAIT, *command)

or this:

from subprocess import Popen

command = ['/usr/bin/mplayer','-playlist','http://somesite.com/stream.m3u]

Popen(command)
 

ekianjo

Hardcore Member
Joined
May 7, 2012
Messages
8,261
Location
神戸市、日本 (Japan)
One potential correction : you may not need the '-' in front of the argument in the command line. Please try with and without, I cant remember if it is essential or not.
 
Last edited by a moderator:

KickAss

Very Active Member
Joined
Mar 9, 2011
Messages
580
Location
Germany
someone give me a hint: in bash: mplayer -playlist http://somesite.com/stream.m3u works like expected. in python: os.spawnl(os.P_NOWAIT,'/usr/bin/mplayer','-playlist','http://somesite.com/stream.m3u') somehow ignores the -playlist argument. cant get it done. drives me nuts!



Try this:

command = ['/usr/bin/mplayer','-playlist','http://somesite.com/stream.m3u]
os.spawnlp(os.P_NOWAIT, *command)

or this:

from subprocess import Popen
command = ['/usr/bin/mplayer','-playlist','http://somesite.com/stream.m3u]
Popen(command)
thanks.
your os.spawnlp call matches mine. still no luck.
i need to use os.spawn because i need the mplayer process to run inattended in the background. otherwise further zenity interaction isnt possible and the user will not be able to end the process (at least not from within the app). also os.spawn gives me the correct pid, which is totally usefull to end the correct process. this is way more elegant than searching for "mplayer" processes and halting them. that way it doesnt interfer with other applications running mplayer simultaneously.
subprocess would be the tool of choice, but i dont know of any way to push the process to the background, so the zenity routine can continue before the process comes to an end.

will work this out tonight.
 

KickAss

Very Active Member
Joined
Mar 9, 2011
Messages
580
Location
Germany
thanks a lot for all the suggestions.

in the end a simple (but mighty) .strip() did the trick.

was parsing the stream urls from a file and passing it on to mplayer as a commandline option withoup stripping whitespace and newlines. no wonder the mplayer call wasnt carried out properly.

so this should be repo-ready now.

all the default stations work for me.

please test once more :)
 
Last edited by a moderator:

KickAss

Very Active Member
Joined
Mar 9, 2011
Messages
580
Location
Germany
you didnt delete your previous retroradio.cfg (in the appdata folder).

but you will have to. the old links arent playlists and thus cant work.

just delete the file and your good to go :€
 

KickAss

Very Active Member
Joined
Mar 9, 2011
Messages
580
Location
Germany
?
it gathers audio stream links from a formatted (and editable) file into a list to let you choose from. the format is as follows:

radio station name, audio stream
link (.m3u, .pls and the like). the chosen link is then passed on to mplayer which will start streaming the audio.
of course the stream data will be transmitted over some sort of network, be it wired or wireless. long story short: yeh, its absolutely useless without internet.

the point is to provide some sort of easily maintainable archive of chiptune audio ressources.
it is actually inspired by _wb_'s game soundtracks. when it comes to chiptunes, theres no real cool application. you usually collect chiptune files (.sid or tracker files) in noumerous winamp/xmms playlists on your local machine. retroradio enables you to just tune in to cool chiptune sounds with the click of a button. wherever you are (again, as long as theres internet). it provides quality retro sound ressources but can be extended to any sound you like (by adding stations to the list file).

retroradio uses a streambuffer size of 256 kbyte. the buffer needs to be partially filled before mplayer can start playing. so if your connection is slow, it might take some seconds. 256kbyte seems to work alright. usually streaming starts without delay and the buffer is big enough to keep you playing should you lose your connection temporarily.

retroradio is designed to prefer ipv4 connections. in most cases this means, that streaming starts faster (because connection attempts to ipv6 relays are cut out). some stations use ipv6 only, in those cases retroradio will fall back to ipv6, but the connection attempt to the relay may take a little longer. with a little patience it will start streaming, eventually :)

oh, one more thing: the provided links must be playlists, not single audio files (.m3u and .pls are good - .mp3 or .ogg are bad).

how would you find additional stations?
dunno, google maybe? i dont know of a maintained retro/chiptune radio stations archive. the ones i provided surely are amongst the most well known.
 
Last edited by a moderator:
Top