Friday, October 3, 2014

qAndora - A Cross Platform, FOSS, Pandora Radio Player

One of my goals for this year is to become proficient in a cross platform GUI tool kit. The toolkit I've chosen to get my hands dirty with is Qt because in addition to being cross platform it also has a fantastic amount of documentation.

I always find I learn programming easier when I am building some practical instead of going through various tutorials that you just throw away when you are done. So with that, my "learn Qt" project is something I'm calling qAndora:


qAndora is a cross platform, open source, Pandora Internet Radio client written in Python using Qt and VLC. If you would like to jump right to giving this little application a try you can find install instructions here. I have tested the player successfully on Ubuntu 14.04 and Windows 7, but it should work anywhere you can install VLC and run Python.

A few other random screenshots of the tool:




If you have any suggestions or feature requests please feel free to leave them in a comment below.

Cheers,
~Jeff Hoogland

18 comments:

  1. wanted to try it out, but getting error right after it plays for 1 second and get notification that the song is changing:

    "sni-qt/4466" WARN 11:09:56.354 void StatusNotifierItemFactory::connectToSnw() Invalid interface to SNW_SERVICE
    /usr/bin/qAndora: line 4: 4466 Segmentation fault (core dumped) python qAndora.py

    Using Mint 17 64-bit Cinnamon

    ReplyDelete
    Replies
    1. Sounds like Cinnamon is having an issue with PyNotfiy - it works as expected on KDE.

      If you disable notifications does it work properly? You can do this in ~/.config/qAndora/preferences.cfg if the GUI is dumping to quickly for you.

      Let me know how this goes.

      Delete
  2. build it on arch (64bit) and runs fine, plays audio fine and all options seem to work fine. Crashes with seg fault on song change.seems to add to song list then dumps. Would love to get you info to assist in fixing.

    ReplyDelete
    Replies
    1. attmepting to leave some contact info.

      Delete
    2. What desktop are you using? Does disabling desktop notifications have any effect on the crash?

      Delete
    3. using xfce4 and disabling any notifications and changing audio quality have no effect on the crash.
      it appears as if it is "loading" the new song information to the active window when it crashes.
      clicking FF to start a new song crashes it as well so it is easy to test (i dont have to listen to an entire song to see effects)
      also switching channels (which changes song) dies at the new song load.
      is there a switch to not display song info ?
      pausing and unpausing works fine (no crash out)

      strace :: (just last few lines)
      poll(, 1, -1) = 1
      writev(7, 0x00007fff6c9bf330, 3) = 40 (0x0000000000000028)
      recvmsg(7, 0x00007fff6c9bf230, 0) = -11 (Resource temporarily unavailable)
      poll(, 5, 165) = 0
      read(6, 0x00007fff6c9bf3d0, 16) = -11 (Resource temporarily unavailable)
      recvmsg(7, 0x00007fff6c9bf250, 0) = -11 (Resource temporarily unavailable)
      recvmsg(5, 0x00007fff6c9bf220, 0) = -11 (Resource temporarily unavailable)
      recvmsg(7, 0x00007fff6c9bf230, 0) = -11 (Resource temporarily unavailable)
      poll(0x0000000001d9de00, 5, 247)
      *** Process 4139 killed by signal SIGSEGV ***

      oh and just so i completely clear . the app loads up and works fine for one song (as long as you dont change channel which in turn loads a second song) and continues until the initial loaded song completes. It is only on song change that the crash occurs.

      Delete
    4. better strace ::
      poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}, {fd=8, events=POLLIN}, {fd=10, events=POLLIN}, {fd=7, events=POLLIN}], 5, 0) = 0 (Timeout)
      recvmsg(7, 0x7fff6fd4db90, 0) = -1 EAGAIN (Resource temporarily unavailable)
      recvmsg(5, 0x7fff6fd4db60, 0) = -1 EAGAIN (Resource temporarily unavailable)
      recvmsg(7, 0x7fff6fd4db70, 0) = -1 EAGAIN (Resource temporarily unavailable)
      poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}, {fd=8, events=POLLIN}, {fd=10, events=POLLIN}, {fd=7, events=POLLIN}], 5, 249
      +++ killed by SIGSEGV (core dumped) +++
      Segmentation fault (core dumped)

      again the last few lines only

      Delete
    5. What version of VLC are you using? The core dump like that makes me think it is one of the libraries I'm using dumping and not my application itself.

      When a python application crashes it will give you more specific output than what you've provided here.

      Delete
  3. vlc version : VLC media player 2.1.5 Rincewind (revision 2.1.4-49-gdab6cb5)
    arch uses python 3 as system default (i am running your app with python2)
    python 2 info : Python 2.7.8 (default, Sep 24 2014, 18:26:21)

    ReplyDelete
    Replies
    1. Hrm, well I can't reproduce this dump on Ubuntu 14.04 with VLC 2.1.4 and KDE or Enlightenment.

      Delete
    2. i can get python2 to segfault independently of your app. so i think that you may be on to something, what python modules/calls are you using in your app so i can ensure that those pieces are working correctly

      Delete
    3. PySide and VLC are the important ones. Look at the top of the qAndora.py for all the imports that are used.

      Delete
    4. is qAndora meant to be python 2 specific? if so will it be made to work with python 3 ?

      Delete
    5. Not working on Python 3 support any time soon. Python 2 is functional and can be installed along side 3. Very little reason for me to change to 3.

      Delete
    6. would readkey have anything to do with my crash ? (do you think?) i installed some perl requirements for another program - the one that i needed was readkey (( perl -MCPAN -e "install Term::ReadKey" )) and once it was installed qAndora.py stopped crashing .... now as i am on arch and it tends to have updates constantly -- that was the only one i did SPECIFICALLY and then when i tested it was working... just trying to narrow down what may have "caused" it to be fixed. Works a treat now and i am enjoying using it over pithos and pianobar(fly) though i do miss the capturing of the songs in the case of pianobarfly. Wonderful program and i look forward to the stuff you have on the addon features list.
      One comment about the program though -- if i "Heart" a song .. i do not see how i would know that i have liked the song... no indicator or am i just missing it?

      Great Program !! nice work.

      Delete
    7. If you favorite a song the icon will turn from a "star" into a "heart". If it already shows a heart then you've already favorited the song.

      If you have any feature requests let me know and I'll add anything reasonable to my TODO list. A "store" songs option is something I've considered adding, but I don't want to get into legal trouble for doing so.

      Delete
    8. not two minutes after i sent that message the heart/start made sense :) although it seems to "stick" once i heart a song every song appears "heart"ed ...
      not sure if its just my system being wonky but figured i would report it.

      completely understand the legality issue and being leery of the copy functionality.

      as for feature request :
      a mini-bar would be nice.. a minimized version of the app, even better if it could be embedded or added to a panel or reported to the pager.. something opendesktop standard would be preferable so that anyone could added it to a panel. but a minibar that could panel itself would be cool ... i am picturing a nice strip with the song name and the buttons.

      as i am not a programmer (i dabble a bit but nothing linux side at all) i dont know if that is a monster request so feel free to tell me "not a chance in hell. i do this for fun."

      been using the program nonstop since i got it working , had one crash and then i had to remove the preferences file to get it to start back up (maybe not had to but that fixed it for me)
      Thanks again and good job!

      Delete
    9. I don't believe there is a desktop standard for a "mini bar" like you are describing. If your desktop supports a systray qAndora already has a systray icon. From this icon you can hide the main window with a left click and right clicking lets you play/pause/skip/favorite songs.

      Are you sure all the songs it is showing with hearts you don't already have marked as favorites? qAndora here is accurately changing between a heart and a star when I have a song Favorited VS not.

      If you go to the pandora website you can select station details and view all of your thumbs'd up tracks.

      Delete