maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Multimedia (https://talk.maemo.org/forumdisplay.php?f=32)
-   -   [application] pyPianobar (with pianobar) (https://talk.maemo.org/showthread.php?t=42104)

fatalsaint 2010-01-25 04:31

[application] pyPianobar (with pianobar)
 
pyPianobar

pyPianobar is a python2.5-qt4 (PyQt4) front-end for the pianobar Pandora radio client.

Why??
Currently, the Pandora website works fine in the N900 browser and thus, many people have decided a GUI application for it is not necessary. I disagreed, as did a couple others. The Pandora website is entirely flash, and while the N900 brings flash to our browser (which is excellent) - flash is also very CPU intensive and sluggish.

Pianobar steps in to be extremely lightweight, taking almost no overhead, and permits us to listen to our favorite online radio station in the background. Unfortunately, it's completely command line driven and as such, rather unintuitive.

This gave birth to pyPianobar. It is my first PyQt4 application and I welcome any feedback. It controls pianobar in the back-end allowing users to "click" a button to perform tasks.

Features:
  • Login to pianobar via username/password popup box
  • Skip Songs
  • Play/Pause
  • Change Stations
  • "Like" songs
  • "Hate" songs
  • Display Title, Artist, and Album
  • Display album art
  • Complete integration with the pianobar default config file (~/.config/pianobar/config)
  • Create & Delete stations
  • Configure Last.fm username/password (requires restart of pyPianobar)
  • Snooze
  • Mark songs "Tired"

Known Issues:
  • Station list will not load if an auto-play station is in the config-file.
  • Python-Qt4 bindings are non-optified! Keep this in mind! Reports say it takes 44MB of rootfs. -- No longer an issue.

To be done:
  • Add more skins. Currently "white" is the only one.

How??
  1. We are in Extras!
  2. Locate pyPianobar in Application Manager and Install
  3. Launch pyPianobar from Applications menu
  4. If you have an N800/N810, please see these instructions instead.
Vote for Pianobar here, and pyPianoar here to promote to Extras!!! Pick the current version in Extras Testing ARMEL.

Why Python??

Simplicity. Using python, not only is this application runnable on the N900 - but it should also work with the next Maemo 6 model if they keep QT compatibility, and it also runs on Desktop Linux. This should, in theory, run on any device that supports python2.5 and qt4. I have included screenshots from the SDK, Desktop Ubuntu, and an N900.


Show me the Money!
The N900:
http://img51.imageshack.us/img51/689...0020410304.png
http://img691.imageshack.us/img691/9...0020410312.png
http://img519.imageshack.us/img519/2...0020909244.png
Thanks Thorprime!

The SDK:
http://packages.linuxniche.net/SDK-pyPianobar.png

Desktop Ubuntu:
http://packages.linuxniche.net/Ubuntu-pyPandora.png

Special thanks goes to Thorprime for the interface and current screenshots and to Bratag for helping me test on a live N900 device!

Thorprime 2010-01-25 18:09

Re: [application] pyPianobar (with pianobar)
 
Installed on my N900 along with the Python-Qt4 bindings, was just getting seg-faults starting it up. (And yeh, those python Binding do eat alot of root space. About 25MB in root (of the 44MB of packages)

fatalsaint 2010-01-25 18:10

Re: [application] pyPianobar (with pianobar)
 
pyPianobar or just pianobar?

Try running it in a terminal and tell me what it's saying:

Code:

python2.5 /opt/pyPianobar/pyPianobar.py

ceroberts75 2010-01-25 18:22

Re: [application] pyPianobar (with pianobar)
 
following the thread

fatalsaint 2010-01-25 19:43

Re: [application] pyPianobar (with pianobar)
 
Packages should now be in Extras-Devel. If anyone can confirm for me I'll update the OP so you don't need to download the deb's directly.

If you have it installed previously, it should ask you to upgrade - the versions in Extras-Devel are newer than the OP. Thor - can you test the new one and see if segfaulting is still a problem?

Thorprime 2010-01-25 20:04

Re: [application] pyPianobar (with pianobar)
 
When running it from the terminal, the only output was the segmentation fault. I didn't check for a memory dump. I'll try installing from the repo and let you know how it goes then.

--Edit--
The new version in the repo works great. Awesome Job man.

Also, the Icons I sent you were definitely themed for the Orange N900 skin. Should prob add a feature in the todo for creating icon sets to match the other default skin (and maybe a N810 skin as well?)

http://img171.imageshack.us/img171/6...reenshot02.png

Also, is the "Tired" button supposed to quit? Doesn't seem to output an error when clicked after running from the console, so I assume that is the desired result?

fatalsaint 2010-01-25 21:46

Re: [application] pyPianobar (with pianobar)
 
OH!

Yeah I should mention that... So that sleep button actually cleanly exits the program :D. Sorry about that... eventually it will of course popup a timer that will shut the app down after so long.

Currently the "after so long" is "now" :D.

Thorprime 2010-01-25 21:48

Re: [application] pyPianobar (with pianobar)
 
Shouldn't the button map to the "t" key in pianobar? Which tells pandora you are tired of the song playing and would like not to hear it again for a while?

fatalsaint 2010-01-25 21:52

Re: [application] pyPianobar (with pianobar)
 
Quote:

Originally Posted by Thorprime (Post 494417)
Shouldn't the button map to the "t" key in pianobar? Which tells pandora you are tired of the song playing and would like not to hear it again for a while?

I've never used that... I always just used the Thumbs Up/Down (+ / -).

Didn't even know a "t" command existed... I just assumed the button was meant for something akin to "snooze" mode on radios. On my android phone I have to use a separate sleeptimer app to close my pandora every night when I go to bed.

fatalsaint 2010-01-25 22:22

Re: [application] pyPianobar (with pianobar)
 
So now you've got me thinking. Something like that "tired" I could see being useful and is something that fits better being a button on the main screen with the like and dislike, and moving the "snooze" idea to the menu.

But the problem I see is.. everyone I show the interface to thinks the same thing. The ZZZ is a snooze... I wonder how many people might be telling Pandora that they are tired of a bunch of songs they aren't really tired of if I make it function like that?

Thorprime 2010-01-25 22:48

Re: [application] pyPianobar (with pianobar)
 
I agree that the zzz is somewhat confusing, but I'm having a hard time coming up with an icon that expresses the idea that you are tired of a song. (Pandora hides this feature one menu deep in its UI.)

It seems like the kind of feature that doesn't belong buried in a menu on a tough screen interface, for use say when you are driving.

Really what the feature is, is a temp-ban. But I can't really think of an icon for that either.... hmmm...

ideas?

fatalsaint 2010-01-25 22:55

Re: [application] pyPianobar (with pianobar)
 
I've never really used the Pandora's main website. I was introduced with my G1 using the "official" G1 app.

It annoys you about skipping songs every time you reach 6 per hour, doesn't show song length, lets you Skip, Up, Down, and show/create/delete stations, and Buy. That's it..

So this tired idea is new to me... I get what you're saying it does though. I'll have to think on a button idea.. Remember I'm the one that used ASCII text :D.

karim0028 2010-01-26 00:13

Re: [application] pyPianobar (with pianobar)
 
Hi,

I downloaded from repo and every time i run pypianobar i get "Painobar experienced an error. We are closing."

Can you please help me get it running?

fatalsaint 2010-01-26 00:33

Re: [application] pyPianobar (with pianobar)
 
run:

Code:

pianobar
in a terminal and let me know the output.

karim0028 2010-01-26 00:42

Re: [application] pyPianobar (with pianobar)
 
Quote:

Originally Posted by fatalsaint (Post 494679)
run:

Code:

pianobar
in a terminal and let me know the output.

Sorry, im ******ed :) I was entering my username and forgot that it was my email not just my handle... ie. was missing @gmail.com

It seems to work now.

fatalsaint 2010-01-26 00:43

Re: [application] pyPianobar (with pianobar)
 
In a future release I will include the pianobar error message with that quit message. Will definitely help in troubleshooting :).

Thanks for bringing that to my attention. I also plan to make it so that if pianobar fails out unexpectedly, it will reopen it instead of having to kill the entire application.

fatalsaint 2010-01-30 06:30

Re: [application] pyPianobar (with pianobar)
 
I uploaded a new pianobar package.. but it's the same pianobar binary. I noticed in my postinst script when I copied over the config file I didn't chown the file to user:users... so it wouldn't do ya much good :D.

Course.. took me 3 update packages to get the stupid thing right >.>. Sometimes I need to slow down and think.

I also have a new pyPianobar mostly ready.. just waiting on some testers to get back to me with reports from real N900 devices before I put them into the devel repo's.

RockCreek1 2010-01-30 11:26

Re: [application] pyPianobar (with pianobar)
 
Just want to add my support for this. Love Pandora, listened to it all the time on my G1. Can't open it on the N900. When I contacted Pandora a few weeks ago to see if they were considering an app. for N900, their response was, don't hold your breath that it was very unlikely Pandora would devote any attention to this.

karim0028 2010-01-30 16:34

Re: [application] pyPianobar (with pianobar)
 
Hi Fatal,

I had pypianobar installed and then i un-installed it and tried installing it again and i am getting missing dependencies

Application package missing: python2.5-qt4-opengl

How can i fix this?

karim0028 2010-01-30 16:46

Re: [application] pyPianobar (with pianobar)
 
BTW, also, any plans to make it store username and password, its kind of inconvenient to have to enter those every time you want to use the app....

fatalsaint 2010-01-30 18:03

Re: [application] pyPianobar (with pianobar)
 
Quote:

Originally Posted by karim0028 (Post 502695)
BTW, also, any plans to make it store username and password, its kind of inconvenient to have to enter those every time you want to use the app....

This is in the new version. It integrates directly to the pianobar config file and you can set username/password and lastfm username/password it writes it directly back to the pianobar config file.

Im just waiting on testers before that's out.

As far as the missing dependencies: PyQt4 was just updated by atilla, some packages may have been in limbo while you updated the repositories. Go into a terminal:
Code:

sudo gainroot
apt-get update
apt-get install pypianobar

And see if it works that way. App Manager only refreshes once or day or something, so I've heard.

karim0028 2010-01-30 18:28

Re: [application] pyPianobar (with pianobar)
 
Quote:

Originally Posted by fatalsaint (Post 502790)
This is in the new version. It integrates directly to the pianobar config file and you can set username/password and lastfm username/password it writes it directly back to the pianobar config file.

Im just waiting on testers before that's out.

As far as the missing dependencies: PyQt4 was just updated by atilla, some packages may have been in limbo while you updated the repositories. Go into a terminal:
Code:

sudo gainroot
apt-get update
apt-get install pypianobar

And see if it works that way. App Manager only refreshes once or day or something, so I've heard.

i got the following error after doing the apt-get install

"The following packages have unmet dependencies:
pypianobar: Depends: python2.5-qt4 but it is not going to be installed.
e: Broken Packages"

fatalsaint 2010-01-30 18:40

Re: [application] pyPianobar (with pianobar)
 
Quote:

Originally Posted by karim0028 (Post 502829)
i got the following error after doing the apt-get install

"The following packages have unmet dependencies:
pypianobar: Depends: python2.5-qt4 but it is not going to be installed.
e: Broken Packages"

Hrmm... I see a problem in the python package..

http://maemo.org/packages/package_in...t4/4.7-maemo2/

Shows a dependency on python2.5-qt4-opengl that it's saying doesn't exist.

What do you get if you run:

Code:

apt-get install python2.5-qt4

fatalsaint 2010-01-30 19:04

Re: [application] pyPianobar (with pianobar)
 
Ok, well I've uploaded a new version of pianobar that is built on the lastest sources from the primary site. Version e079b45.

I also decided to go ahead and submit pypianobar 0.9 into the repositories. This might fix your dependency problem.. instead of depending on the *entire* python2.5-qt4 set of packages I specifically put python2.5-qt4-gui in there.

Should require much less to be downloaded, and will hopefully get around your problem.

I really need testers on this version.. you should have four new menu options:
User/Pass
Lastfm.User/Pass
Station Create
Station Delete

I have also improved error management, if pianobar crashes for any reason it will tell you what pianobar said, and it will try to restart it 3 times. After the third consecutive crash it will shutdown the app. As soon as a song or station list is retrieved it resets that counter to 0.

There have been several other odds and ends added... please, please, please provide feedback on the new version.

fatalsaint 2010-01-30 21:30

Re: [application] pyPianobar (with pianobar)
 
I've promoted pianobar to Extras-Testing.

As it's the base for both mine and Bratag's Front-ends, and requires very little maintenance.. I would like it to get voted on and pushed to extras so everyone can at least have pandora radio from the command line :).

