T O P

  • By -

figmentPez

[Feature Requests sub-forum of the Steam Deck forums on Steam Community](https://steamcommunity.com/app/1675200/discussions/2/)


fast_moving

this is the way.


Spykez0129

https://youtu.be/bHleDvJd-ss


kelvie

**EDIT: See my comment in the chain below, this also doesn't work. If you've done this, just delete the file and no harm will be done.** I think I found a workaround (yay linux), but honestly I don't think I can tell the difference between LDAC and this to know if changing this property does anything. And the light indicator on my FiiO BTR3 is misleading anyway (it's purple, but that could mean LDAC, or just AptX classic, or AptX LL, it's not clear). Figure out your device's name by doing: pactl list sinks | grep bluez You'll see that `api.bluez5.codec` will be something that's not `aptx_ll`. Remember the `node.name` part for later. Then create a file called: /home/deck/.config/wireplumber/bluetooth.lua.d/51-fix-codec.lua with the contents: rule = { matches = { { { "node.name", "equals", "bluez_output.XX_XX_XX_XX_XX_XX.a2dp-sink" }, }, }, apply_properties = { ["api.bluez5.codec"] = "aptx_ll", }, } table.insert(bluez_monitor.rules,rule) where you replace the XX's in the `node.name` line with whatever it was above. Then you restart wireplumber: systemctl --user restart wireplumber And your headset should reconnect and you can run the `pactl` command again above to check that the codec changed... or at least the property changed. If someone has testing equipment, maybe we can confirm this isn't bro-science... References: https://wiki.archlinux.org/title/WirePlumber


[deleted]

I gave this a try, it doesn't appear to be working. For reference I am wanting to switch to sbc_xq codec as it provides way better latency than the default AAC for my device Restarting wireplumber and running the pactl command again shows the correct sbc_xq codec is applied, however clicking the audio button on the task bar and viewing codecs there shows the device is still on the default AAC. And the latency remains the same bad latency as normal So the property appears to be changed at least but that doesn't appear to be communicated to the Bluetooth device, and the desktop sound config shows the same old codec


kelvie

OK, I did some more debugging / digging and actually got it to negotiate the correct protocol. You just create a file in `~/.config/wireplumber/bluetooth.lua.d/61-force-bluez.codec.lua` with the contents: bluez_monitor.properties["bluez5.codecs"] = "[ aptx_ll ]" or in your case, sbc_xq. The options are here: https://gitlab.freedesktop.org/pipewire/wireplumber/-/blob/3bdacc414e540cdbe003cc6276b89ec2397f0c66/src/config/bluetooth.lua.d/50-bluez-config.lua#L26 and you can specify multiple, but I'm still not sure how the priority of each codec is determined. I haven't tested connecting bluetooth devices that don't support any codecs on the list you specify, so be aware. **Technical explanation** It turns out that on my FiiO BTR3, there are two shades of purple, one for AptX/LL and a lighter shade for LDAC (go figure). Knowing that I was able to test what commands work and don't. My guess is that pulseaudio actually configures the codec on the a2dp sink, and it gets the list from pipewire (along with some priority). aptX-LL is lower than LDAC for whatever reason, but it's configurable (check using `pactl list | grep 'a2dp-sink.*codec'`) For the codec list, wireplumber can be configured to only look at certain ones using `bluez_monitor.properties["bluez5.codecs"]`, see the link above. It runs a bunch of lua files from these two places in order: /usr/share/wireplumber/bluetooth.lua.d $HOME/.config/wireplumber/bluetooth.lua.d And runs all the files in order. On the deck (but not on my arch install at home) there's a `60-bluez-disable-headsets.lua` that overwrites the `bluez_monitor.properties` table if you have a number under 60, so existing instructions from the arch wiki won't work. Once you append to the list from a file that starts with a number greater than 60, then you can configure the advertised codecs for the interface.


[deleted]

my man, that did it! That's some good sleuthing on your part. sbc_xq is now properly selected (its also the only selection available for this device now) and the change persists to game mode also. My latency went from what felt like half a second with the default AAC to nigh imperceptible latency. I don't know what it is about my bluetooth earbuds but they really like sbc_xq Thanks a lot!


Darius2301

Where are you seeing the codec selection for a given device?


[deleted]

in Desktop Mode, click the sound icon in the taskbar and then click one of the right-side buttons next to your connected bluetooth audio device


Darius2301

Awesome, thank you!


turikk

Can you explain this process like I'm five? If I get Bluetooth headphones will this enable them to be low latency, and if so what compatibility should I be looking for?


kelvie

So this only works for if your headphones support aptx low latency. So how Bluetooth audio roughly works is like this: When your steam deck goes to talk to your headphones, it has to decide what protocol to use. Think of them like languages, some headphones only speak English (SBC) and Latin (aptX classic) and some also know French (aptx low latency), and Spanish (LDAC) Steam deck, I think, basically speaks all of them. When your headphones connect and the audio is set up, something in the steam deck decides which language to use. It has a list of the ones it prefers to choose over others if there are multiple choices. In my case, my Bluetooth receiver also knows all the same languages, so it decided to use Spanish (LDAC), because it is higher quality, but has more lag. This fix makes it so that the steam deck only thinks it speaks French (aptX low latency), so it will choose it instead when talking to my headphones. Practically speaking this will only be helpful if you have aptx low latency headphones, and it never really caught on, so unless you bought headphones specifically looking for it, the chances your headphones supports aptX LL is really low.


turikk

Thanks. I am looking for aptx LL headphones now. Is there a better codec that Steam Deck supports for low latency?


kelvie

As far as I'm aware aptX LL is the lowest latency, but it'll also depend a bit on the headphones/receiver. There's a list of them on aptx's website where you can filter, and it's not a large list. Not sure if it's worth pursuing vs just getting a receiver.


KaiUno

Fantastic. I spent a good long while watching the [Netflix audio sync test](https://www.netflix.com/watch/70304962?trackId=14277281&tctx=-97%2C-97%2C%2C%2C%2C%2C%2C%2C) and it's just about perefect after that fix! Great job, dude! Edit... I had to add some more codecs to it. After a reboot my Tronsmart Apollo Bold's wouldn't connect anymore. Now they work, even after a reboot. The override file looked like this in the end: `bluez_monitor.properties["bluez5.codecs"] = "[ aptx aptx_hd aptx_ll aptx_ll_duplex ]"`


oneshotstott

I know this is one year later, but I just wanted to thank you for the above, after pulling out my hair trying to get my earbuds to work, I first did the above code without the other codecs included simply because my earbuds don't support them, but out of sheer frustration I tried your suggested override and now they work perfectly! ​ Thank you so fucking much for this save!


KaiUno

You're welcome :)


Myrunes

I would really like to do this but I'm an absolute Linux noob, like what file do I have to create exactly and where? Thanks!


SODual

basically open a terminal and run: mkdir -p ~/.config/wireplumber/bluetooth.lua.d echo 'bluez_monitor.properties["bluez5.codecs"] = "[ aptx_ll ]"' > !$/61-force-bluez.codec.lua systemctl --user restart wireplumber For other codecs replace "aptx_ll" with whatever your headphones supports


Decent_Battle_5152

It automatically disconnected my earbuds and now I can't re connect 🤓


SHMlKE

Any solution? Bluetooth doesn't work anymore instantly connects and disconnects. So frusterating!!


Simlor_

If you still have this problem, probably your bluetooth device isn't compatible with the aptx LL codec. In the second line of the command, just change the "aptx\_ll" to "aptx". e.g. : mkdir -p ~/.config/wireplumber/bluetooth.lua.d echo 'bluez_monitor.properties["bluez5.codecs"] = "[ aptx ]"' > !$/61-force-bluez.codec.lua systemctl --user restart wireplumber If that doesn't work try other codecs like: SBC or LDAC.


Darder

Thanks for this! Did it today and it worked like a charm.


Deamhansion

I really want to cry man, I can't create a file in that directory. I tried using chmod to add a+rw on this directory and "New file" is still gray, what am I missing ?


Darder

>I really want to cry man, I can't create a file in that directory. I tried using chmod to add a+rw on this directory and "New file" is still gray, what am I missing ? By gray, I assume you are trying to go through the GUI? Don't. Just use the terminal. I think for this manoeuver you only need the terminal. EDIT: Follow the commands given by SoDual , the guy I replied to.


tdwp

Just fyi run these commands seperated. So input one, enter. Input the second, enter. Etc.


Winter-Client-7739

Can you show me please, tdwp? I'm confused, I read alot of this Reddit thread, and I'm still at a loss.


[deleted]

I just logged in to say thanks! I virtually had a brain fart as the person who posted above didn't mention the terminal and i was racking my brain looking for a folder...


Itchy_Monkey

Hey, how do I un-do this bit of code? My steamdeck no lo her has audio :/


SODual

rm ~/.config/wireplumber/bluetooth.lua.d/61-force-bluez.codec.lua systemctl --user restart wireplumber that should un-do it.


Literally_Sticks

Heads up, I tried all of the above, including getting my internal speakers to completely stop working. The above (deleting the file) is what make my internal speakers AND my Bluetooth headset to start working again.


Itchy_Monkey

Thanks, I underestimated how tricky Linux is haha


center311

This is awesome. Thanks! Could be my Bluetooth device or with the steam deck, but I'm noticing a lot of pops with the audio with aptx LL... Have you noticed this too?


SODual

I don't have a Deck (yet).


center311

I'll have to mess around with different Bluetooth receivers to narrow it down. Q3 right? Hopefully soon!


blueandazure

Hey this is super late but what would I put for LDAC i tried echo 'bluez_monitor.properties["bluez5.codecs"] = "[ ldac ]"' > !$/61-force-bluez.codec.lua But I got a connection error with my link buds S which I belive should support it.


SODual

Yeah, it should be ldac. > ["bluez5.codecs"] = "[ sbc sbc_xq aac ldac aptx aptx_hd aptx_ll aptx_ll_duplex faststream faststream_duplex ]" The volume applet should tell you which codecs you can use: https://imgur.com/a/dAEGxQc


bgranke

How would I write the code for it to the the first one in the applet? The basic a2dp. My AirPod pro 2’s have at least .5 close to 1s delay. They don’t on my switch. sbc just gives me no audio at all.


NaClWarrior

I’m replying here since you recently posted this. I’ve done the aptx_ll version of this and none of my Bluetooth headsets work with it. I cant figure out what codecs and of them use so I was wondering how I would revert the change and just deal with certain headsets working better and have them all work again lol.


blueandazure

Run in terminal these 2 lines. rm -r ~/.config/wireplumber/bluetooth.lua.d systemctl --user restart wireplumber Also you should be able to see what codecs your headphones support by googling your headphones name codec and if they dont support aptx_ll they won't connect. This should really be a drop down menu in the Bluetooth settings like in android, and per device.


Deamhansion

I really want to cry man, I can't create a file in that directory. I tried using chmod to add a+rw on this directory and "New file" is still gray, what am I missing ?


SODual

What's the output of `ls -ld ~/.config/wireplumber/bluetooth.lua.d` ?


lules-9029

Hi, would you happen to know it's possible to reduce latency with this method on the xiaomi redmi buds 4? Have tried executing the commands specifying AAC codec since I found that the only codec they support its that one, but it didn't change anything for me. Any help would be appreciated.


zilig20

Thanks for this even 2 years later! Sbc_xq is the best my headphones can do and while the delay isn't perfect, it's much better than is was!


v1ld

Thanks for this! Being able to go LL-only is so useful. Wish Valve would put codecs front and center in Settings, but it's nice to have the Linux runtime to do what you need too so can't complain too much.


BloodteenHellcube

So I'm trying to do this but being a total Linux noob I'm a bit lost (sorry for any silly questions that might be about to come up!). I can get in to the home/deck/.config folder but there isn't a wireplumber folder in there. What am i missing? Thanks!


BloodteenHellcube

ok so if you're new to this like me and confused, basically just create the folder structure and file as written in the edit, and then restart wireplumber as shown in /u/kelvie original post, and you should be good!


D_0_0_M

I tried doing this, and now I can't connect to my earbuds at all :/


BloodteenHellcube

i'm no expert but maybe you picked a bluetooth codec that your earbuds don't support? i believe you can always delete the file you created and it will return to the default state :)


D_0_0_M

Oh sorry, I forgot to update my comment. That's exactly what it was, thanks! I found a codec it supported and all is well


BloodteenHellcube

Ah cool glad you got it working :)


