Let's say I have paired and connected a Bluetooth headset successfully to my Linux system.
I know I can check my Bluetooth device MAC id from the bluetoothctl
command.
Is there a way to control the Bluetooth device volume using some commands in Linux?
Volume control from PhoneChange the volume from the phone and volume will change in the connected Bluetooth device. No need to do anything at the connected device level.
Look for your Bluetooth headset listed under the Devices category, right click on it and select "Control". This brings up the "Bluetooth Device Control" screen. On it is a button labeled "Connect". Click the Connect button and you will then be able to see that the volume control is now connected to your headphones.
You can disable Android's Bluetooth absolute volume feature, which makes the phone's and a Bluetooth device's volume work together. Bluetooth Absolute Volume is enabled on an Android device by default. To disable it, turn on Developer options in the Settings app, then disable the feature in the System setting menu.
With this method, you need the appropriate D-Bus object path for the device to be controlled. There are a few ways of finding that (like using D-Feet), but once you have it, the following command will adjust the volume:
dbus-send --print-reply --system --dest=org.bluez /org/bluez/xxxx/yyyy/dev_zz_zz_zz_zz_zz_zz org.bluez.Control.VolumeUp
where "xxxx" seems to be the PID for bluetoothd, "yyyy" is the adapter (like "hci0"), "zz_zz_zz..." represents the MAC address of the controlled device (headset, speakers, etc.) separated by underscores, and 'VolumeUp' is replaced with 'VolumeDown' to decrease volume.
See the D-Bus documentation for more helpful on properly finding the object path. To do more than just adjust the volume, see the Bluez API documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With