badaix / snapcast

Synchronous multiroom audio player
GNU General Public License v3.0
6.21k stars 456 forks source link

Airplay metadata paring is mostly missing on current development #1103

Closed yubiuser closed 6 months ago

yubiuser commented 1 year ago

Describe the bug When using Airplay backend of the current development branch of snapcast with the current development branch from https://github.com/mikebrady/shairport-sync metadata is almost not parsed. Looking at the snapcast code, things like artist and title should be parsed.

https://github.com/badaix/snapcast/blob/c9bdceb1342a5776a21623992885b2f96de3f398/server/streamreader/airplay_stream.cpp#L174-L179

Steps to Reproduce

  1. Compile development snapcast and development shairport-sync (with metadata and airplay2 flag)
  2. Start playing a song via Airplay
  3. Compare output of snapcast when using Airplay with the output of the reference implementation of the metadata-reader from https://github.com/mikebrady/shairport-sync-metadata-reader

Snapcast

2023-02-01 10-25-55.180 [Info] (AirplayStream) Metadata pipe opened: /tmp/shairmeta.119.7000 
2023-02-01 10-27-55.219 [Info] (AirplayStream) Waiting for metadata, retrying in 2500ms
2023-02-01 10-27-57.719 [Info] (AirplayStream) Waiting for metadata, retrying in 2500ms
2023-02-01 10-28-00.221 [Info] (AirplayStream) Waiting for metadata, retrying in 2500ms
2023-02-01 10-28-02.721 [Info] (AirplayStream) Waiting for metadata, retrying in 2500ms
2023-02-01 10-28-05.222 [Info] (AirplayStream) Waiting for metadata, retrying in 2500ms
2023-02-01 10-28-07.723 [Info] (AirplayStream) Waiting for metadata, retrying in 2500ms
2023-02-01 10-28-23.071 [Info] (PcmStream) State changed: Airplay, state: idle => playing
2023-02-01 10-28-23.072 [Info] (Server) onStateChanged (Airplay): playing
2023-02-01 10-28-28.278 [Info] (PcmStream) State changed: Airplay, state: playing => idle
2023-02-01 10-28-28.278 [Info] (Server) onStateChanged (Airplay): idle

Metedata-Reader

/ # metadata < /tmp/shairmeta.119.7000 
The AirPlay client at "fe80::1009:a791:8b3d:76fb" is about to connect to this player. (AirPlay 2 only.)
The AirPlay client at "fe80::1009:a791:8b3d:76fb" has connected to this player.
The address used by this player for this play session is: "fe80::9635:7dc0:8cd:fdea".
The name of the AirPlay client is "iPad".
The AirPlay client's Device ID is "14:20:5E:D3:D3:88". (AirPlay 2 only.)
The model of the AirPlay client is "iPad7,6".
The AirPlay client's MAC address is "14:20:5E:DB:00:16". (AirPlay 2 only.)
"ssnc" "acre": 0x393532333630303839
"ssnc" "daid": 0x31364636434442423735323233413137
"ssnc" "abeg"
"ssnc" "pbeg"
Volume: "-24.00,-54.89,-96.30,0.00".
"ssnc" "pffr"
Picture "2560831680" start.
End data tag not seen, "<data" seen instead.
Error -- unexpected characters at the end of a base64 section.
Picture received, length 24209 bytes.

XXX Could not decipher: "MjU2MDgzMTY4MA==</data></item>
".
Progress String "2560618610/2560832840/2572319858".
Metadata bundle "2560833208" start.

XXX Could not decipher: "</item>
".
Album Name: "Songs of Innocence".
Artist: "U2".
"core" "asdc": 0x0001
Song Data Kind: (possibly 0 == timed track, 1 == untimed stream): "0".
"core" "caps": 0x02
Track length: 265334 milliseconds.
Metadata bundle "2560833208" end.
"ssnc" "prsm"
Artist: "U2".
Composer: "".
Genre: "Rock".
Title: "Cedarwood Road".
"core" "caps": 0x01
Metadata bundle "2560840288" end.
Progress String "2560656007/2560840503/2572357255".
"ssnc" "dapo": 0x3439323034
"ssnc" "dapo": 0x3439323034
"ssnc" "dapo": 0x3439323034
"ssnc" "dapo": 0x3439323034
"ssnc" "paus"
"ssnc" "pend"
"ssnc" "aend"

Environment details

badaix commented 1 year ago

Unfortunately I still don't own any apple devices, but I'm open for donations

yubiuser commented 1 year ago

I have a single apple device which is still in use. But when I come across a spare one, I'll think of you :)

badaix commented 7 months ago

Is it still missing in v0.28.0-beta.1?

yubiuser commented 7 months ago

Depends ;-)

There are no log entries, but this might be desired.

2024-04-02 20-17-14.035 [Info] (PcmStream) State changed: Airplay, state: idle => playing
2024-04-02 20-17-14.035 [Info] (Server) onStateChanged (Airplay): playing
2024-04-02 20-17-16.468 [Info] (Server) onResync (Airplay): 92.336 ms
2024-04-02 20-17-16.562 [Info] (Server) onResync (Airplay): 54.2203 ms

However, there is perfect support in snapweb Screenshot at 2024-04-02 20-20-36


P.S. The arrangement of the gear icon and the source selector seems to overlap a bit. I looks like there should be some more gray background in front of the 'Airplay' select box which looks like is cut of by a white box surrounding the gear icon.