You are not logged in.
Pages: 1
my headset supports both sbc and aac.
but sbc is always selected. How can i get AAC instead?
i'm using kde/plasma. which doesn't have much yet for bluetooth besides pairing. so using `bluetoothctl` which doesn't give anything for any `list-attributes` commands. and `pactl` which shows a lot of info but is crazy unintuitive.. i could only figure out how to force a profile, but that doesn't help as the profile always get the sbc codec anyway. (aac is in the same profile)
Sink #4
State: RUNNING
Name: bluez_sink.12345.a2dp_sink
Driver: module-bluez5-device.c
Sample Specification: s16le 2ch 44100Hz
Channel Map: front-left,front-right
Owner Module: 27
Mute: no
Volume: front-left: 28898 / 44% / -21.34 dB, front-right: 28898 / 44% / -21.34 dB
balance 0.00
Base Volume: 65536 / 100% / 0.00 dB
Monitor Source: bluez_sink.21_08_21_19_10_94.a2dp_sink.monitor
Latency: 45426 usec, configured 39512 usec
Flags: HARDWARE HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
Properties:
bluetooth.protocol = "a2dp_sink"
bluetooth.codec = "sbc"
device.string = "12345"
device.api = "bluez"
device.class = "sound"
device.bus = "bluetooth"
device.form_factor = "headphone"
bluez.path = "/org/bluez/hci0/dev_12345"
bluez.class = "0x240418"
device.icon_name = "audio-headphones-bluetooth"
Ports:
headphone-output: Headphone (type: Headphones, priority: 0, available)
Active Port: headphone-output
Formats:
pcm
...
Card #5
Name: bluez_card.12345
Driver: module-bluez5-device.c
Owner Module: 27
Properties:
device.api = "bluez"
device.class = "sound"
device.bus = "bluetooth"
device.form_factor = "headphone"
bluez.class = "0x240418"
device.icon_name = "audio-headphones-bluetooth"
bluetooth.codec = "sbc"
Profiles:
a2dp_sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 40, available: yes)
handsfree_head_unit: Handsfree Head Unit (HFP) (sinks: 1, sources: 1, priority: 30, available: no)
off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
Active Profile: a2dp_sink
Ports:
headphone-output: Headphone (type: Headphones, priority: 0, latency offset: 0 usec, available)
Part of profile(s): a2dp_sink, handsfree_head_unit
headphone-input: Bluetooth Input (type: Bluetooth, priority: 0, latency offset: 0 usec, not available)
Part of profile(s): handsfree_head_unitnot familiar with bluetooth stuff.
Forum has some stuff like https://bbs.archlinux.org/viewtopic.php?id=272701 which hinted me that the wireplumber package is not updated for a while (well, it is update as much as the upstream, the upstream seems to be slow). So i grabbed the up to date config from git https://gitlab.freedesktop.org/pipewire … type=heads
on that file you can see a line:
-- Enabled A2DP codecs (default: all).
--["bluez5.codecs"] = "[ sbc sbc_xq aac ldac aptx aptx_hd aptx_ll aptx_ll_duplex faststream faststream_duplex ]",well, my first try was to uncomment it and remove both 'sbc' from there. but after `systemctl restart bluetooth` and repair, i still got sbc just the same. ![]()
Last edited by gcb (2023-09-29 14:52:51)
Offline
Lol. just realize `systemctl stop bluetooth` changes nothing in my system.
i can still pair and play music on my headset just fine... so i guess it was NOT the right way to reload those settings?!
i don't have a wireplumber service... what is even handling bluetooth after systemctl stop bluetooth?!
edit: ok, it was the bluetooth systemd service just fine. i'm not that lost i guess.
It does control bluetooth and i get unpaired if I stop it, but for some reason (gotta love systemd having a mind on its own) it gets restarted automatically right away! i have no idea what is doing it... but i cannot have bluetooth service stopped in any way besides `disable --now`... systemd <3
anyway, that at least confirms that restarting the service might reload that config file.
-- remove hands-free profiles
["bluez5.roles"] = "[ a2dp_sink a2dp_source bap_sink bap_source hsp_ag hfp_ag ]",
-- force non-sbc codecs
["bluez5.codecs"] = "[ aac ldac aptx ]",Last edited by gcb (2023-09-28 15:23:02)
Offline
more investigation.
on android, the headset do allows me to select either SBC or AAC.
but:
$ pactl send-message /card/bluez_card.12345/bluez list-codecs
[{"name":"sbc","description":"SBC"},
{"name":"sbc_xq_453","description":"SBC XQ 453kbps"},
{"name":"sbc_xq_512","description":"SBC XQ 512kbps"},
{"name":"sbc_xq_552","description":"SBC XQ 552kbps"}]
with either my modified config file (which excludes handsfree profile), and the original one from pacman, and the one from git.
config file doesn't seem to be doing anything. In fact there's a bug on parsing it that only shows up during boot! and it is prefixed by 'bluetoothd:' but i don't get these errors to show up again on the log after systemctl restart... sigh.
Last edited by gcb (2023-09-28 15:39:01)
Offline
What BT device do you have and what makes you think it supports AAC? If you're sure about the headset, what dongle are you using? dmesg/bluetooth service logs?
Offline
What BT device do you have and what makes you think it supports AAC? If you're sure about the headset, what dongle are you using? dmesg/bluetooth service logs?
it's a cheap generic one. spec pages says it supports both (even provides the battery hours spec saying "using AAC volume 50%" etc) and I can use AAC on android (selected via dev mode menu. the system disable the codecs unsupported by the device, and for this one AAC is enabled.)
...Starting to remember aac is copyright encumbered so maybe i don't even have the codec available? ...stil confusing why it used sbc when it is explicitly disabled in the config tho
$ pacman -Ss aa | grep install
extra/faad2 2.10.1-1 [installed]
extra/libvdpau-va-gl 0.4.2-3 [installed]Last edited by gcb (2023-09-28 15:48:36)
Offline
one good news: while the KDE bluetooth options doesn't have many options to change profiles, the audio settings does.
From there i can change between AD2P and HFP. nice.
No lucky with the codecs so far. nothing besides pactl even mentions them.
Offline
Generally speaking, the BT audio implementation and stack come from pipewire/pulseaudio integration. If you are going to see any of the sort, then it will be in pulseaudio tools or wpctl or similar.
So far so uninteresting. For AAC support you need libfdk-aac if we are talking about pipewire, but are we even talking about pipewire?
systemctl --user status pipewire{,-pulse} wireplumber pulseaudioAssuming we are not actually talking about pipewire, you still need above library and minimally gst-plugins-bad for pulse's integration to work.
Offline
Unit pipewire-pulse.service could not be found.
pipewire.service active
wireplumber.service active
pulseaudio.service activeThanks. I finally understood that pipewire is the underlying dependency system... because some pipewire packages conflict with wireplumber (e.g. pipewire-media-session, as both are provides:pipewire-session-manager) i was under the impression wireplumber replaced it all and not just the session ux, as is the case.
So, that means i got almost everything working from some higher level package, but was missing the package
pipewire-audioit brought a few dependencies, such as libfdk-aac :roll-eyes. So I did not have the codec.
But it changed nothing
headphone still only shows sbc. Also, now I realize i don't even know if i'm using sbc_xq, which might explain why my sbc profiles are so bad. grepping the source of the `sbc` package for "xq" gives me zero results
so i'm not very hopeful i have support for it either.
edit:
$ git clone https://git.kernel.org/pub/scm/bluetooth/sbc.git
$ grep -ri xq *
(nothing)
$ strings /usr/lib/spa-0.2/bluez5/libspa-codec-bluez5-sbc.so | grep -i xq
sbc_xq
SBC-XQ
does that means bluez can negotiate it but the kernel driver doesn't support it?
Last edited by gcb (2023-09-29 14:36:41)
Offline
OK, problem solved! solution: just read the wiki and go with option 1 instead of option 2 ![]()
I was using option 2 from https://wiki.archlinux.org/title/Bluetooth_headset instead of option 1. ...i think that was recommended somewhere on a kde configuration wiki page. I will hunt it down and just link to that page.
After
$ pacman -S pipewire-pulse
:: pipewire-pulse and pulseaudio are in conflict. Remove pulseaudio? [y/N] y
:: pipewire-pulse and pulseaudio-bluetooth are in conflict. Remove pulseaudio-bluetooth? [y/N] yand a reboot, everything works perfectly fine!
my crapy harmon kardon speaker which only supports sbc shows:
api.bluez5.codec = "sbc_xq"
api.bluez5.profile = "a2dp-sink"and my aac headphone finally shows
api.bluez5.codec = "aac"
api.bluez5.profile = "a2dp-sink"yay! my ears are happy (as happy as one can be with bluetooth)
edit:
and the KDE integration is even better! instead of showing only two profiles from the audio settings (and not even mentioning the codecs), now it shows one per profile x codec! nice. After doing the right thing, experience is much better than windows or OSX. heck even android
Last edited by gcb (2023-09-29 14:54:58)
Offline
Pages: 1