maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Pianobar port - command line Pandora client (https://talk.maemo.org/showthread.php?t=38786)

intervigil 2009-12-30 07:35

[Maemo 5] Pianobar port - command line Pandora client
 
I got pianobar (http://6xq.net/html/00/17.html) to work on my N900 over the weekend.
It is a command-line client for Pandora (www.pandora.com) and depends on two libraries, libmad0 and libao0, which should be in extras-devel.
I have checked the license, and as far as I can tell it's completely unrestricted.

fatalsaint is now maintaining a package, so please check his post here for packages and updates:
http://talk.maemo.org/showpost.php?p...3&postcount=11

There is another thread discussing the future development of a GUI for pianobar here: http://talk.maemo.org/showthread.php?t=39027 as well.

codeMonkey 2009-12-30 08:44

Re: Pianobar port - command line Pandora client
 
Thanks for the port - now just to wait for pandora to become unrestricted in the UK or for pianobar to get it's proxy function working :)

bandora 2009-12-30 08:47

Re: Pianobar port - command line Pandora client
 
Thanks! I love pandora radio! :D :D

intervigil 2009-12-30 18:19

Re: Pianobar port - command line Pandora client
 
Actually there is proxy functionality in pianobar, the config file is located at ~/.config/pianobar/config and has options for it, although I've not had to use it since I'm in the US.
Here's a sample config file.

Code:

# This is an example configuration file for pianobar. You may remove the # from
# lines you need and copy/move this file to ~/.config/pianobar/config
# See manpage for a description of the config keys
#
# User
#user = your@user.name
#password = password

# last.fm scrobbling
#lastfm_user = username
#lastfm_password = password
#lastfm_scrobble_percent = 50

# Proxy (for those who are not living in the USA)
#control_proxy = http://127.0.0.1:9090/

# Keybindings
#act_help = ?
#act_songlove = +
#act_songban = -
#act_stationaddmusic = a
#act_stationcreate = c
#act_stationdelete = d
#act_songexplain = e
#act_stationaddbygenre = g
#act_songinfo = i
#act_addshared = j
#act_songmove = m
#act_songnext = n
#act_songpause = p
#act_quit = q
#act_stationrename = r
#act_stationchange = s
#act_songtired = t
#act_upcoming = u
#act_stationselectquickmix = x

# Misc
# mp3 or aacplus
#audio_format = mp3
#autostart_station = 123456
#event_command = /home/user/.config/pianobar/eventcmd


sadfist 2009-12-30 18:53

Re: Pianobar port - command line Pandora client
 
Thanks so much for this!

Unfortunately I seem to be too stupid to figure out how to install/run from the binary you provided :-/ hehe.

Any help?

intervigil 2009-12-30 19:42

Re: Pianobar port - command line Pandora client
 
Install the appropriate libraries via apt-get, libao0 and libmad0, (they may be in devel, so you install at your own risk) then run the executable from the X Terminal Emulator from wherever you downloaded it to.
I'm looking into packaging it, but pianobar uses CMake, so I'm having trouble with dpkg-buildpackage.

archebyte 2009-12-30 20:34

Re: Pianobar port - command line Pandora client
 
the megaupload link is down.

sadfist 2009-12-30 21:44

Re: Pianobar port - command line Pandora client
 
Quote:

Originally Posted by intervigil (Post 447023)
Install the appropriate libraries via apt-get, libao0 and libmad0, (they may be in devel, so you install at your own risk) then run the executable from the X Terminal Emulator from wherever you downloaded it to.
I'm looking into packaging it, but pianobar uses CMake, so I'm having trouble with dpkg-buildpackage.

I've got the libraries, it's installing the executable that I can't figure out. What format is it/what command do I use?

Thanks

kyle 2009-12-30 22:26

Re: Pianobar port - command line Pandora client
 
This is great! Thank you very much.

By the way, here is a link to the manpage:

http://github.com/PromyLOPh/pianobar...src/pianobar.1

Sadfist, if you saved the file to the root "N900" directory then just put this into the terminal:

root
cd /home/user/MyDocs
chmod 755 pianobar
cp pianobar /usr/bin

correction:
mv pianobar /usr/bin
chmod 755 /usr/bin/pianobar

sadfist 2009-12-30 22:52

Re: Pianobar port - command line Pandora client
 
Quote:

Originally Posted by kyle (Post 447269)
Sadfist, if you saved the file to the root "N900" directory then just put this into the terminal:

root
cd /home/user/MyDocs
chmod 755 pianobar
cp pianobar /usr/bin

After doing this I get permission denied when I try and run it...:(:confused:

EDIT: nevermind, I just noticed you put cp not mv. chmod didn't carry over to the copy. Now I just have to figure out my username/password, lol.

fatalsaint 2010-01-18 18:44

Re: Pianobar port - command line Pandora client
 
A package file to test for pianobar. It should include the example, all commented out, config file in /home/user/.config/pianobar.

http://packages.linuxniche.net/pianobar_1.1-0_armel.deb

I don't have an N900 so this has not been tested on a real device.. but installs fine in my scratchbox SDK environment.

Please test the depends by removing libmad0 and libao0. After running "dpkg -i pianobar-1.0-1.deb" it should fail with a list of dependencies.. then run "apt-get -f install" which should automatically pull down libmad0 and libao0 for you.

Let me know..


ETA: Just being clear: do not install this unless you don't mind something breaking. This is completely untested.

ETAA: I just tried to remove the package in my SDK and got a scary error... it tried to remove /home/user and got a permission denied. I don't know why.. that's not in any of my scripts. Probably may want to wait on this unless you're really experimental. I have to troubleshoot later.

UPDATE: 1.0-3 updated. Should be optified, contains stripped binary, has real man page, and a changelog!

UPDATE: 1.1-0 updated. Built on the latest pianobar source, evidently pandora updated their libpiano requirement yesterday which breaks all older versions of pianobar. Compiled new sources (e079b45).

ViciousXUSMC 2010-01-18 19:31

Re: Pianobar port - command line Pandora client
 
I dont even know how to flash mine back if I break it so I will pass on testing it until its atleast non destructive :D

Soon as it gets to the repo even if its buggy I'll be sure to test it.

fatalsaint 2010-01-18 19:36

Re: Pianobar port - command line Pandora client
 
Ok.. I fixed that :D. Now it is at least not overtly totally system destructive ... :).

Now it creates the default config into /etc/pianobar/config, and checks if /home/user/.config/pianobar/config exists. If it does not, it will copy it.

I don't know why.. but if you directly put /home path into the deb files it want to remove it... badddd.

Thorprime 2010-01-21 01:39

Re: Pianobar port - command line Pandora client
 
I went ahead and installed the 1.0.2 version of the package today. I can tell you that "apt-get -f install" worked fine and nothing seems to have been destroyed by the package yet :)

Been using it all day with good results.

fatalsaint 2010-01-21 01:41

Re: Pianobar port - command line Pandora client
 
Thank you ;). The scary part is of course when you try to remove it :D. Thats when the fishy error showed up in -1 that I *appear* to have fixed.

