SUMMARY STEPS TO REPRODUCE 1. 2. 3. OBSERVED RESULT EXPECTED RESULT SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
I am using Bluez-Qt on a platform which is acting as bluetooth audio sink. I don't have exact steps to reproduce the issue, but the d-bus log I captured clearly shows the issue. When playing a media track from bluetooth audio soruce, sometimes the media track information (Title and Album) is empty string. I have observed this on Samsung S8 Android phone. Below is the log from d-bus monitor. It is clear that 2nd Track update is send without Title and Album, BluezQt is overwriting the entry as NULL. signal time=1560569200.695774 sender=:1.0 -> destination=(null destination) serial=1350 path=/org/bluez/hci0/dev_90_97_F3_F7_33_31/player12; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged string "org.bluez.MediaPlayer1" array [ dict entry( string "Track" variant array [ dict entry( string "Title" variant string "Helvetica® Now With Monotype's Charles Nix" ) dict entry( string "Duration" variant uint32 4294967295 ) dict entry( string "Album" variant string "" ) dict entry( string "TrackNumber" variant uint32 1 ) dict entry( string "Artist" variant string "Techmeme Ride Home" ) dict entry( string "NumberOfTracks" variant uint32 1 ) dict entry( string "Genre" variant string "" ) ] ) ] array [ ] signal time=1560569202.644334 sender=:1.0 -> destination=(null destination) serial=1356 path=/org/bluez/hci0/dev_90_97_F3_F7_33_31/player12; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged string "org.bluez.MediaPlayer1" array [ dict entry( string "Track" variant array [ dict entry( string "Duration" variant uint32 1698877 ) ] ) ] array [ ] mediaplayer_p.cpp MediaPlayerTrack MediaPlayerPrivate::variantToTrack(const QVariant &variant) const { const QVariantMap &properties = qdbus_cast<QVariantMap>(variant); return MediaPlayerTrack(properties); }
@David Rosca, Would you need more information on this bug? Your comment will be really helpful. I don't have a very good understanding of Bluez interfaces, so this might very well be a bug with Bluez(5.43) in which case we can close this ticket and I can follow it up with Bluez maintainers.
No, the bugreport is great. I can see what's the problem, but when I was implementing it I didn't think about this possibility. The problem here is that it only sends updated properties of the Track map, while it should probably send the entire Track contents as usual.
Is it possible to merge the QVariantMap entries instead of overwriting the properties with NULL?
QVariantMap C = A.unite(B); But this means MediaPlayerPrivate needs to keep a copy of current track and unite() with received track. Not sure if this is good design to save a copy of track properties.