Release [REPO]RetroRadio

Discussion in 'Software Releases' started by KickAss, Jul 18, 2013.

  1. KickAss

    KickAss Very Active Member

    Joined:
    Mar 9, 2011
    Messages:
    566
    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: Jul 20, 2013
    Tags:
    THB likes this.
  2. THB

    THB Member

    Joined:
    Sep 4, 2010
    Messages:
    265
    Location:
    Melbourne, Australia
    This sounds pretty cool, will have to check it out when I get home.
     
  3. EvilDragon

    EvilDragon Administrator Staff Member

    Joined:
    Mar 4, 2003
    Messages:
    19,669
    Location:
    Ingolstadt
    Oh, wow, that's totally neat! Thanks :D
     
  4. ekianjo

    ekianjo Hardcore Member

    Joined:
    May 7, 2012
    Messages:
    8,261
    Location:
    神戸市、日本 (Japan)
    sounds cool, will try that later tonight :)
     
  5. EvilDragon

    EvilDragon Administrator Staff Member

    Joined:
    Mar 4, 2003
    Messages:
    19,669
    Location:
    Ingolstadt
    You should mention in the description that it needs the codec pack, as you don't have mplayer included :)
     
  6. KickAss

    KickAss Very Active Member

    Joined:
    Mar 9, 2011
    Messages:
    566
    Location:
    Germany
    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.
     
  7. ekianjo

    ekianjo Hardcore Member

    Joined:
    May 7, 2012
    Messages:
    8,261
    Location:
    神戸市、日本 (Japan)
    You should check radiotray for playlist support. It has it. Since the source is available that may be helpful. 
     
  8. KickAss

    KickAss Very Active Member

    Joined:
    Mar 9, 2011
    Messages:
    566
    Location:
    Germany
  9. ekianjo

    ekianjo Hardcore Member

    Joined:
    May 7, 2012
    Messages:
    8,261
    Location:
    神戸市、日本 (Japan)
    Why do you use os.spawnl ? There are other ways to launch external applications. 
     
  10. ekianjo

    ekianjo Hardcore Member

    Joined:
    May 7, 2012
    Messages:
    8,261
    Location:
    神戸市、日本 (Japan)
    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)
     
    KickAss likes this.
  11. ekianjo

    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: Jul 18, 2013
  12. KickAss

    KickAss Very Active Member

    Joined:
    Mar 9, 2011
    Messages:
    566
    Location:
    Germany
    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.
     
  13. ekianjo

    ekianjo Hardcore Member

    Joined:
    May 7, 2012
    Messages:
    8,261
    Location:
    神戸市、日本 (Japan)
    If nothing works try stackoverflow
     
  14. KickAss

    KickAss Very Active Member

    Joined:
    Mar 9, 2011
    Messages:
    566
    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: Jul 20, 2013
  15. ekianjo

    ekianjo Hardcore Member

    Joined:
    May 7, 2012
    Messages:
    8,261
    Location:
    神戸市、日本 (Japan)
    does not work for me. I dont get any sound when tuning in...
     
    Last edited by a moderator: Jul 18, 2013
  16. KickAss

    KickAss Very Active Member

    Joined:
    Mar 9, 2011
    Messages:
    566
    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 :€
     
  17. ekianjo

    ekianjo Hardcore Member

    Joined:
    May 7, 2012
    Messages:
    8,261
    Location:
    神戸市、日本 (Japan)
    I didn't install the application until today, so I doubt it's a appdata folder issue :)
     
  18. Kumaki

    Kumaki Well-Known Member

    Joined:
    Jan 16, 2012
    Messages:
    2,090
    Location:
    Lizard Lick, North Carolina
    How would you even find what stations are out there?

    I assume this app will require the use of wifi?
     
  19. KickAss

    KickAss Very Active Member

    Joined:
    Mar 9, 2011
    Messages:
    566
    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: Jul 18, 2013
  20. Kumaki

    Kumaki Well-Known Member

    Joined:
    Jan 16, 2012
    Messages:
    2,090
    Location:
    Lizard Lick, North Carolina
    So this, really, could pick up ANY streamed radio signal?  Not just retro chip tunes?
     

Share This Page

Loading...