Beyond that.. I think it's pretty much set. It doesn't pass lintian ATM because it doesn't like me copy/pasting the description field. So once I fix it to pass a lintian check, and add a changelog.. I think it could be put to extras-devel. I wanted more testing on it first tho......

Damn this not having a device is really bugging me. I'm working a PyQT frontend for it to..

mbthomas 2010-01-21 04:11

Re: Pianobar port - command line Pandora client
 
Fantastic! This worked perfectly and the app seems to work great.

Bratag 2010-01-21 04:31

Re: Pianobar port - command line Pandora client
 
Well this is just great. Low CPU eater and nice and simple. Thanks. Might play with making this run on a script and tie it to an icon etc.

fatalsaint 2010-01-21 04:35

Re: Pianobar port - command line Pandora client
 
I figured I'd get an icon and stuff going with the PyQT4 app.. since an icon for a terminal app is a little redundant.. just launch a terminal :).

It's actually not too bad.. I have one that can control via either the fifo file, or directly with popen... but retrieving information *from* it is being a tad problematic. :(

Bratag 2010-01-21 04:58

Re: Pianobar port - command line Pandora client
 
Quote:

Originally Posted by fatalsaint (Post 485941)
I figured I'd get an icon and stuff going with the PyQT4 app.. since an icon for a terminal app is a little redundant.. just launch a terminal :).

It's actually not too bad.. I have one that can control via either the fifo file, or directly with popen... but retrieving information *from* it is being a tad problematic. :(

That would be very cool.

I assume you have checked out this thread

http://www.qtforum.org/post/57848/ho...ping#post57848

Has some nice code about halfway down that deals with running a process and handling the returned text etc.

Blacklaser 2010-01-21 05:57

Re: Pianobar port - command line Pandora client
 
Brilliant! This works like a charm! :cool: Many thanks for the work!

fatalsaint 2010-01-21 06:06

Re: Pianobar port - command line Pandora client
 
Quote:

Originally Posted by Bratag (Post 485955)
That would be very cool.

I assume you have checked out this thread

http://www.qtforum.org/post/57848/ho...ping#post57848

Has some nice code about halfway down that deals with running a process and handling the returned text etc.

I'll have to see if I can adapt it.

In ruby I'd have it pretty functional already. I've done some I/O work in ruby and thanks to the wonder "read_nonblock" method to IO.popen makes it a breeze.