Vote!

palmsolo 2010-01-31 20:03

Re: [application] pyPianobar (with pianobar)
 
I entered what I though was my username that was wrong (forgot it was my email). Now the app starts and tries to use this wrong username 3 times and then quits so I never have the chance to enter the correct one. I can use some basic terminal commands and am trying to find out how to clear out my username and password do I can enter the proper ones. Can anyone help me out? Thanks in advance!

Bratag 2010-01-31 21:11

Re: [application] pyPianobar (with pianobar)
 
Quote:

Originally Posted by palmsolo (Post 504157)
I entered what I though was my username that was wrong (forgot it was my email). Now the app starts and tries to use this wrong username 3 times and then quits so I never have the chance to enter the correct one. I can use some basic terminal commands and am trying to find out how to clear out my username and password do I can enter the proper ones. Can anyone help me out? Thanks in advance!

Go into an xterm.
cd /home/user/.config/pianobar
Then use an editor (probably vi) to look at the config file there.
Put in the correct username and password.
Save the file

then you should be ok.

palmsolo 2010-01-31 22:53

Re: [application] pyPianobar (with pianobar)
 
Quote:

Originally Posted by karim0028 (Post 494692)
Sorry, im ******ed :) I was entering my username and forgot that it was my email not just my handle... ie. was missing @gmail.com

