Bug 408893 - Empty Track metadata on audio sink
Summary: Empty Track metadata on audio sink
Status: REPORTED
Alias: None
Product: frameworks-bluez-qt
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.59.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Rosca
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-19 01:41 UTC by snehal.tan
Modified: 2019-07-02 09:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description snehal.tan 2019-06-19 01:41:32 UTC
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
Comment 1 snehal.tan 2019-06-19 01:51:44 UTC
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);
}
Comment 2 snehal.tan 2019-07-02 04:33:50 UTC
@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.
Comment 3 David Rosca 2019-07-02 05:21:09 UTC
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.
Comment 4 snehal.tan 2019-07-02 09:14:49 UTC
Is it possible to merge the QVariantMap entries instead of overwriting the properties with NULL?
Comment 5 snehal.tan 2019-07-02 09:21:31 UTC
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.