mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.26k stars 573 forks source link

Support for accepting raw PCM data #816

Closed LinusU closed 5 years ago

LinusU commented 5 years ago

Some players (e.g. philippe44/RAOP-Player) default to sending the data as raw PCM instead of ALAC encoded audio. This is done by sending a=rtpmap:96 L16/44100/2 instead of a=rtpmap:96 AppleLossless and a=fmtp:96 352 0 16 40 10 14 2 255 0 0 44100 in the ANNOUNCE step.

This is accepted by e.g. the HomePod and the AirPort Express, but not currently supported in Shairplay Sync which dies with the following error:

FMTP params missing from the following ANNOUNCE message: [...] Error in handling ANNOUNCE on conversation thread 1. Unlocking the play lock.

It would be nice if support could be added, so that RAOP-Player can connect to Shairport Sync out of the box ☺️

I might be able to get some time to contribute code for this 🙌

mikebrady commented 5 years ago

Thanks. It’s a nice idea alright, and it would be nice if someone took a look at it.

mikebrady commented 5 years ago

Hi there. I've just pushed a version of Shairport Sync that can handle raw PCM from that player you mention above. It's a bit fragile: the size of packets must (still) be 352 frames, even though that doesn't seem to be signalled in the ANNOUNCE. It would be a lot of work to remove that restriction! Anyways it's a new [temporary] branch called feature/rawpcm. Comments welcome. If it's okay, we can roll it into the upcoming release.

mikebrady commented 5 years ago

I've moved the update into the development branch.

mikebrady commented 5 years ago

Closing this issue – it's in the release version.