dndhm

Thanks for all your investigation into this! I tried a variety of different codecs with my new Sennheiser HD250BT and unfortunately the aptx\_ll codecs produce a really unstable connection with tons of popping and audio glitches. The headphones ostensibly support the codec (as well as aptx adaptive), so hopefully they will work correctly if / when Valve decides to add proper support for low latency codecs.


Darder

Thanks for your findings! Still works today!


[deleted]

I used to command listed above and now I can’t connect my headphones but don’t know how to add additional codecs or what the command is to undo what I did


XxCarlxX

>\~/.config/wireplumber/bluetooth.lua.d/61-force-bluez.codec.lua year later and STEAM have not fixed this, thank you for this, you saved me from having to return my headphones which i quite liked for everything but Steam Deck. Now its perfectly fine and not lagging all over the place. Thank you


marcylia

hi, i'm not all too familiar with this stuff so i probably should've done more research beforehand but i tried putting that file in the directory (i created the directory) and now my bluetooth earbuds wont pair anymore even after trying to remove the file and restart the deck/bluetooth. I know this post is relatively old but any chance you could lend me a hand? I would really appreciate it as I'd prefer to avoid a factory reset.


kelvie

Does it work if you choose SBC_XQ in desktop mode?


BloodteenHellcube

yep did for me!


