Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bluealsa: Unsupported RTP payload type: 1 #13

Closed
guillaumezin opened this issue Dec 11, 2016 · 14 comments
Closed

bluealsa: Unsupported RTP payload type: 1 #13

guillaumezin opened this issue Dec 11, 2016 · 14 comments

Comments

@guillaumezin
Copy link
Contributor

Hello,

I'm trying to use a raspberry as bluetooth speaker receiver. Currently, the sender is a Kubuntu 16.10 PC.

I launch on the RPi bluealsa then arecord -f cd -D bluealsa:HCI=hci0,DEV=00:21:4F:4E:08:46 toto.wav

I got this:

pi@Sejour ~/bluez-alsa $ sudo bluealsa
bluealsa: ctl.c:484: Starting controller loop
bluealsa: bluez.c:688: Registering endpoint: 0000110A-0000-1000-8000-00805F9B34FB: /MediaEndpoint/A2DP_MPEG24_Source
bluealsa: bluez.c:688: Registering endpoint: 0000110A-0000-1000-8000-00805F9B34FB: /MediaEndpoint/A2DPSource
bluealsa: bluez.c:688: Registering endpoint: 0000110B-0000-1000-8000-00805F9B34FB: /MediaEndpoint/A2DP_MPEG24_Sink
bluealsa: bluez.c:688: Registering endpoint: 0000110B-0000-1000-8000-00805F9B34FB: /MediaEndpoint/A2DPSink
bluealsa: bluez.c:924: Registering profile: 00001108-0000-1000-8000-00805F9B34FB: /Profile/HSPHeadset
bluealsa: bluez.c:924: Registering profile: 00001112-0000-1000-8000-00805F9B34FB: /Profile/HSPAudioGateway
bluealsa: bluez.c:924: Registering profile: 0000111E-0000-1000-8000-00805F9B34FB: /Profile/HFPHandsFree
bluealsa: bluez.c:924: Registering profile: 0000111F-0000-1000-8000-00805F9B34FB: /Profile/HFPAudioGateway
bluealsa: main.c:212: Starting main dispatching loop
bluealsa: bluez.c:493: Endpoint method call: org.bluez.MediaEndpoint1.SetConfiguration()
bluealsa: bluez.c:427: A2DP Sink (SBC) configured for device 00:21:4F:4E:08:46
bluealsa: bluez.c:429: Configuration: channels: 2, sampling: 44100
bluealsa: transport.c:548: State transition: 0 -> 0
bluealsa: bluez.c:1028: Signal: PropertiesChanged: org.bluez.MediaTransport1
bluealsa: transport.c:548: State transition: 0 -> 1
bluealsa: transport.c:632: New transport: 8 (MTU: R:672 W:672)
bluealsa: bluez.c:1028: Signal: PropertiesChanged: org.bluez.MediaTransport1
bluealsa: transport.c:548: State transition: 1 -> 2
bluealsa: transport.c:94: Created new IO thread: A2DP Sink (SBC)
bluealsa: io.c:330: Starting IO loop: A2DP Sink (SBC)
bluealsa: bluez.c:1028: Signal: PropertiesChanged: org.bluez.MediaTransport1
bluealsa: transport.c:548: State transition: 2 -> 0
bluealsa: transport.c:658: Releasing transport: A2DP Sink (SBC)
bluealsa: transport.c:686: Closing BT: 8
bluealsa: io.c:62: Exiting IO thread
bluealsa: bluez.c:1028: Signal: PropertiesChanged: org.bluez.MediaTransport1
bluealsa: transport.c:548: State transition: 0 -> 1
bluealsa: transport.c:632: New transport: 10 (MTU: R:672 W:672)
bluealsa: bluez.c:1028: Signal: PropertiesChanged: org.bluez.MediaTransport1
bluealsa: transport.c:548: State transition: 1 -> 2
bluealsa: transport.c:94: Created new IO thread: A2DP Sink (SBC)
bluealsa: io.c:330: Starting IO loop: A2DP Sink (SBC)
bluealsa: bluez.c:1028: Signal: PropertiesChanged: org.bluez.MediaTransport1
bluealsa: transport.c:548: State transition: 2 -> 0
bluealsa: transport.c:658: Releasing transport: A2DP Sink (SBC)
bluealsa: transport.c:686: Closing BT: 10
bluealsa: io.c:62: Exiting IO thread
bluealsa: bluez.c:1028: Signal: PropertiesChanged: org.bluez.MediaTransport1
bluealsa: transport.c:548: State transition: 0 -> 1
bluealsa: transport.c:632: New transport: 10 (MTU: R:672 W:672)
bluealsa: bluez.c:1028: Signal: PropertiesChanged: org.bluez.MediaTransport1
bluealsa: transport.c:548: State transition: 1 -> 2
bluealsa: transport.c:94: Created new IO thread: A2DP Sink (SBC)
bluealsa: io.c:330: Starting IO loop: A2DP Sink (SBC)
bluealsa: ctl.c:544: New client accepted: 8
bluealsa: ctl.c:547: +-+-
bluealsa: ctl.c:547: +-+-
bluealsa: ctl.c:326: PCM requested for 00:21:4F:4E:08:46 type 1 stream 1
bluealsa: ctl.c:547: +-+-
bluealsa: io.c:93: Opening FIFO for writing: /var/run/bluealsa/hci0-00:21:4F:4E:08:46-1-1
bluealsa: Unsupported RTP payload type: 1
bluealsa: Unsupported RTP payload type: 1
bluealsa: Unsupported RTP payload type: 1
bluealsa: Unsupported RTP payload type: 1
...

and toto.wav is empty (44 bytes).

Any idea?

Thank you

@arkq
Copy link
Owner

arkq commented Dec 11, 2016 via email

