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-06-06 06:54

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

Originally Posted by ceevee (Post 696843)
That would be great because 3G coverage in my area isn't so good either. I listen to Pandora while driving.

Better, longer buffering would be great. Also, might be there a way to restart the stream other than closing and reopening pyPianobar?

Sometimes when I lose 3G coverage, I won't regain 3G for more than 1 minute. This is often way too long for pyPianobar, so I am forced to exit and reopen.

Unfortunately so far this isn't looking hopefully. Been talking with the upstream dev and pianobar itself doesn't do any buffering and adding would be quite a bit of work.

What might end up happening is I completely re-write pyPianobar to tie into libpianobar directly (without using the full CLI pianobar package) - which should give me a little more control on *some* things.. but not sure how much or if it'll help this problem at all. It would probably help in fixing the timeout problem when listening to Pandora for too long straight.

I'm not entirely sure I want to take that on just yet though.

fatalsaint 2010-06-06 20:43

Re: [application] pyPianobar (with pianobar)
 
Ok, well, I came across a Python implementation of libpiano here. I currently have a working model that uses that, and sends the audio through gstreamer (I haven't figured out how to tie into MAFW yet).

I'm liking this method because no more hacks getting the album art.. Pandora actually returns it directly from their API. Quite a lot of information is there, actually. So it's looking like I might abandon both pianobar and pyPianobar and re-create a new project (identical to pyPianobar), that does not depend on pianobar at all. It'll be an entirely stand-alone python app.

The biggest issue right now is the XBMC implementation doesn't have thumbs up/down/create stations/etc.. already ported from libpiano's source.. So I will have to work on that. Basically it listens to music, shows the album art, and you can skip songs. That's about the end of it.

I am liking having control over what I'm seeing, and maybe (?) I can work with gstreamer to buffer properly and work better on bad 3G? .. but this is going to require quite a bit more work porting from libpiano's C to python.

Any ideas on what to name the new project (pyRadio?) would help too. I dunno.. just been messing around today, this is definitely in the "doable" category. I'll try the audio in crappier 3G areas and see if it plays any better than the current pyPianobar version.

The Arsonist 2010-06-07 16:35

Re: [application] pyPianobar (with pianobar)
 
You're the man! Glad to hear you're finding new ways to improve(which I didn't even think was possible at this time). I'd say if you're going to rename it, why not drop the "py" tag? Its no longer just a Pianobar front-end, so make it something of your own. Like FatalRadio or Station's Saint or something(those are probably terrible examples), but I'm just saying throw yourself some IP in there!

fatalsaint 2010-06-07 19:12

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

Originally Posted by The Arsonist (Post 703711)
You're the man! Glad to hear you're finding new ways to improve(which I didn't even think was possible at this time). I'd say if you're going to rename it, why not drop the "py" tag? Its no longer just a Pianobar front-end, so make it something of your own. Like FatalRadio or Station's Saint or something(those are probably terrible examples), but I'm just saying throw yourself some IP in there!

"py" is actually attributed to it's language that it's in. A lot of python-released scripts will call themselves pySomething to indicate they are python apps.

It's certainly not required by any means, it just comes from my Linux side I guess.

http://en.wikipedia.org/wiki/Python_...%29#Neologisms

Quote:

The prefix Py can be used to show that something is related to Python. Examples of the use of this prefix in names of Python applications or libraries include Pygame, a binding of SDL to Python (commonly used to create games); PyS60, an implementation for the Symbian Series 60 Operating System; PyQt and PyGTK, which bind Qt and GTK, respectively, to Python; and PyPy, a Python implementation written in Python. The prefix is also used outside of naming software packages: the major Python conference is named PyCon.
Im currently running into a snag with this new build. I have added thumbs up/down to it, and adding tired and deleting stations will be easy (creating stations will be trickier).. but currently having issues tracking when the song is finished to play the next one. You can connect a bus to a signal in pyGST (gstreamer bindings) - but every time I do it segfaults for some reason. No error or crash messages, just segfaults. Very annoying.

If I get this working, you as an end user probably won't notice anything at all (unless someone gets me interface changes/tweaks that I decide to use) from the current pyPianobar to the new app, except that hopefully I can figure out the stutter on slower networks and I'll have more control over how the app actually works.

I just don't think continuing to call it pyPianobar v3 is really accurate since it only uses 2 files from pianobar (the keys), and it's a complete v1 rewrite of the software. Calling it pyPandora could have copyright/legal implications I'm thinking.

On that note: it was brought to my attention apps such as this may be against the ToS of Pandora. To date, they have not contacted myself nor the author of pianobar with any complaints to indicate they care - so I'll continue to operate under that assumption. I just wanted to put this out: It'll probably go a long way to keeping them ignoring us if users of these apps subscribe to the Pandora One and send Pandora some $$. While the radio to us is free, they still do have to pay royalties for the songs (as much as I hate DRM, it's not Pandora's fault and they have to abide by it as that is the current standard).

So, subscribe to Pandora, enjoy pyPianobar for now - and hopefully in the next short while I'll have a new, more flexible, *hopefully* lighter weight and better integrated Pandora Radio app for you all.

fatalsaint 2010-06-07 20:54

Re: [application] pyPianobar (with pianobar)
 
Well.. fixed that problem. That's about the ugliest code, ever, but gstreamer's bus require a gobject Mainloop. So even though this is entirely an QT app I need to have a gobject.mainloop running in a thread to keep it from segfaulting >.>. Silly.

This new build is nearly ready now, just need to add station management and tired and all of the current features of pyPianobar will be in the new - pure-python solution.

I've also been streaming 3G/3.5G at my house all day and haven't had any problems. But my home has never been a patchy spot. Work tomorrow will be the real test... it's like a dead zone in my building.

ceevee 2010-06-07 22:24

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

Originally Posted by fatalsaint (Post 704249)
This new build is nearly ready now, just need to add station management and tired and all of the current features of pyPianobar will be in the new - pure-python solution.

Can't wait to test this in my car!

fatalsaint 2010-06-08 05:50

Re: [application] pyPianobar (with pianobar)
 
It's done. Want to test it for a dew days.. there's some issues with gstreamer I haven't figured out. Sometimes music just stops playing through the speakers, at first I thought it was buffering but when it plays again it actually moved in the song (or sends the EOS signal and happily starts the next song).. or just pressing "next" starts the next song just fine. So either, with bad internet it downloads no audio but thinks it's still playing, or it just stops sending the audio.. dunno.

It's weird.. so I'm going to watch some debug output for a couple of days.. I took it for a drive and it seemed to hold up significantly better than pianobar did on 3G. But as I said, tomorrow will be the real test at work.

All features on it work.. creating stations, thumbs up/down/tired, FM TX, etc. I'm considering pyPianobar and pianobar both dead projects at this point. You guys got a couple days to get me a new UI (if you want one), or a name (otherwise we're going to get stuck with pyRadio ;)). I'm not going to let random stopping songs prevent me from uploading to Devel (it'll stop me from pushing to Extras obviously, but more testers are needed to find bugs I'm missing) - I need to re-flash my phone to an out-of-box state and figure out all the exact dependencies I need before packaging it too.

Nice thing is, using Pandora directly, there is tons of information received from their API that I've never known before. Everything from iTunes URL's to Amazon ID's, Low quality stream, etc. So putting in a "buy song" option and everything is actually possible and it'll open a browser to amazon. If you guys see anything on the main pandora flash app, or any of the other mobile pandora apps, let me know - more possibilities are here now..

fatalsaint 2010-06-08 16:21

Re: [application] pyPianobar (with pianobar)
 
Well.. I think I prefer this better. pianobar would play a second, stop, play, stop, very annoying and unlistenable.

This just stops if the network is not fast enough to fill the buffer. I watch gstreamer buffering and it stays at 0%.. not tremendously better but significantly less annoying through my headsets. Only happens in really bad areas too, in the normal areas where before pianobar would have issues its working fine.. so it's at least *somewhat* better with gstreamer. I'm still trying to find ways to control the buffer directly.. gstreamer still seems to be using some of it (you'll see it get up to 50% then back to 0% even though no audio played..) - so I want it to pause, wait for a 100% buffer, and play again.. but haven't quite figured that out just yet.

sadfist 2010-06-08 17:42

Re: [application] pyPianobar (with pianobar)
 
How does the new version work with regard to system events/alert tones? I know the display sleep/wake event interrupting audio was a bit of a mystery, but it was pretty minimal. Alert tones on the other hand make the current app pretty unlistenable if you're txting/im'ing or whatnot since it interrupts the audio completely for a few seconds every time you get an alert.

andraeseus1 2010-06-08 18:14

Re: [application] pyPianobar (with pianobar)
 
just wanted to sy i love this app and it ROCKS!

fatalsaint 2010-06-08 18:26

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

Originally Posted by sadfist (Post 705707)
How does the new version work with regard to system events/alert tones? I know the display sleep/wake event interrupting audio was a bit of a mystery, but it was pretty minimal. Alert tones on the other hand make the current app pretty unlistenable if you're txting/im'ing or whatnot since it interrupts the audio completely for a few seconds every time you get an alert.

Same problem. This is actually part of the system just like the dimming screen. The built-in maemo stuff always trumps our stuff and when you get a notification it effectively disables our audio output to play it's sound.

However, gstreamer seems to recover better than the pianobar did..with less scratchy/skipping effects.

Perhaps if I find a way to integrate into MAFW maybe I can change some of that.. but I doubt it since kmplayer has the same problem and you can set that to use osso-media player with no affect.

fatalsaint 2010-06-11 04:59

Re: [application] pyPianobar (with pianobar)
 
Well, I have it packaged and ready. Was kind of hoping I could find a UI dev to come up with a "new" UI as a surprise for a new app but.. so far falling short.

Name's I've been suggested so far.. pyRadio, pyJams, pyStream, pyTunes (little worried about apple on this one :D). pyRadio seems to be winning votes within my circles.

So far it's pretty feature complete. Only thing I haven't re-instated is the history.. not really sure how many people really looked at that file. Thinking about adding a Donate button in the menu too...

The Arsonist 2010-06-11 16:03

Re: [application] pyPianobar (with pianobar)
 
Yeah man, by all means, add a donate button and an about button(tell about your work man). Another thought: Is it at all possible to AVRCP controls in this app? I obviously know that my radio doesn't have a Thumbs Up/Down button(which could possibly be mapped to something else?) but I hate having to unlock the phone, let the track skip and then skip the song. Skipping straight from the radio would be great(luckily the built-in media player does allow this) This is simply a thought, I know that may be a big addition, so I'm just interested in what you know or thought about it.

If you're wondering what radio I'm using check it out. I'd HIGHLY recommend it! They make cheaper models that have bluetooth built-in and they all sound great.

Thanks again man. I'm really looking into programming now thanks to you. Expect to keep hearing from me. LOL!

fatalsaint 2010-06-11 16:09

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

Originally Posted by The Arsonist (Post 710736)
Yeah man, by all means, add a donate button and an about button(tell about your work man). Another thought: Is it at all possible to AVRCP controls in this app? I obviously know that my radio doesn't have a Thumbs Up/Down button(which could possibly be mapped to something else?) but I hate having to unlock the phone, let the track skip and then skip the song. Skipping straight from the radio would be great(luckily the built-in media player does allow this) This is simply a thought, I know that may be a big addition, so I'm just interested in what you know or thought about it.

If you're wondering what radio I'm using check it out. I'd HIGHLY recommend it! They make cheaper models that have bluetooth built-in and they all sound great.

Thanks again man. I'm really looking into programming now thanks to you. Expect to keep hearing from me. LOL!

Wow... well.. I have absolutely no experience with that. I had to google AVRCP :D.

I would be quite certain that it would of course be possible to implement such a feature, all it would require is for the app to listen for whatever signal is sent to the device (either via dbus, bluetooth directly, or whatever) and calling the Skip function...

Unfortunately I have nothing that cool at my house :D.

If you'd like to buy me one... I'd definitely add it :D. Without something to test with though, I'd be flying blind and no idea if I'm on the right path. So unfortunately, this is not likely to happen soon. I have nothing bluetooth at my house, not even headphones/sets let alone entire radios... My car doesn't even have bluetooth support.

donjnavarro 2010-06-11 17:53

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

Originally Posted by meepha12 (Post 681523)
Yeah i just came to edit my post as i just installed kmplayer and noticed it did that also. Im so happy though I got pandora working without going to the website and now with using kmplayer i can finally stream iheartradio stations w/o going to that website since i couldnt find an app =D

Can you explain or link to a place that explains how to stream iheartradio stations through kmplayer for the n900? thanks.

fatalsaint 2010-06-13 03:49

Re: [application] pyPianobar (with pianobar)
 
Alrighty, pyRadio it is then.

We can continue these discussions in this thread. I will no longer maintain pyPianobar and pianobar. If someone uses only the CLI pianobar then drop me a note and I might keep it going only when it breaks.. but it's just extra work for something I don't think most people truly need/use.

N8x0 users, I'm sorry - the new pyRadio should just work but I tried it and realized that all of the dependencies are named differently and/or too old :(. PyQt4 works, but the gstreamer bindings don't work right. I'll keep working on that for pyRadio and have it put into the official repo's for that as well if I ever figure it out.

clijunky 2010-06-20 03:13

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

Say it ain't so! I'm a hardcore CLI fan and absolutely love pianobar for the n810. Please please, continue providing a fix when it breaks, or even some direction for someone else to do this in your stead.

CliJunky

fatalsaint 2010-06-20 03:57

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

Originally Posted by clijunky (Post 722293)
fatalsaint,

Say it ain't so! I'm a hardcore CLI fan and absolutely love pianobar for the n810. Please please, continue providing a fix when it breaks, or even some direction for someone else to do this in your stead.

CliJunky

Well.. pianobar for the N900 is easy.. I just download the source and put the debian files in place and upload to the repository. The N810 is a bit more of a pain.. but if you guys let me know when it's broken I am sure I can keep it built if it's actively used.

I was hoping to get pyRadio to work with the N810.. would that not suffice? I know python on the N8x0 takes up a bit of space though.

clijunky 2010-06-20 04:49

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

Originally Posted by fatalsaint (Post 722312)
I was hoping to get pyRadio to work with the N810.. would that not suffice? I know python on the N8x0 takes up a bit of space though.

Given my troubles getting the current pianobar to work/install properly, I'd be glad to wait for pyRadio. Thank you for all your hard work.

scooterx517 2010-09-02 04:48

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

hit pause wait a few hours... buffers forever...crashes...force close....still plays 6 songs before it stops...have to reboot to stop.

fatalsaint 2010-09-02 04:54

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

Originally Posted by scooterx517 (Post 804836)
BUG:

hit pause wait a few hours... buffers forever...crashes...force close....still plays 6 songs before it stops...have to reboot to stop.

Bug in which.. exactly? pyRadio, pyPianobar or pianobar?

scooterx517 2010-09-02 16:42

Re: [application] pyPianobar (with pianobar)
 
pypianobar

fatalsaint 2010-09-02 17:00

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

Originally Posted by scooterx517 (Post 805416)
pypianobar

Suggest you move to pyRadio. :)

getnani 2012-08-28 11:41

Re: [application] pyPianobar (with pianobar)
 
For those who want pandora, and who were/ are hoping that pyRadio/ pyPianobar will work someday!!!

A Working Pianobar for maemo 5!!
http://talk.maemo.org/showthread.php...92#post1256592


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

vBulletin® Version 3.8.8