Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

a2dp_sink_*: Unavailable profile (except SBC) #53

Closed
e-minguez opened this issue Apr 11, 2019 · 13 comments
Closed

a2dp_sink_*: Unavailable profile (except SBC) #53

e-minguez opened this issue Apr 11, 2019 · 13 comments

Comments

@e-minguez
Copy link

Fedora 29 with latest pulseaudio-module-bluetooth-freeworld package:

Name        : pulseaudio-module-bluetooth-freeworld
Version     : 1.1
Release     : 3.fc29
Architecture: x86_64
Install Date: mar 09 abr 2019 10:52:52 CEST
Group       : Unspecified
Size        : 257920
License     : GPLv3
Signature   : RSA/SHA1, jue 04 abr 2019 16:54:04 CEST, Key ID 1191a7c442f19ed0
Source RPM  : pulseaudio-module-bluetooth-freeworld-1.1-3.fc29.src.rpm
Build Date  : mié 03 abr 2019 19:35:01 CEST
Build Host  : buildvm-06.virt.rpmfusion.net
Relocations : (not relocatable)
Packager    : RPM Fusion
Vendor      : RPM Fusion
URL         : https://github.com/EHfive/pulseaudio-modules-bt/
Summary     : Bluetooth support for the PulseAudio sound server, supports aptX, LDAC codecs
Description :
Contains Bluetooth audio (A2DP/HSP/HFP) support for the PulseAudio sound server.
Includes support for LDAC, aptX and aptX-HD codecs.

I can select aptX, aptX-HD and LDAP codecs with pavucontrol or gnome settings but it doesn't work.

Journalctl says:

abr 11 14:21:55 galactica.minwi.lan pulseaudio[2276]: W: [pulseaudio] module-bluez5-device.c: Refused to switch profile to a2dp_sink_ldac: Unavailable profile
abr 11 14:21:58 galactica.minwi.lan pulseaudio[2276]: W: [pulseaudio] module-bluez5-device.c: Refused to switch profile to a2dp_sink_aptx_hd: Unavailable profile
abr 11 14:22:00 galactica.minwi.lan pulseaudio[2276]: W: [pulseaudio] module-bluez5-device.c: Refused to switch profile to a2dp_sink_aptx: Unavailable profile
@EHfive
Copy link
Owner

EHfive commented Apr 12, 2019

Check #31

@rathann
Copy link

rathann commented Apr 14, 2019

I have a similar issue.

Unfortunately, Fedora's bluez package comes without the avinfo tool included: bug #1699680, so I rebuilt it myself with the tool included. My headset seems to support SBC only:

Connecting ... 
Stream End-Point #1: Audio Sink 
	Media Codec: SBC
		Channel Modes: Mono DualChannel Stereo JointStereo
		Frequencies: 16Khz 32Khz 44.1Khz 48Khz 
		Subbands: 4 8
		Blocks: 4 8 12 16 
		Bitpool Range: 2-53
	Content Protection: SCMS-T

@ghost
Copy link

ghost commented Apr 15, 2019

