philippe44 / SpotConnect

Turn any UPnP or AirPlay player into a Spotify Connect device
MIT License
74 stars 3 forks source link

[Question] Show metadata and album art on BubbleUpnp #31

Open GioF71 opened 11 months ago

GioF71 commented 11 months ago

Hello, today I restarted my spotify account, and tried your SpotConnect again, but I wanted to see if an instance of BubbleUpnp can act as a display for what's playing on SpotConnect. Unfortunately, this does not happen for me. In some cases I see album art from a previous track, I cannot seem to be able to follow what's playing through BubbleUpnp. Do you have any suggestion? Thank you very much!

GioF71 commented 11 months ago

If I select the OpenHome renderer in BubbleUpnp, I get something, but there is no album art and the metadata is not completely correct (see the title report 0 as the tracknumber: it's probably a missing tracknumber). Also, we have no information about the duration of the track.

image

I am available to any test you would like me to do if this can be helpful. Thank you anyway for your great software.

philippe44 commented 11 months ago

The TrackNumber and DiscNumber were not provided by CSpot, I've added them and done a PR. Duration is set

philippe44 commented 11 months ago

It's in 0.8.0. I don't know why duration does not appear. I can't easily test BubbleUPnP as I need to fire another VM or machine where I'll install Android Hyper-V crap. I did that on my main machine and it killed my other VM system, it took me 5 hours to roll back everything properly (it did a lot of damage, I'm usually more careful).

GioF71 commented 11 months ago

I am really sorry that this caused such a damage to you. I will do the tests on BubbleUpnp when needed, just let me know if this need arises I will be happy to help you :-) I will try version 0.8.0 as soon as I can, thank you!

philippe44 commented 11 months ago

Not your fault at all, completely mine. I've been lazy and did not do my normal safeguard process

philippe44 commented 11 months ago

For the artwork, it should be retrievable from the player. Just use a tool like UPnP DeviceSpy (or anyother) to query the "GetPositionInfo" of your device.

GioF71 commented 11 months ago

Ok. there is a lot of progress with version 0.8.0.

If I connect BubbleUpnp to the non-openhome renderer, and the playlist is clear, when I try to play from spotify, everything works. Also the coverart.

But:

If I seek the track, the indicator restarts from the beginning. When the track finishes, so there is a track change, the metadata don't change (art, title, album, length). Also if I pick another song and want to play it, it plays correctly, but again the metadata don't change (art, title, album, length). Instead, if I hit pause before selecting a new track, the information about the new track (coverart included) is then displayed correctly.

If there are some tracks in the playlist (a playlist probably owned by the control point), if I hit play on spotify, that track plays, but the control point "thinks" it is playing the first track that was in that playlist. I suppose that, on the playback event, maybe the existing playlist could be cleared?

Maybe also on song change, if the playlist was cleared, the issue with the previous metadata being shown could be avoided.

If, instead, I select the openhome renderer in BubbleUpnp, the behaviour is a lot more consistent. The metadata that is available is always correct, but the coverart and track length are always missing in this scenario.

Does this help? If you want I can produce a video showing the spotify app and the bubbleupnp app (captured using qtscrcpy), let me know if this can be helpful.

Thank you!

GioF71 commented 11 months ago

p.s. I can't find the UPnP devicespy, if this is the site, the binaries are not available anymore. I will look for some alternatives

philippe44 commented 11 months ago

Yes a screen live capture would be helpful as it's difficult to follow. One thing though: restarting from 0 on the UPnP device when seeking is unavoidable.

philippe44 commented 11 months ago

Another thing about the lack of detection of change: uPnP is not a great protocol, to say it politely, and implementation by many devices is abysmal. When you play another track, there is a quick stop then play set of state changes and I suspect bubbleupnp does not capture these. Normally, uPnP has an eventing mechanism to make that unmissable but most don't work and if the application does not do polling, then you miss changes and so here bubbleupnp would have missed the fact that the track changed. Polling is bad as well if you just do state polling as you miss the stop in play,stop,play, you'd need to poll the track info as well. Most of my code is a garbage collection of special cases and timers because of all that crap.

GioF71 commented 11 months ago

Understood! I totally believe you. All things considered, BubbleUpnp as a display works very well when using another device as the real control point, again with bubbleupnp and playing from other media servers, or maybe from BubbleUpnp's Qobuz and Tidal implementations/proxies. When I want to play from Spotify (which I currently don't do on a regular basis) it might be acceptable to switch the "display" tablet from BubbleUpnp to the Spotify app so it would show what's playing. Anyway I will try to prepare you a video as soon as possible. I just made some test, I only need to follow a script in order to keep the video short.

GioF71 commented 11 months ago

Hello, quick update! After discovering that upplay (from the author of upmpdcli) always correctly displays all the metadata, art and duration included, even if I do not hit pause before a track change, I enabled "Use eventing" on bubbleupnp on the relevant renderer, and now BubbleUpnp also works properly!!

GioF71 commented 11 months ago

Ops, it just stopped working after a moment... so confusing!

philippe44 commented 11 months ago

Ops, it just stopped working after a moment... so confusing!

Not surprising and consistent with what uPnP is... some events are missed.

GioF71 commented 11 months ago

It appears to be working again. Maybe it's because I tried to enable "Spotty" on LMS and somehow interfered, or because I tried to enable scrobbling to last.fm... or maybe it's just a fragile setup for the reasons you mentioned before. But if upplay always works, maybe there are some issues on BubbleUpnp... I need to see if I can submit some sort of issue report to the author. I will try a little bit more in the next few days. Thank you for your support

Edit: It doesn't work reliably. Spotty and Scrobblers have no influence as far as I understand, it was completely random. Still upplay always works :-)

GioF71 commented 11 months ago

I have written on the bubbleupnp forum here, I will report here if there is a solution or a workaround.