maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   footify alpha, a Spotify client based on despotify (https://talk.maemo.org/showthread.php?t=52917)

Joorin 2010-06-14 19:56

Re: footify alpha, a Spotify client based on despotify
 
Quote:

Originally Posted by wcborstel (Post 714971)
I have double checked and it really says "key exchange failed". I am connected with wifi and have a working internet connection as well.

Just for completeness, could you perhaps supply that output too? I'm looking in the source code for libdespotify and I see no possibility for this error to appear with wrong username/password so now I'm getting really curious. I must have overlooked something.

Wild guesses: Do you have many playlists? Are you logged into Spotify from another client at the same time? Is your premium account very fresh?

I really can't think of any real source for your problem. The trace you supply suggests that it crashes somewhere after login but before populating the list of playlists so I'll look closely there and see if I can find something.

Suurorca 2010-06-14 20:03

Re: footify alpha, a Spotify client based on despotify
 
First of all, thanks for an excellent 'app'.

I would ask that you consider adding some features:

1) Status display:

I have a lot of large playlists, so logging in takes more than a minute, even on wifi. On 3G it takes usually 2-3 minutes, and some times it just seems to fail log in altogether, even if I wait longer. I suppose that's due to network latency. Some sort of status message à la "Connecting... network failure" or "Connecting... log in successful... updating playlists..." would be very nice. Also, similar messages while waiting for the next song to start to play would help. Right now, there's just no way to know if the application hanged up, or it's just taking time to buffer.

Edit: Enabling cache certainly eases the situation. Still seems to hang up occasionally if 3G reception is poor, though.

As a side note, I notice there was some talk about some songs just not starting to play. This seems to happen a lot with the official client also, so maybe it's not despotify's problem this time? :)

2) Configurable buffering:

I see that this has already been discussed a lot, but if you decide to implement an audio buffer, I'd like it to be adjustable. Say, "play only after entire song is buffered", or buffer n-percent before starting playback.

3) Menu shortcut to FM-transmitter:

I use this a lot while driving. FM-transmitter works perfectly, but at the moment I need to go via phone settings to enable it. Both the default media player and Mediabox have their own menu shortcuts, which is quite handy. Perhaps you could duplicate this?

All in all, I enjoy using footify a lot. Keep up the good work!

wcborstel 2010-06-14 20:06

Re: footify alpha, a Spotify client based on despotify
 
Quote:

Originally Posted by Joorin (Post 715021)
Just for completeness, could you perhaps supply that output too? I'm looking in the source code for libdespotify and I see no possibility for this error to appear with wrong username/password so now I'm getting really curious. I must have overlooked something.

That's unfortunately the only thing I can find so far. Do you have any debug logging which I can enable to help you troubleshoot further?

Quote:

Wild guesses: Do you have many playlists? Are you logged into Spotify from another client at the same time? Is your premium account very fresh?
To come to your wild guesses: 1) I have 0 playlists. 2) I was but that makes no difference - still getting the same segmentation fault 3) Yes, I have activated it today. I can see in the normal spotify client that I have a premium account though

Quote:

I really can't think of any real source for your problem. The trace you supply suggests that it crashes somewhere after login but before populating the list of playlists so I'll look closely there and see if I can find something.
Maybe because I don't have any playlists it's crashing?

wcborstel 2010-06-14 20:08

Re: footify alpha, a Spotify client based on despotify
 
Quote:

Originally Posted by wcborstel (Post 715046)
Maybe because I don't have any playlists it's crashing?

To quote myself: Yes, this is the bug. After adding a playlist I can successfully login and I can play a song from the playlist.

Joorin 2010-06-14 20:18

Re: footify alpha, a Spotify client based on despotify
 
Quote:

Originally Posted by wcborstel (Post 715053)
To quote myself: Yes, this is the bug. After adding a playlist I can successfully login and I can play a song from the playlist.

Oh, I actually spent some time looking at exactly this part of the code and it looks as if it will handle this case. I will investigate further.

Thank you for the feedback and help with debugging! This kind of bug is typical of just testing the path through the code where things go as intended, as in "Who'd use the client without playlists? Pff, no-one! I'm sure it works...". :)

Joorin 2010-06-14 20:33

Re: footify alpha, a Spotify client based on despotify
 
Quote:

Originally Posted by Suurorca (Post 715041)
First of all, thanks for an excellent 'app'.

I would ask that you consider adding some features:

1) Status display:

I have a lot of large playlists, so logging in takes more than a minute, even on wifi. On 3G it takes usually 2-3 minutes, and some times it just seems to fail log in altogether, even if I wait longer. I suppose that's due to network latency. Some sort of status message à la "Connecting... network failure" or "Connecting... log in successful... updating playlists..." would be very nice. Also, similar messages while waiting for the next song to start to play would help. Right now, there's just no way to know if the application hanged up, or it's just taking time to buffer.

