work on media-hub
I have spent some time with media-hub. I wanted to solve three problems:
1 The default image for album art is not shown on the Sound indicator panel.
2 Embedded album art of audio streams do not show up on the Sound indicator panel.
3 Using media-hub playlist still results in choppy audio after a track change.
For the default image I have a PR (https://github.com/ubports/media-hub/pull/7).
It removes the use of some sort of 'dash' server which does not exist anymore and .
For the embedded album art I have a PR (https://github.com/ubports/media-hub/pull/10). It saves the image to a temporary file and let Thumbnailer handle it.
For the choppy audio problem I have a PR (https://github.com/ubports/media-hub/pull/8). Media-hub acquires a new wackelock for every track and releases it when the track is done. If the app is suspended when the track is done it will not signal media-hub to continue playing. But media-hub will keep on playing this time without acquiring a new wakelock and thus the audio becomes choppy.
This PR makes sure media-hub will acquire a new wakelock when playing the next track even when the app is suspended. It seems to work.
Part of the media-hub code is used in qtubuntu-media (libmedia-hub-client). There is still some code in there to detach/reattach the app when suspending/activating. I tried all sorts of things but it does not work anymore (unless the Player object is not renewed). Video playing becomes completely broken since event registration/notification is
messy. Besides that detaching does not seem to do a lot (only sets the lifetime state in mediahub) so I gave up on it.
There was a proposal to add reference counting and keep the wakelock based on that. I think that won't be needed and would also result in a wakelock being kept when there is no need for it (not playing).
manland last edited by
Thank you for this amazing work!
How do you embed image in song? Do you use a lib?
@manland I am not sure I understand your question. I have a bunch of mp3 and flac files being served by a UPnP Media Server (https://gerbera.io/). I have added embedded album art to these files using an mp3 tag editor (https://www.mp3tag.de/en/).
manland last edited by
@wdehoog I search a way to add embeded album art on the fly with a lib or something like that. But thank you for your answer it help me!
CiberSheep last edited by
Thanks. Media-hub needs love
@manland 'on the fly'? Could you explain your use case?
Glad to see eork on media hub
These might be ralated to the wakelock issue, but I have to other bugs to highlight
Playlist tracks, ones that media hub has moved on to after the inially selected tracks has finished is not pausable, manipulatable from the sound dropdown menu. They also keep playing on headphone disconnect whereas the originally selected track will stop playing on headphone disconnect
@theare27 which phone are you using? which app are you using or do all apps behave this way?
@wdehoog Podbird on OnePlus One
I guess it could be app specific - will double check with other apps to see if it's the same behavior