From fd66fb8867adc690ef88f8f9765056f5f69c0c19 Mon Sep 17 00:00:00 2001 From: Sebastian Koenig Date: Sat, 10 Sep 2022 08:00:41 -0400 Subject: [PATCH] raop: add support for ALAC codec Some Airplay devices announce themselves as using the ALAC (Apple Lossless Audio Codec) format, while pipewire only supports the PCM codec. A look at the Pulseaudio RAOP reveals that ALAC is supported there, but the encoding looks exactly like what pipewire does for PCM. This patch adds support for ALAC, but it uses the existing PCM infrastructure to send the audio data. --- src/modules/module-raop-sink.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/module-raop-sink.c b/src/modules/module-raop-sink.c index fe6288341..245bb83a6 100644 --- a/src/modules/module-raop-sink.c +++ b/src/modules/module-raop-sink.c @@ -421,6 +421,7 @@ static int flush_to_udp_packet(struct impl *impl) switch (impl->codec) { case CODEC_PCM: + case CODEC_ALAC: len = write_codec_pcm(dst, impl->buffer, n_frames); break; default: @@ -463,6 +464,7 @@ static int flush_to_tcp_packet(struct impl *impl) switch (impl->codec) { case CODEC_PCM: + case CODEC_ALAC: len = write_codec_pcm(dst, impl->buffer, n_frames); break; default: @@ -1756,6 +1758,8 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) str = "PCM"; if (spa_streq(str, "PCM")) impl->codec = CODEC_PCM; + else if (spa_streq(str, "ALAC")) + impl->codec = CODEC_ALAC; else { pw_log_error( "can't handle codec type %s", str); res = -EINVAL;