Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to control connected bluetooth device volume in linux using command? [closed]

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?

like image 785
Murali Perumal Avatar asked Jan 28 '15 11:01

Murali Perumal


People also ask

Can you control volume with Bluetooth?

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.

How do I turn my Bluetooth volume down on my computer?

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.

How do I separate Bluetooth volume?

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.


1 Answers

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.

like image 87
Sean Normandy Avatar answered Oct 11 '22 18:10

Sean Normandy