mbox series

[BlueZ,0/3] Fix now playing list on playlist change

Message ID 20241004144043.419832-1-frederic.danis@collabora.com (mailing list archive)
Headers show
Series Fix now playing list on playlist change | expand

Message

Frédéric Danis Oct. 4, 2024, 2:40 p.m. UTC
Some devices reuse the item ids for the Now Playing list on playlist
change, e.g. using the Samsung Music on Samsung S23. These changes
allows to clear the list and prevent to keep the previous tracks
information.
This also extend the ListItems method to get the Artist, Album,
Track number, Duration and Cover art handle.

This has been tested with Samsung S23 and iPhone 14.

Frédéric Danis (3):
  audio/player: Fix media_player_set_metadata item destination
  audio/player: Clear playlist on Now Playing Changed AVRCP event
  audio/avrcp: Extend ListItems to get more metadata

 profiles/audio/avrcp.c  | 65 ++++++++++++++++++++++++++++++++---------
 profiles/audio/avrcp.h  |  1 +
 profiles/audio/player.c | 16 ++++++++--
 profiles/audio/player.h |  1 +
 4 files changed, 67 insertions(+), 16 deletions(-)

Comments

Frédéric Danis Oct. 4, 2024, 4:02 p.m. UTC | #1
Hi,

On 04/10/2024 16:40, Frédéric Danis wrote:
> Some devices reuse the item ids for the Now Playing list on playlist
> change, e.g. using the Samsung Music on Samsung S23. These changes
> allows to clear the list and prevent to keep the previous tracks
> information.
> This also extend the ListItems method to get the Artist, Album,
> Track number, Duration and Cover art handle.
>
> This has been tested with Samsung S23 and iPhone 14.
>
> Frédéric Danis (3):
>    audio/player: Fix media_player_set_metadata item destination
>    audio/player: Clear playlist on Now Playing Changed AVRCP event
>    audio/avrcp: Extend ListItems to get more metadata
>
>   profiles/audio/avrcp.c  | 65 ++++++++++++++++++++++++++++++++---------
>   profiles/audio/avrcp.h  |  1 +
>   profiles/audio/player.c | 16 ++++++++--
>   profiles/audio/player.h |  1 +
>   4 files changed, 67 insertions(+), 16 deletions(-)
>
To be more clear and with samples here is what occurs in bluetoothctl 
currently, after playlist change on the phone only items with an UID 
greater than the last one of the previous playlist are displayed as new 
and metadata of the others are not updated:

    [bluetooth]# connect 24:24:B7:11:82:6C
    Attempting to connect to 24:24:B7:11:82:6C
    [bluetooth]# [CHG] Device 24:24:B7:11:82:6C Connected: yes
    [Frédéric's S23]# [NEW] Endpoint
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep3
    [Frédéric's S23]# [NEW] Endpoint
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep1
    [Frédéric's S23]# [NEW] Endpoint
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep2
    [Frédéric's S23]# [NEW] Endpoint
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep4
    [Frédéric's S23]# [NEW] Endpoint
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep5
    [Frédéric's S23]# [NEW] Transport
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep2/fd2
    [Frédéric's S23]# Connection successful
    [Frédéric's S23]# [NEW] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 [default]
    [Frédéric's S23]# [CHG] Device 24:24:B7:11:82:6C ServicesResolved: yes
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/Filesystem /Filesystem
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying /NowPlaying
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Type: Audio
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Subtype: Audio Book
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Status: paused
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Browsable: yes
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Playlist:
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Name: Samsung Music
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Repeat: off
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Shuffle: off
    [Frédéric's S23]# [NEW] Folder
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Duration:
    0x00036a1b (223771)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Genre: Rock
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Title: Death On
    Two Legs
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Item:
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.TrackNumber:
    0x00000001 (1)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Artist: Queen
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.NumberOfTracks:
    0x0000000b (11)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Album: A Night
    At The Opera
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.ImgHandle: 0000004
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1 <unknown>
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Position: 0x00000000 (0)
    [Frédéric's S23]# player.change-folder
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying
    Attempting to change folder
    [Frédéric's S23]# [CHG] Folder
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Name: /NowPlaying
    [Frédéric's S23]# ChangeFolder successful
    [Frédéric's S23]# player.list-items 0 50
    Attempting to list items
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item2
    Lazing On A Sunday Afternoon
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item3 I'm
    In Love With My Car
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item4
    You're My Best Friend
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item5 Sweet
    Lady
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item6
    Seaside Rendezvous
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item7 The
    Prophet's Song
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item8 Love
    Of My Life
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item9 Good
    Company
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item10
    Bohemian Rhapsody
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item11 God
    Save The Queen
    [Frédéric's S23]# ListItems successful
    [Frédéric's S23]# player.show-item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item2
    Item /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item2
         Player: /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0
         Name: Lazing On A Sunday Afternoon
         Type: audio
         Playable: yes
         Metadata.Title: Lazing On A Sunday Afternoon
    [CHG] Transport /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep2/fd2
    State: pending
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Position: 0x0000012b (299)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Status: playing
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Position: 0x00000151 (337)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Duration:
    0x0001a8e6 (108774)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Genre: <unknown>
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Title: Prologue
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Item:
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.TrackNumber:
    0x00000001 (1)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Artist: Toto
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.NumberOfTracks:
    0x00000011 (17)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Album: Dune
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.ImgHandle: 0000006
    [Frédéric's S23]# [CHG] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1
    Metadata.Duration: 0x0001a8e6 (108774)
    [Frédéric's S23]# [CHG] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1
    Metadata.Genre: <unknown>
    [Frédéric's S23]# [CHG] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1
    Metadata.Title: Prologue
    [Frédéric's S23]# [CHG] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1
    Metadata.TrackNumber: 0x00000001 (1)
    [Frédéric's S23]# [CHG] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1
    Metadata.Artist: Toto
    [Frédéric's S23]# [CHG] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1
    Metadata.NumberOfTracks: 0x00000011 (17)
    [Frédéric's S23]# [CHG] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1
    Metadata.Album: Dune
    [Frédéric's S23]# [CHG] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1
    Metadata.ImgHandle: 0000006
    [Frédéric's S23]# [CHG] Transport
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep2/fd2 State: active
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Position: 0x00000173 (371)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Position: 0x00000058 (88)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Status: paused
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Position: 0x00000058 (88)
    [Frédéric's S23]# [CHG] Transport
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep2/fd2 State: idle
    [Frédéric's S23]# list-items 0 50
    Attempting to list items
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item12
    Prelude (Take My Hand)
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item13 Paul
    Takes the Water of Life
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item14 Big
    Battle
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item15 Paul
    Kills Feyd
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item16
    Final Dream
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item17 Take
    My Hand
    [Frédéric's S23]# ListItems successful
    [Frédéric's S23]# player.show-item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item2
    Item /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item2
         Player: /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0
         Name: Lazing On A Sunday Afternoon
         Type: audio
         Playable: yes
         Metadata.Title: Lazing On A Sunday Afternoon

While with those commits, the items are deleted on playlist change and 
all new ones are created with correct metadata:

    [bluetooth]# connect 24:24:B7:11:82:6C
    Attempting to connect to 24:24:B7:11:82:6C
    [bluetooth]# [CHG] Device 24:24:B7:11:82:6C Connected: yes
    [Frédéric's S23]# [NEW] Endpoint
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep3
    [Frédéric's S23]# [NEW] Endpoint
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep1
    [Frédéric's S23]# [NEW] Endpoint
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep2
    [Frédéric's S23]# [NEW] Endpoint
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep4
    [Frédéric's S23]# [NEW] Endpoint
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep5
    [Frédéric's S23]# [NEW] Transport
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep2/fd0
    [Frédéric's S23]# Connection successful
    [Frédéric's S23]# [NEW] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 [default]
    [Frédéric's S23]# [CHG] Device 24:24:B7:11:82:6C ServicesResolved: yes
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Playlist is nil
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/Filesystem /Filesystem
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying /NowPlaying
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Type: Audio
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Subtype: Audio Book
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Status: paused
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Browsable: yes
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Playlist:
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Name: Samsung Music
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Repeat: off
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Shuffle: off
    [Frédéric's S23]# [NEW] Folder
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Duration:
    0x00036a1b (223771)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Genre: Rock
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Title: Death On
    Two Legs
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Item:
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.TrackNumber:
    0x00000001 (1)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Artist: Queen
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.NumberOfTracks:
    0x0000000b (11)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Album: A Night
    At The Opera
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.ImgHandle: 0000004
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1 <unknown>
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Position: 0x00000590
    (1424)
    [Frédéric's S23]# player.change-folder
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying
    Attempting to change folder
    [Frédéric's S23]# [CHG] Folder
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Name: /NowPlaying
    [Frédéric's S23]# ChangeFolder successful
    [Frédéric's S23]# player.list-items 0 50
    Attempting to list items
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item2
    Lazing On A Sunday Afternoon
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item3 I'm
    In Love With My Car
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item4
    You're My Best Friend
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item5 Sweet
    Lady
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item6
    Seaside Rendezvous
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item7 The
    Prophet's Song
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item8 Love
    Of My Life
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item9 Good
    Company
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item10
    Bohemian Rhapsody
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item11 God
    Save The Queen
    [Frédéric's S23]# show-item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item2
    Item /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item2
         Player: /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0
         Name: Lazing On A Sunday Afternoon
         Type: audio
         Playable: yes
         Metadata.Title: Lazing On A Sunday Afternoon
         Metadata.TrackNumber: 0x00000002 (2)
         Metadata.Duration: 0x0001077f (67455)
         Metadata.Album: A Night At The Opera
         Metadata.Artist: Queen
    [Frédéric's S23]# ListItems successful
    [Frédéric's S23]# [CHG] Transport
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep2/fd0 State: pending
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Status: playing
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Position: 0x00000598
    (1432)
    [Frédéric's S23]# [CHG] Transport
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep2/fd0 State: active
    [Frédéric's S23]# [CHG] Transport
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep2/fd0 State: idle
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Position: 0x00000598
    (1432)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Status: paused
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Position: 0x00000598
    (1432)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Position: 0x00000030 (48)
    [Frédéric's S23]# [CHG] Transport
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep2/fd0 State: pending
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Status: playing
    [Frédéric's S23]# [CHG] Transport
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep2/fd0 State: active
    [Frédéric's S23]# [DEL] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item11 God
    Save The Queen
    [Frédéric's S23]# [DEL] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item10
    Bohemian Rhapsody
    [Frédéric's S23]# [DEL] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item9 Good
    Company
    [Frédéric's S23]# [DEL] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item8 Love
    Of My Life
    [Frédéric's S23]# [DEL] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item7 The
    Prophet's Song
    [Frédéric's S23]# [DEL] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item6
    Seaside Rendezvous
    [Frédéric's S23]# [DEL] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item5 Sweet
    Lady
    [Frédéric's S23]# [DEL] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item4
    You're My Best Friend
    [Frédéric's S23]# [DEL] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item3 I'm
    In Love With My Car
    [Frédéric's S23]# [DEL] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item2
    Lazing On A Sunday Afternoon
    [Frédéric's S23]# [DEL] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1 <unknown>
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Playlist:
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Position: 0x0000023e (574)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Duration:
    0x0001a8e6 (108774)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Genre: <unknown>
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Title: Prologue
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Item:
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.TrackNumber:
    0x00000001 (1)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Artist: Toto
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.NumberOfTracks:
    0x00000011 (17)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.Album: Dune
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Track.ImgHandle: 0000006
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item1 <unknown>
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Position: 0x00000255 (597)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Position: 0x00000000 (0)
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Status: paused
    [Frédéric's S23]# [CHG] Player
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0 Position: 0x00000000 (0)
    [Frédéric's S23]# [CHG] Transport
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/sep2/fd0 State: idle
    [Frédéric's S23]# list-items 0 50
    Attempting to list items
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item2 Main
    Title
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item3 Robot
    Fight
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item4
    Leto's Theme
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item5 The Box
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item6 The
    Floating Fat Man (The Baron)
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item7 Trip
    to Arrakis
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item8 First
    Attack
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item9
    Prophecy Theme
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item10 Dune
    (Desert Theme)
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item11 Paul
    Meets Chani
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item12
    Prelude (Take My Hand)
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item13 Paul
    Takes the Water of Life
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item14 Big
    Battle
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item15 Paul
    Kills Feyd
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item16
    Final Dream
    [Frédéric's S23]# [NEW] Item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item17 Take
    My Hand
    [Frédéric's S23]# ListItems successful
    [Frédéric's S23]# player.show-item
    /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item2
    Item /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0/NowPlaying/item2
         Player: /org/bluez/hci0/dev_24_24_B7_11_82_6C/player0
         Name: Main Title
         Type: audio
         Playable: yes
         Metadata.Title: Main Title
         Metadata.TrackNumber: 0x00000002 (2)
         Metadata.Duration: 0x00013c54 (80980)
         Metadata.Album: Dune
         Metadata.Artist: Toto
patchwork-bot+bluetooth@kernel.org Oct. 4, 2024, 8:20 p.m. UTC | #2
Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Fri,  4 Oct 2024 16:40:40 +0200 you wrote:
> Some devices reuse the item ids for the Now Playing list on playlist
> change, e.g. using the Samsung Music on Samsung S23. These changes
> allows to clear the list and prevent to keep the previous tracks
> information.
> This also extend the ListItems method to get the Artist, Album,
> Track number, Duration and Cover art handle.
> 
> [...]

Here is the summary with links:
  - [BlueZ,1/3] audio/player: Fix media_player_set_metadata item destination
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=098b94ed6262
  - [BlueZ,2/3] audio/player: Clear playlist on Now Playing Changed AVRCP event
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=671f370a8e34
  - [BlueZ,3/3] audio/avrcp: Extend ListItems to get more metadata
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=31e5b8f20679

You are awesome, thank you!