Unfortunately I'm not finding it in python. Using just popen, I can get it to output the pianobar text to the terminal screen... and I can write to it from the buttons. So it's pretty much completely functional in control... I have a Stop, Next, Love, Hate, and Play/Pause button that all work great.

Unfortunately.. I can't read any of the text out in order to display helpful things like Song Title, Artist, and whether or not you've previously marked it as Liked or not. I've messed with popen2-4 so far.. and using any of those I get nothing at all... pianobar doesn't seem to execute at all.

I think part of that problem is pianobar itself.. if you try to launch it in a terminal with "pianobar &" it will actually immediately stop. Pianobar doesn't like having a noninteractive startup it seems.

I'm debating whether I should just take the shortcut like this guy. He has a working GTK version to control pianobar, including adding/removing stations.. but selecting which station to play is annoying because he has the same problem I do - he can't pull anything back from pianobar so listing the station list is out. He just lets you put in your station number into a dialogue box and listen from there.

fatalsaint 2010-01-21 15:18

Re: Pianobar port - command line Pandora client
 
I figured it out... subprocess' popen works better than the deprecated os popen.. and using stdin=PIPE/stdout=PIPE it works.

Moving discussion here.. that's where it belongs anyway.

I'll update the pianobar deb file soon with the changelog file and a real man page (right now the man page is empty, but it does come with one in the source, I've found it and moved it to the right place now). Also, I'll get it to pass a lintian check... after that - not much more can be done with a single binary deb file. 1.0-3 will probably be the last one till pianobar updates.

lfcobra 2010-01-22 02:34

Re: Pianobar port - command line Pandora client
 
I had never heard of pianobar before tonight and now it could possibly one of my favorite thing i've put on my n900! I love pandora.com but it just bogs down my n900 but with pianobar all is well with the world! And to top things off piano bar plus a desktop launcher icon ( http://www.themaemo.com/howto-launch...om-a-shortcut/ ) = homemade pandora app! i'm so happy! :)

fatalsaint 2010-01-22 02:52

Re: Pianobar port - command line Pandora client
 
Updated my post with 1.0-3.

Contains changelog, optified, real man page... the only warning in lintian now is that it doesn't know what user/multimedia section is. I pulled that straight from another maemo package so don't blame me! :p

fatalsaint 2010-01-22 15:10

Re: Pianobar port - command line Pandora client
 
Another update. All older pianobar's are broken as of today (some update on pandora's end). New sources uploaded today to PromyLOPh's website (e079b45).

I compiled the new one and it works fine.

Remember, only testing I can do for these debs is Upgrade, remove and install in my SDK. All performed without error.

lfcobra 2010-01-22 15:24

Re: Pianobar port - command line Pandora client
 
ok so pianobar was working great yesterday but today not so much. I keep getting the following error when i try to login?

~ $ pianobar
Welcome to pianobar!
[?] Username: myemail@goeshere.com
[?] Password:
(i) Login... Error: Protocol incompatible. Please upgrade libpiano.
~ $

I tried doing some research on the issue and it seems like its happened to people using desktop linux boxes but i was the only instance of this issue on a n900. Anyone have any ideas?

fatalsaint 2010-01-22 15:41

Re: Pianobar port - command line Pandora client
 
Read my post directly above yours and get the new update.

fatalsaint 2010-01-22 15:55

Re: Pianobar port - command line Pandora client
 
Could someone tell me... since I don't have an N900: If you are listening to pianobar, and enable the FM Transmitter, will it go out through that? I would assume so (all sounds goes through the transmitter when enabled) - but I just want verification. I desperately want to never again listen to normal radio once I get my N900 :D.

lfcobra 2010-01-22 16:34

Re: Pianobar port - command line Pandora client
 
thank you so much! maybe i should learn to read through a thread before posting my problems hehe after updating with your newest package everything works like a dream again :) thx

caimanjosh 2010-01-22 16:51

Re: Pianobar port - command line Pandora client
 
Wow, this looks great. So, since I have an N800 (you knew this was coming from someone eventually)...any chance you might be able to port this to work with Diablo (OS2008)? Please? :D That would really make my day, as I love Pandora but find that using it in the browser is just not really feasible.
I'm sure you'd get lots of love from all the N800/810 users out there as well. Anyways, just thought I'd ask.

fatalsaint 2010-01-22 17:15

Re: Pianobar port - command line Pandora client
 
Quote:

Originally Posted by caimanjosh (Post 488987)
Wow, this looks great. So, since I have an N800 (you knew this was coming from someone eventually)...any chance you might be able to port this to work with Diablo (OS2008)? Please? :D That would really make my day, as I love Pandora but find that using it in the browser is just not really feasible.
I'm sure you'd get lots of love from all the N800/810 users out there as well. Anyways, just thought I'd ask.