@guillaumezin
Copy link
Contributor Author

I stream using Pulseaudio (Amarok plays a MP3 and I displace its output to RPi seen as bluetooth speaker). I guess it is using A2DP audio.

I tried using my Android tablet, it seems that it worked a bit, then I wasn't able to reconnect streams, it seems related to the crap Android firmware of the chinese tablet this time...

My goal is to connect a videoprojector (I will open for Christmas...), I'm confident regarding the almost working test with the Android tablet.

arkq added a commit that referenced this issue Dec 11, 2016
PulseAudio uses incorrect (reserved) value for RTP payload type. So, our
payload type check prevents playing audio transfered from PulseAudio. In
order to allow playing audio from PulseAudio server, this constraint has
been removed.

Fixes #13
@arkq
Copy link
Owner

arkq commented Dec 11, 2016

Try to compile bluealsa from the pulseaudio branch. I've removed payload type check, so now recording should work. I will not merge this commit into the master branch, though. This commit is a workaround for a "bug" in a PulseAudio.

@guillaumezin
Copy link
Contributor Author

Thank you, it works this way.

By the way, may I suggest you to indicate dependencies in you readme? It would be easier to compile (I had to compile on raspbian jessie bcutil, bctoolbox, mbedtls-2.4.0, ortp, from https://github.com/BelledonneCommunications, fdk-aac-0.1.4 from https://sourceforge.net/projects/opencore-amr/files/fdk-aac for --enable-aac option, and I needed libtool, autoconf, libglib2.0-dev, libasound2-dev, libbluetooth-dev and libsbc-dev).

@arkq
Copy link
Owner

arkq commented Dec 13, 2016

I'm glad, that it works for you. Also, I've added the dependency list to the readme file, following your suggestion. However, I've used original library names, because it seems that every distribution is trying to use its own naming convention...

@G10DRAS
Copy link

G10DRAS commented Apr 18, 2017

Hello @guillaumezin just saw this post, you did a great job.
Is it possible for you to upload compiled bluez-alsa project for jessie somewhere?
It will save time and will help many others who need it on Jessie.
Thanks in advance.

@guillaumezin
Copy link
Contributor Author

@G10DRAS
Copy link

G10DRAS commented Apr 20, 2017

@guillaumezin Thanks a lot !!

You can also create a .deb package (easy to install) by running following commands:
sudo apt-get install checkinstall

sudo checkinstall --install=no -D make install
#OR
sudo checkinstall --install=no

This will not install any thing but create a .deb package which is then install by simply running:
sudo dpkg -i bluealsa.deb

arkq pushed a commit that referenced this issue Apr 21, 2017
PulseAudio uses incorrect (reserved) value for RTP payload type. So, our
payload type check prevents playing audio transfered from PulseAudio. In
order to allow playing audio from PulseAudio server, this constraint has
to be removed.

Fixes #13 and closes #44
@guillaumezin
Copy link
Contributor Author

@G10DRAS I did as you mentionned, a package with checkinstall

https://github.com/guillaumezin/bluez-alsa/releases/tag/v1.2.0a

And I put my scripts as example to autoconnect my RPi as A2DP sink

https://github.com/guillaumezin/bluez-alsa/tree/master/scripts

@G10DRAS
Copy link

G10DRAS commented Apr 23, 2017

@guillaumezin Thanks once again !!! You save my day. oRTP compilation on Jessie is a real mess .

@fdev1
Copy link

fdev1 commented Oct 14, 2017

@arkq I'm getting the same error but from an Android phone (old Samsung Galaxy Victory). Building with --disable-payloadcheck fixes the problem. So since it's not just a pulseaudio issue may I suggest that this will be turned into a command switch rather than a compile-time option? Perhaps it should be the default since most devices don't do it (this phone works with every other device I've tried) or at least include a hint in the error message. Thanks for the good work!

@arkq
Copy link
Owner

arkq commented Oct 22, 2017

Hi @Fernando-Rodriguez

Building with --disable-payloadcheck fixes the problem.

Could you please, paste here the payload type which is used by your Android version (from the warning message)? A2DP spec does not specify which payload type shall be used exactly or at least I couldn't find it. It only states, that the dynamic range shall be used, which is 96-127. In the case of PulseAudio the usage of payload type 1 is unforgivable :D (https://tools.ietf.org/html/rfc3551#section-6) If your phone uses the value from this range, I will have to loosen a little bit this payload type checking.

So since it's not just a pulseaudio issue may I suggest that this will be turned into a command switch rather than a compile-time option? Perhaps it should be the default since most devices don't do it (this phone works with every other device I've tried) or at least include a hint in the error message.

I'll think about it :D.

or at least include a hint in the error message.

Good point. I'll add some hint.

arkq added a commit that referenced this issue Jul 23, 2018
Some devices set other value than 96 (e.g. Doogee X5 Pro).

Fixes #13
@noamelf
Copy link

noamelf commented Nov 18, 2018

Hi, I'm having this issue as well 😿 .
Just opened a ticket for PulseAudio: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/591

@uqs
Copy link

uqs commented Jan 11, 2020

Hey @arkq I was wondering whether you could simply remove the check (3x) in src/io.c. I'm asking this as the current ChromeOS seems to be still using the older pulseaudio underneath and trying to stream anything from a Chromebook to bluez-alsa results in the RTP payload type 1 check firing.

It seems a bit strict to me to discard all those payloads < 96. There's type 8 for example which is PCM audio. Why would you want to discard that? Shouldn't bluez-alsa be able to deal with a PCM stream? What if my phone wants to pass through a GSM stream also?

Type 1 is silly, sure, but considering that pulseaudio messed that up and it is widely deployed in many (old) versions, many of which will never see an update, it seems straightforward to me. Postel's Law and all that.

Thanks for considering
uqs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants