You are not logged in.

#1 2024-12-20 13:28:06

onedayillmakeit
Member
Registered: 2023-10-28
Posts: 14

[SOLVED] Bluetooth main.conf is ignored – no way to apply settings

Here's my /etc/bluetooth/main.conf file:

[General]
Name = Speakerbox
Class = 0x200428
DiscoverableTimeout = 0
AlwaysPairable = true
PairableTimeout = 0
NameResolving = false
FastConnectable = true
Privacy = off
  1. Any value I put in this file doesn't seem to change anything. In bluetoothctl my system still has the old generic settings

  2. The only way to manage Bluetooth settings is through either bluetoothctl or btmgmt

  3. bluetoothctl saves some settings in the file /var/lib/bluetooth/xx:xx:xx:xx:xx:xx/settings (xx:xx:x... is the mac address) but only two settings are saved: Discoverable=true and Alias=Speakerbox. If I try to add anything below, it just gets deleted on the next run of bluetoothctl

  4. There doesn't seem to be a way to set up my device so others can connect without approval (e.g., like a Bluetooth speaker) because bluetoothctl/btmgmt don't provide such settings.

I’m stuck and unsure what to try next. Any advice would be appreciated!

Last edited by onedayillmakeit (2025-01-05 11:22:31)

Offline

#2 2024-12-20 15:28:17

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,841

Re: [SOLVED] Bluetooth main.conf is ignored – no way to apply settings

Why do you think they are ignored? I'd assume the ones that don't get reflected in the adapter to be global and independent of the BT adapter you have. (or your adapter not supporting any given option)

Maybe clarify what your end goal is? The last point? You want things to be able to connect directly?

Online

#3 2024-12-20 16:03:10

onedayillmakeit
Member
Registered: 2023-10-28
Posts: 14

Re: [SOLVED] Bluetooth main.conf is ignored – no way to apply settings

V1del wrote:

Maybe clarify what your end goal is?

End goal is to have my computer behave as a bluetooth speaker using bluez-alsa. Tested it, audio works, but I have to manually accept the bluetooth pairing requests through bluetoothctl. I want to configure bluetooth so it automatically accepts pairing requests from new devices.

Offline

#4 2024-12-20 16:36:05

seth
Member
Registered: 2012-09-03
Posts: 60,756

Re: [SOLVED] Bluetooth main.conf is ignored – no way to apply settings

https://github.com/Arkq/bluez-alsa ?

https://github.com/arkq/bluez-alsa/wiki … Connecting
Does

bt-device --set <BSSID> Trusted on

work? And should™n't you be using bluealsactl?

Offline

#5 2024-12-20 20:07:01

onedayillmakeit
Member
Registered: 2023-10-28
Posts: 14

Re: [SOLVED] Bluetooth main.conf is ignored – no way to apply settings

seth wrote:
bt-device --set <BSSID> Trusted on

I believe this is if I want BlueALSA host as initiator. My case is the other one - BlueALSA host as responder. The instructions on the link you provided mention this under "BlueALSA host as responder":

bluetoothctl --agent=NoInputNoOutput
default-agent
discoverable on

I see my computer's name on my phone's bluetooth devices and I tap on connect. But then bluetoothctl asks me to authorize a few services. It only works if I respond with yes. Meaning it's still not a solution that can function without user intervention  sad

Offline

#6 2024-12-20 20:42:09

seth
Member
Registered: 2012-09-03
Posts: 60,756

Re: [SOLVED] Bluetooth main.conf is ignored – no way to apply settings

Offline

#7 2025-01-02 16:35:51

onedayillmakeit
Member
Registered: 2023-10-28
Posts: 14

Re: [SOLVED] Bluetooth main.conf is ignored – no way to apply settings

Marking already connected devices as trusted does make reconnection seamless. However, I'm still unable to connect to my Arch Linux device from new, previously unknown devices without intervention. Each time, I have to SSH into my Arch Linux machine and manually trust the device using bluetoothctl.

What I'm aiming for is a setup where any device can connect automatically, without any passcodes, PINs, or user prompts—essentially functioning like a typical Bluetooth speaker.

Offline

#8 2025-01-02 20:36:03

seth
Member
Registered: 2012-09-03
Posts: 60,756

Re: [SOLVED] Bluetooth main.conf is ignored – no way to apply settings

https://unix.stackexchange.com/question … y-connects suggests you need to "agent off" before "NoInputNoOutput"

"hciconfig hci0 noauth", will disable the entire authentication but I don't know whether that gets you "no auth required" or "no auth at all", plus it's deprecated: https://man.archlinux.org/man/extra/blu … .en#noauth

Offline

#9 2025-01-04 17:20:55

onedayillmakeit
Member
Registered: 2023-10-28
Posts: 14

Re: [SOLVED] Bluetooth main.conf is ignored – no way to apply settings

None of those worked so far. It was a long and painful journey, but here are my findings in case someone stumbles upon this thread:

1. There's no way to make arch linux pairable without user intervention (behave as a bluetooth speaker / a2dp sink), because you have to approve a few bluetooth services manually each time. There's no workaround for this without scripting.

2. I found these two agents that can do the job:
https://github.com/spmp/promiscuous-blu … audio-sinc
https://github.com/mill1000/bt-a2dp-agent

I am using the second one (requires python-dbus-fast). After setting it up it is able to approve pairing requests automatically. However, if you "forget" the arch linux machine from your other device, you have to remove the device in bluetoothctl to be able to pair again.

3. If you want to set the device class for your bluetooth device, first open btmon in a second terminal and on the main terminal try

bluetoothctl mgmt.class 4 20

You will see in btmon that 4 20 gives you the necessary device class for Audio device / Loudspeaker. You can try with different numbers and see the results. I couldn't find a way to change the major service class the device advertises itself as.

4. Unreliability - none of this works every time... Especially settings the class, and I absolutely have no idea why it is so unreliable, but this is way beyond my comprehension.

Hopefully all of this helps someone one day.

Last edited by onedayillmakeit (2025-01-05 11:21:56)

Offline

Board footer

Powered by FluxBB