I also have a similar issue on Fedora. I am connecting to a BTR3 device (https://www.fiio.com/btr3) which supports SBC, aptX, aptX-HD, and LDAC. However, I can only connect using aptX-HD. If I try to switch to any other audio profile with either gnome settings or blueman, I get the same error in journalctl.

My avinfo output is as follows:

Stream End-Point #6: Audio Sink 
	Media Codec: Vendor Specific A2DP Codec
		Vendor ID 0x0000000a
		Vendor Specific Codec ID 0x0002
	Content Protection: SCMS-T
Stream End-Point #7: Audio Sink 
	Media Codec: Vendor Specific A2DP Codec
		Vendor ID 0x000000d7
		Vendor Specific Codec ID 0x0024
	Content Protection: SCMS-T
Stream End-Point #5: Audio Sink 
	Media Codec: Vendor Specific A2DP Codec
		Vendor ID 0x0000004f
		Vendor Specific Codec ID 0x0001
		Vendor Specific Value (aptX)
			Frequencies: 44.1kHz 48kHz 
			Channel modes: Stereo 
	Content Protection: SCMS-T
Stream End-Point #4: Audio Sink 
	Media Codec: Vendor Specific A2DP Codec
		Vendor ID 0x0000000a
		Vendor Specific Codec ID 0x0001
Stream End-Point #3: Audio Sink 
	Media Codec: MPEG24
		Object Types: MPEG-2 AAC LC MPEG-4 AAC LC 
		Frequencies: 8kHz 11.025kHz 12kHz 16kHz 22.05kHz 24kHz 32kHz 44.1kHz 48kHz 
		Channels: 1 2 
		Bitrate: 320000
		VBR: Yes
	Content Protection: SCMS-T
Stream End-Point #2: Audio Sink 
	Media Codec: MPEG12
		Channel Modes: Mono DualChannel Stereo JointStereo
		Frequencies: 16Khz 22.05Khz 24Khz 32Khz 44.1Khz 48Khz 
		CRC: Yes
		Layer: 3 
		Bit Rate: Free format
		VBR: Yes
		Payload Format: RFC-2250
	Content Protection: SCMS-T
Stream End-Point #9: Audio Sink 
	Media Codec: Vendor Specific A2DP Codec
		Vendor ID 0x0000012d
		Vendor Specific Codec ID 0x00aa
		Vendor Specific Value (LDAC)
			Unknown: 3c 07
	Content Protection: SCMS-T
Stream End-Point #8: Audio Sink 
	Media Codec: Vendor Specific A2DP Codec
		Vendor ID 0x0000053a
		Vendor Specific Codec ID 0x484c
	Content Protection: SCMS-T
Stream End-Point #1: Audio Sink 
	Media Codec: SBC
		Channel Modes: Mono DualChannel Stereo JointStereo
		Frequencies: 16Khz 32Khz 44.1Khz 48Khz 
		Subbands: 4 8
		Blocks: 4 8 12 16 
		Bitpool Range: 2-53
	Content Protection: SCMS-T ```

@EHfive
Copy link
Owner

EHfive commented Apr 15, 2019

@bwars

Have you got ffmpeg and libldac installed?

If you are not using v1.1.99, devel-package also required.

@ghost
Copy link

ghost commented Apr 15, 2019

Have you got ffmpeg and libldac installed?

Aha, I was missing libldac-devel. After restarting pulseaudio and the bluetooth service, it now uses the LDAC profile by default.

However, I still cannot switch to other audio profiles - including the aptX-HD one that it was using previously!

@EHfive
Copy link
Owner

EHfive commented Apr 15, 2019

@EHfive
Copy link
Owner

EHfive commented Apr 15, 2019

The "Unavailable", literally ... unavailable, at least inside these modules

@ghost
Copy link

ghost commented Apr 15, 2019

I tried enabling the -E option, but it didn't help. I'm using bluez-5.50-3.fc29 from the official Fedora repository though - perhaps the experimental features aren't available in that?

If I do "pactl list sinks | grep -e bluez -e a2dp_codec" I do indeed just get the LDAC option listed.

For the record, I'm also using pulseaudio-module-bluetooth-freeworld-1.1-3.fc29.

@EHfive
Copy link
Owner

EHfive commented Apr 15, 2019

@bwars
Screenshot_20190415_193116

Help yourself, plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

@ghost
Copy link

ghost commented Apr 15, 2019

Yeah, I figured it would be that, just thought I'd give an update first as I can't try that just now. Thanks for the help!

@e-minguez
Copy link
Author

e-minguez commented Apr 16, 2019

I have a similar issue.

Unfortunately, Fedora's bluez package comes without the avinfo tool included: bug #1699680, so I rebuilt it myself with the tool included. My headset seems to support SBC only:

Connecting ... 
Stream End-Point #1: Audio Sink 
	Media Codec: SBC
		Channel Modes: Mono DualChannel Stereo JointStereo
		Frequencies: 16Khz 32Khz 44.1Khz 48Khz 
		Subbands: 4 8
		Blocks: 4 8 12 16 
		Bitpool Range: 2-53
	Content Protection: SCMS-T

I've rebuilt the Fedora's bluez rpm package (https://packagecloud.io/eminguez/bluez) and now I have avinfo but I don't have my headphones to test it :) I'll update the comment to reflect my findings.

Thanks.

Just in case, the patch is simply this:

diff --git a/bluez.spec b/bluez.spec
index c0a7d4a..820ce55 100644
--- a/bluez.spec
+++ b/bluez.spec
@@ -1,7 +1,7 @@
 Name:    bluez
 Summary: Bluetooth utilities
 Version: 5.50
-Release: 6%{?dist}
+Release: 7%{?dist}
 License: GPLv2+
 URL:     http://www.bluez.org/
 
@@ -69,6 +69,7 @@ Utilities for use in Bluetooth applications:
 	- gatttool
 	- start scripts (Red Hat)
 	- pcmcia configuration files
+	- avinfo
 
 The BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A.
 
@@ -146,6 +147,10 @@ make install DESTDIR=$RPM_BUILD_ROOT
 # Debian bug #720486
 install -m0755 attrib/gatttool $RPM_BUILD_ROOT%{_bindir}
 
+# "make install" fails to install avinfo, for Bluetooth protocol discovery
+# Red Hat Bugzilla bug #1699680
+install -m0755 tools/avinfo $RPM_BUILD_ROOT%{_bindir}
+
 # Remove autocrap and libtool droppings
 find $RPM_BUILD_ROOT -name '*.la' -delete
 
@@ -219,6 +224,7 @@ install -D -p -m0755 %{SOURCE4} ${RPM_BUILD_ROOT}/%{_libexecdir}/bluetooth/
 %{_bindir}/mpris-proxy
 %{_bindir}/gatttool
 %{_bindir}/rctest
+%{_bindir}/avinfo
 %{_mandir}/man1/btattach.1.gz
 %{_mandir}/man1/ciptool.1.gz
 %{_mandir}/man1/hcitool.1.gz
@@ -265,6 +271,9 @@ install -D -p -m0755 %{SOURCE4} ${RPM_BUILD_ROOT}/%{_libexecdir}/bluetooth/
 %{_userunitdir}/obex.service
 
 %changelog
+* Tue Apr 16 2019 Eduardo Minguez <edu@linux.com> - 5.50-7
+- Added avinfo
+
 * Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 5.50-6
 - Disable tests temporarily

I'm having issues (https://pagure.io/fedora-infrastructure/issue/7715) trying to create the PR to the bluez repo (https://src.fedoraproject.org/rpms/bluez) but once fixed, hopefully I will create the PR to be included in Fedora

@e-minguez
Copy link
Author

e-minguez commented Apr 17, 2019

avinfo output:

Connecting ... 
Stream End-Point #6: Audio Sink 
	Media Codec: Vendor Specific A2DP Codec
		Vendor ID 0x0000000a
		Vendor Specific Codec ID 0x0002
	Content Protection: SCMS-T
Stream End-Point #5: Audio Sink 
	Media Codec: Vendor Specific A2DP Codec
		Vendor ID 0x0000004f
		Vendor Specific Codec ID 0x0001
		Vendor Specific Value (aptX)
			Frequencies: 44.1kHz 48kHz 
			Channel modes: Stereo 
	Content Protection: SCMS-T
Stream End-Point #53: Audio Source 
	Media Codec: Vendor Specific A2DP Codec
		Vendor ID 0x0000000a
		Vendor Specific Codec ID 0x0106
	Content Protection: SCMS-T
Stream End-Point #21: Audio Sink 
	Media Codec: Vendor Specific A2DP Codec
		Vendor ID 0x0000000a
		Vendor Specific Codec ID 0x0106
	Content Protection: SCMS-T
Stream End-Point #49: Audio Source 
	Media Codec: Vendor Specific A2DP Codec
		Vendor ID 0x0000000a
		Vendor Specific Codec ID 0x0103
	Content Protection: SCMS-T
Stream End-Point #17: Audio Sink 
	Media Codec: Vendor Specific A2DP Codec
		Vendor ID 0x0000000a
		Vendor Specific Codec ID 0x0103
	Content Protection: SCMS-T
Stream End-Point #33: Audio Source 
	Media Codec: SBC
		Channel Modes: Mono DualChannel Stereo JointStereo
		Frequencies: 16Khz 32Khz 44.1Khz 48Khz 
		Subbands: 4 8
		Blocks: 4 8 12 16 
		Bitpool Range: 2-53
	Content Protection: SCMS-T
Stream End-Point #1: Audio Sink 
	Media Codec: SBC
		Channel Modes: Mono DualChannel Stereo JointStereo
		Frequencies: 16Khz 32Khz 44.1Khz 48Khz 
		Subbands: 4 8
		Blocks: 4 8 12 16 
		Bitpool Range: 2-53
	Content Protection: SCMS-T

Then, I've updated to pulseaudio-module-bluetooth-freeworld-1.1.99-2.fc29.x86_64, modified /etc/systemd/system/bluetooth.target.wants/bluetooth.service to add -E at the Exec command, reloaded systemd and restarted the bluetooth service.

Now I can use aptX, but no LDAC (which doesn't seem to be supported by the headphones), nor aptX HD (which doesn't seem to be supported by the headphones) nor SBC (IDK why):

abr 17 11:23:43 galactica.minwi.lan pulseaudio[1943]: W: [pulseaudio] module-bluez5-device.c: Refused to switch profile to a2dp_sink_ldac: Unavailable profile
abr 17 11:23:48 galactica.minwi.lan pulseaudio[1943]: W: [pulseaudio] module-bluez5-device.c: Refused to switch profile to a2dp_sink_aptx_hd: Unavailable profile
abr 17 11:23:54 galactica.minwi.lan pulseaudio[1943]: W: [pulseaudio] module-bluez5-device.c: Refused to switch profile to a2dp_sink_sbc: Unavailable profile

Also, I've just did the PR to Fedora's bluez package to include avinfo https://src.fedoraproject.org/rpms/bluez/pull-request/1

@EHfive
Copy link
Owner

EHfive commented Apr 18, 2019

@e-minguez

Now I can use aptX, but no LDAC (which doesn't seem to be supported by the headphones), nor aptX HD (which doesn't seem to be supported by the headphones) nor SBC (IDK why):

There was a bug in bluez; https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=9f7659a44601e043bdb6724b0ab4f3f59c46e9fe.
Then, I commited 9ff89b4 after v1.1.99 released.

So you have to upgrade both pulseaudio-modules-bt and bluez to newest, or downgrade bluez revision which before https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=9f7659a44601e043bdb6724b0ab4f3f59c46e9fe

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

No branches or pull requests

3 participants