It seems to work now.

I am having the same issue after making the same mistake, but I can't figure out how to get my correct username into pyPianobar. Can you tell me what you did to get it working?

fatalsaint 2010-01-31 22:54

Re: [application] pyPianobar (with pianobar)
 
Updated pianobar as someone noticed I had a typo.

Vote for this one in testing to get it promoted.

And what Bratag said is correct, it saved your username and password to "~/.config/pianobar/config". It's a good idea to have pyPianobar trap and invalid user/password and prompt again. Thanks for the feedback, it won't be hard to add.

palmsolo 2010-01-31 22:56

Re: [application] pyPianobar (with pianobar)
 
Oops, forgot that last config entry. Found the file and editing in Leafpad now. Thanks all.

fatalsaint 2010-01-31 22:58

Re: [application] pyPianobar (with pianobar)
 
Quote:

Originally Posted by palmsolo (Post 504363)
Thanks Bratag. I did that, but the config file appears to be empty :(

It can't be empty if pianobar is starting and trying to use the username/password (pyPianobar doesn't pass this itself except the first time.)

in a terminal:

Code:

rm -f /home/user/.config/pianobar/config
pyPianobar will recreate one with the defaults if it's removed.

palmsolo 2010-01-31 23:16

Re: [application] pyPianobar (with pianobar)
 