Edit: Enabling cache certainly eases the situation. Still seems to hang up occasionally if 3G reception is poor, though.

There are two parts to this: how calls to libdespotify are done and cache handling.

As things are implemented now, calls to libdespotify are done using the same thread that updates the application UI, which is the GTK main thread. Typically, doing things that way is bad, since updates might be delayed if the call takes a while to finish.

To fix this, and I think I mentioned this a few posts back, I need to decouple the call to libdespotify from the GTK main thread and deliver the result in an asynchronous manner. This would increase the complexity of the application a bit so I'm putting this off until the "basic functionality" is stable. So, it's on my TODO list.

Until then, things might seem a bit opaque (not knowing what's going on) but I hope the benefits of getting things more stable first outweighs this.

Secondly, cache handling of playlists is done atomically. Meaning that as long as you don't change anything, in any playlist, the local copy can be used and then even very big playlists shouldn't take more than a couple of hundred milliseconds to load. But, if you change anything, libdespotify will re-download the whole thing.

Quote:

As a side note, I notice there was some talk about some songs just not starting to play. This seems to happen a lot with the official client also, so maybe it's not despotify's problem this time? :)
Yes, there are some confirmed bugs relating to the Spotify service when it comes to songs not starting. I hope it will be fixed by Spotify soon.

Quote:

2) Configurable buffering:

I see that this has already been discussed a lot, but if you decide to implement an audio buffer, I'd like it to be adjustable. Say, "play only after entire song is buffered", or buffer n-percent before starting playback.
Good suggestions. I'll keep this in mind.

Quote:

3) Menu shortcut to FM-transmitter:

I use this a lot while driving. FM-transmitter works perfectly, but at the moment I need to go via phone settings to enable it. Both the default media player and Mediabox have their own menu shortcuts, which is quite handy. Perhaps you could duplicate this?

All in all, I enjoy using footify a lot. Keep up the good work!
I'll look into this. I'm guessing the FM transmitter registers on the DBUS and can be started that way.

Thank you for the feedback and suggestions. I'm glad you like it.

Joorin 2010-06-15 06:23

Re: footify alpha, a Spotify client based on despotify
 
Version 0.0.8-4 has been uploaded to the repositories and the Garage page.

New functionality:
+ Album and artist search now also works for playlists.

Changes:
* Some refactoring of the code.

Please note:
The bug in libdespotify that makes the application crash when searching for an artist after having searched for an album is still not fixed.

wcborstel 2010-06-15 17:43

Re: footify alpha, a Spotify client based on despotify
 
Quote:

Originally Posted by Joorin (Post 715069)
Thank you for the feedback and help with debugging! This kind of bug is typical of just testing the path through the code where things go as intended, as in "Who'd use the client without playlists? Pff, no-one! I'm sure it works...". :)

And thanks for your support! Glad to have it working now. And you know what they say ... assumption is the mother of all f*ckups ;)

Anyway, one other thing I did notice. The 3G network of a specific provider here in the Netherlands is rather poor. Often I find myself with an useless 3G connection. However it seems that footify doesn't always recover from a lack of internet connection when it's playing a song (specifically when the connection is not responding for over a minute or so). Also the entire interface is not responding as soon as the 3G connection drops (it only continues to respond when the connection is re-established). Maybe it's possible to make this non-blocking so footify is actually still usable? At least so you can still properly close the app without Maemo saying that footify is not responding asking for a forced shutdown.

Joorin 2010-06-15 21:19

Re: footify alpha, a Spotify client based on despotify
 
Quote:

Originally Posted by wcborstel (Post 716396)
And thanks for your support! Glad to have it working now. And you know what they say ... assumption is the mother of all f*ckups ;)

Indeed. ;)

Quote:

Anyway, one other thing I did notice. The 3G network of a specific provider here in the Netherlands is rather poor. Often I find myself with an useless 3G connection. However it seems that footify doesn't always recover from a lack of internet connection when it's playing a song (specifically when the connection is not responding for over a minute or so). Also the entire interface is not responding as soon as the 3G connection drops (it only continues to respond when the connection is re-established). Maybe it's possible to make this non-blocking so footify is actually still usable? At least so you can still properly close the app without Maemo saying that footify is not responding asking for a forced shutdown.
This is very much connected to my previous post: there are calls done using the GUI thread, this is bad and might make things hang.

This will, hopefully, not happen when I've decoupled the GUI thread from calls to libdespotify.

So, known issue that's on my TODO list. And pretty close to the top.

wcborstel 2010-06-17 06:26

Re: footify alpha, a Spotify client based on despotify
 
Ah right, makes sense now. Thanks.

Just one more thing while I'n at it (may as well tell you everything eh?), when I have selected a playlist there is no (obvious) way to go back and select another playlist. maybe I have missed that button somewhere but I can't find any way to do that.

All in all I am really pleased with it so far, thanks very much for your hard work on it!


All times are GMT. The time now is 06:10.

vBulletin® Version 3.8.8