It may just work... I don't have my N810 with me or I'd try it. All that matters is if libmad0 and libao0 are somewhere in a repository that you have on your device. My control file doesn't limit to install only on the N900/fremantle. Since it's not a GUI, there won't be any of those issues.

It's slightly optified... so places a binary in /opt/pianobar/ but honestly that shouldn't matter on your N800 because of the link in /usr/bin/pianobar that points to it... doesn't matter where the actual binary is.

Yeah.. I'm pretty sure it would just work. If you don't want to try it, I'll do it when I get home tonight with my N810. If it doesn't.. I most certainly can build one (assuming, again, libao0 and libmad0.. if I have to also provide those it'll get more complicated - but I'll see what I can do either way.)

intervigil 2010-01-22 17:46

Re: Pianobar port - command line Pandora client
 
pianobar does work through the fm radio transmitter. That was my original intention when I tried to make it work initially, and I'm glad to say it worked out. Have you considered putting your package up in extras-devel or the like?

fatalsaint 2010-01-22 17:46

Re: Pianobar port - command line Pandora client
 
Quote:

Originally Posted by intervigil (Post 489071)
pianobar does work through the fm radio transmitter. That was my original intention when I tried to make it work initially, and I'm glad to say it worked out.

This is good news... thank you.

fatalsaint 2010-01-23 08:07

Re: Pianobar port - command line Pandora client
 
Quote:

Originally Posted by caimanjosh (Post 488987)
Wow, this looks great. So, since I have an N800 (you knew this was coming from someone eventually)...any chance you might be able to port this to work with Diablo (OS2008)? Please? :D That would really make my day, as I love Pandora but find that using it in the browser is just not really feasible.
I'm sure you'd get lots of love from all the N800/810 users out there as well. Anyways, just thought I'd ask.

Unfortunately I don't see libao0 anywhere. libmad0 is there but no libao0. I checked the SDK, extras, and extras-devel repositories. There's a few older chinook files in non-standard repositories on gronmeyer buttttt I wouldn't require anyone to enable stuff like that just for a package :(. Sorry man. I'll look more after I'm done with the pyQt4 interface.

lfcobra 2010-01-24 02:38

Re: Pianobar port - command line Pandora client
 
just a quick question, has anyone tried setting up the pianobar config file? I cant seem to get it to auto login (yes my user name and password are correct) and i have tried both config file locations mentioned in this thread ( /home/user/.config/pianobar/config and /etc/pianobar/config ). I also cant seem to get the autostart station to work either ( i assume it takes an integer which represents one of your stations). Anyone else have similar issues or figure out how to fix?

fatalsaint 2010-01-24 03:37

Re: Pianobar port - command line Pandora client
 
Both of those work for mine... The auto-station is a really long number. The way you see is to run pianobar and start a station, you will get something like:

Quote:

Station "Monster Radio" (173151671101496815)
That ridiculous station ID is what you are after. Put that into the config to auto-play.

The username and pass work as advertised for me... I put it in /home/user/.config/pianobar/config. But, this is all in the SDK, not on an N900 directly.

lfcobra 2010-01-24 03:55

Re: Pianobar port - command line Pandora client
 
thanks fatalsaint :) i deleted the /home/user/.config/pianobar/config file and made a new one and it started working... i think the issue might have been that i had made the file in windows and used scp to put it on the n900, maybe something to do with windows and unix file format? anyway it works now and thats all i care about! and the autostart station works as well! This quickly becoming the most used app on my phone :)

sadfist 2010-01-24 04:21

Re: Pianobar port - command line Pandora client
 
Awesome work! Newest version runs much better. Skips a lot less and much less severely! Thanks!

fatalsaint 2010-01-24 05:56

Re: Pianobar port - command line Pandora client
 
Quote:

Originally Posted by lfcobra (Post 491416)
thanks fatalsaint :) i deleted the /home/user/.config/pianobar/config file and made a new one and it started working... i think the issue might have been that i had made the file in windows and used scp to put it on the n900, maybe something to do with windows and unix file format? anyway it works now and thats all i care about! and the autostart station works as well! This quickly becoming the most used app on my phone :)

Just wait till I get done with the GUI :D.

Bratag 2010-01-24 05:57

Re: Pianobar port - command line Pandora client
 
Quote:

Originally Posted by fatalsaint (Post 491493)
Just wait till I get done with the GUI :D.

hey Fatal - might want to go over some stuff with the GUI with you. I got one fully completed in Qt, runs great when I run it in Linux - when I put it on the N900 it looks very messed up. Any advice would be much appreciated.


All times are GMT. The time now is 15:17.

vBulletin® Version 3.8.8