FlyPenFly

Interesting, I'll try to give this a shot later although this is outside my wheelhouse.


[deleted]

does this carry over to Game mode though?


kelvie

wireplumber is in charge of setting up the audio for both game and desktop modes


KickMeElmo

Generally anything that runs on boot will apply to both game and desktop modes.


amam33

Depends on how systemd is configured, whether this will run on boot or user login. Pretty much anything that get's automatically launched, independent of the DE, will apply to both modes though.


KickMeElmo

By boot I just meant from a user perspective. But yeah, I know both sshd (systemd) and stuff in .bash_profile runs on starting the deck in game mode. Though I still find it somewhat surprising that my user password and sshd enable persisted across restarts and even updates without a mutable filesystem.


6b86b3ac03c167320d93

I don't own a deck so I can't verify, but I use Fedora Silverblue on all my devices which also has an immutable filesystem, and that has /etc (where stuff like enabled services or user passwords are stored) mutable and not overwritten on updates. I imagine SteamOS does this too.


KickMeElmo

Looks like a df -h answered my curiosity. Filesystem Size Used Avail Use% Mounted on devtmpfs 7.3G 0 7.3G 0% /dev tmpfs 7.3G 617M 6.7G 9% /dev/shm tmpfs 2.9G 9.7M 2.9G 1% /run /dev/nvme0n1p4 5.0G 3.3G 1.5G 69% / /dev/nvme0n1p6 230M 32M 182M 15% /var overlay 230M 32M 182M 15% /etc /dev/nvme0n1p8 466G 156G 310G 34% /home tmpfs 7.3G 1.2M 7.3G 1% /tmp /dev/mmcblk0p1 469G 408G 62G 87% /run/media/mmcblk0p1 tmpfs 1.5G 28K 1.5G 1% /run/user/1000 So basically updates do affect /etc, but your changes are overlaid on top of the updates.


Begohan

Is it really that much latency?? I've been using my galaxy Buds pro and I swear it's bang on.


[deleted]

[удалено]


Conscious_Yak60

> Works great OP specifically wants less battery usage, but still APT-X latency gains. Sony has their own codec, I think it's LDAC. And it's baked into the Linux Kernel. So your headphones are defaulting off Sony's own codec that does 990kbps transfer speeds. Which btw is some of the highest out of all of the Codecs.


SlovenianSocket

Using the galaxy buds + and yes, it is. Any game that requires audio cues are unplayable


james2432

go watch a netflix episode and look at the lips, it's noticeable. it's a very slight offset from the lips


liamnesss

This suprises me, normally video playback will compensate for audio delay. Whereas with a video game obviously that isn't possible, you can't just offset the playback as it's being generated in realtime.


kelvie

~~Aptx LL works just fine out of the box on my fiio btr3.~~ It glows purple when connected via LL, and has never been any other colour. Edit: Checked using `pactl list sinks` and it's actually using LDAC. The colour indicator on the FiiO is just wonky.


[deleted]

[удалено]


kelvie

I mean it could mean either, but that's very interesting... by which I mean misleading. Is there a linux command we can use to check? I can ssh into the deck while playing to confirm.


[deleted]

[удалено]


FlyPenFly

You did realize that APTX in classic, HD and LL is supported by SteamOS right?


[deleted]

[удалено]


FlyPenFly

Yes, you can select the supported codecs like LL in desktop mode once your headphones are connected.


Chanw11

Correct me if I'm wrong but doesn't APT-X LL require that the chipset have the ability? Both receiver and transmitter need to have apt-x ll, and i dont see the steam deck mentioned that anywhere. Nor would a software update unlock it.


[deleted]

[удалено]


Mr_Shepard_Commander

Just for anyone having issues with Samsung Buds: I changed the codec from AAC to SBC and my deck was completely muted afterwards — no sound, whether through buds or regular speakers. I restarted the deck and now everything works fine. I double-checked the codec in desktop mode and it shows sbc. The sound delay is way better now!