Thank you fatalsaint! I am all set now and LOVE that I have Pandora capability on my N900 now. This device gets better every single day.

Thorprime 2010-02-01 19:06

Re: [application] pyPianobar (with pianobar)
 
Tried out the Station/Create and Station/Delete features and had a couple issues.

1: The Artist/Title input box has white on white text, making it pretty hard to use. (I've heard the user/pass inputs also have this issue, but I didn't test that part)
2: The Artist/Title and yes/no dialog buttons are tiny and grouped tightly together, making it very easy to select the wrong one.

As a side note, the "tired" button still exits; it would be great if this sent the 't' key to pianobar...

fatalsaint 2010-02-01 19:13

Re: [application] pyPianobar (with pianobar)
 
Quote:

Originally Posted by Thorprime (Post 505592)
1: The Artist/Title input box has white on white text, making it pretty hard to use. (I've heard the user/pass inputs also have this issue, but I didn't test that part)
2: The Artist/Title and yes/no dialog buttons are tiny and grouped tightly together, making it very easy to select the wrong one.

Would it be possible to see screenshots?? in the SDK the buttons are quite large and the only white on white I experienced was the menu itself on the N810.. in the SDK everything was black.. so obviously I'm not getting an accurate picture of an N900 from the SDK.

Quote:

As a side note, the "tired" button still exits; it would be great if this sent the 't' key to pianobar...
Im holding off on this until I/we can figure out a better button picture. Too confusing with the ZZZ's I think. It's an extremely simple addition but I don't want people accidentally marking songs "tired" that they didn't mean too. I'd rather they accidentally close pyPianobar.. less permanent. You can't "un"-tire a song, right?

greenfly 2010-02-01 19:28

Re: [application] pyPianobar (with pianobar)
 
Maybe use a thumbs-down graphic for tired?

fatalsaint 2010-02-01 19:50

Re: [application] pyPianobar (with pianobar)
 
Quote:

Originally Posted by greenfly (Post 505621)
Maybe use a thumbs-down graphic for tired?

If we go the thumb route.. I think it would be better to follow the official Pandora idea of Thumbs Up/Thumbs Down for Like/Dislike and then maybe use the "-" button for the tired option?

ETA: Actually thor, also, since you're the genius of design :D - I'm thinking of remove the station list on the left and instead making that an album graphic... but I'm not sure what to do with the station list after that... put it into a drop down like Bratag did? Make it an selection from the menu? Anyway.. if you are able to think of a way to work in an Album Graphic I think that would be kinda nifty.

fatalsaint 2010-02-01 23:28

Re: [application] pyPianobar (with pianobar)
 
Ok, current working model:

http://packages.linuxniche.net/pyPianobar.png

Any feedback welcome.

ETA: Also, need a graphic for "No Image Available". Because, try as I might.. this just simply will not find all albums. It makes use of SlothRadio Covers to query for the image.

Thorprime 2010-02-01 23:43

Re: [application] pyPianobar (with pianobar)
 
Quote:

Originally Posted by fatalsaint (Post 505597)
Would it be possible to see screenshots?? in the SDK the buttons are quite large and the only white on white I experienced was the menu itself on the N810.. in the SDK everything was black.. so obviously I'm not getting an accurate picture of an N900 from the SDK.

--Screenshots---
http://img33.imageshack.us/img33/4672/screenshot04y.png
http://img268.imageshack.us/img268/9...eenshot05y.png
http://img33.imageshack.us/img33/2407/screenshot06x.png

Quote:

Originally Posted by fatalsaint
ETA: Actually thor, also, since you're the genius of design

Heh, trust me; I'm no designer. Coder by trade, any designing I do is only by last resort :) .

I'll see about getting some Thumbs up/down icons made. As for the album art, if there is an easy way for you to get that from the pandora api, I would agree that switching the station list to a drop-down is probably the best solution for making space on the screen. Hopefully there is a way to get the dropdown larger than it is in qtPianobar, which isn't very finger friendly.

vietn900 2010-02-01 23:47

Re: [application] pyPianobar (with pianobar)
 
someone make this a final product !

fatalsaint 2010-02-01 23:49

Re: [application] pyPianobar (with pianobar)
 
Well, the first one should be fixed. Should be black text now when entering station/username/pass etc.

As far as the buttons...... not really much I can do about that... It's the way the N900 handles the QT Message Box's :(. If I figure out a way to manipulate the actual layout of a message box I'll see what I can do. In a *normal* python app they show up underneath the text.. not to the right stacked.


All times are GMT. The time now is 05:14.

vBulletin® Version 3.8.8