From ff17374ffa9a8011236a5f7e0db74fddccbd19dc Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Thu, 17 Jan 2019 14:43:39 +0200 Subject: [PATCH] bluez5-device: use correct RTP payload type If one device tries to use PulseAudio to send audio over A2DP to another device with bluez-alsa, that doesn't work because PulseAudio uses an incorrect RTP payload type and bluez-alsa checks that the RTP payload type is correct. According to the A2DP spec, the payload type should be set to a number between 96 and 127. Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/591 --- src/modules/bluetooth/module-bluez5-device.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c index d983efdec..3e72ac3c1 100644 --- a/src/modules/bluetooth/module-bluez5-device.c +++ b/src/modules/bluetooth/module-bluez5-device.c @@ -505,7 +505,12 @@ static int a2dp_process_render(struct userdata *u) { /* write it to the fifo */ memset(sbc_info->buffer, 0, sizeof(*header) + sizeof(*payload)); header->v = 2; - header->pt = 1; + + /* A2DP spec: "A payload type in the RTP dynamic range shall be chosen". + * RFC3551 defines the dynamic range to span from 96 to 127, and 96 appears + * to be the most common choice in A2DP implementations. */ + header->pt = 96; + header->sequence_number = htons(sbc_info->seq_num++); header->timestamp = htonl(u->write_index / pa_frame_size(&u->sample_spec)); header->ssrc = htonl(1); -- GitLab