Bluetooth volume adjust doesn't work

  • FYI: I'm pretty noobish.

    I'm running Libreelec with Kodi on a raspberry Pi4. I've installed a skin called CarPc-Carbon-K19, to use this as a head unit in my truck. I've paired my iPhone and manually configured pulseaudio sink to the Pi audio jack, and pulseaudio source as my bluetooth phone stream (that I paired in Libreelec). I got a script working that automatically sets my phone as the source whenever it connects to bluetooth. That's all slick and good. But, I can't control the volume of the bluetooth audio. Kodi CarPC controls the volume of it's music and movies, etc. But I have no way to control the audio of the bluetooth stream. Changing the volume in Kodi or on my phone does nothing. Any thoughts on how to be able to adjust the volume of the bluetooth audio via Kodi CarPC volume control or phone volume control, or something?

    Edited 2 times, last by Proximo737 (October 7, 2021 at 7:35 PM).

  • If you set the audio device in Kodi to the pulseaudio device (there will only be one) it may work to change the volume in kodi (not 100% sure about this).

    otherwise you can setup some scripts and button mapping to use:

    pactl set-sink-volume <pa-device-name> +5%

    pactl set-sink-volume <pa-device-name> -5%

  • Ok, so I've found that the main issue is that all volume control in Kodi only changes the volume for Kodi stuff, like the player etc. What I had to do is to edit the includes.xml file for the skin volume buttons.

    Instead of "<onclick>VolumeUp</onclick>"

    I changed it to "<onclick>System.Exec(/storage/scripts/volup.sh)</onclick>"

    This allowed me to write a tiny script to change the overall system volume by a percentage (ie 5%) and leave the Kodi volume alone at 100%. This way I can change the volume of any and all audio leaving the RPi4 audio jack or addon audio card.

    I used these in my volume script:

    otherwise you can setup some scripts and button mapping to use:

    pactl set-sink-volume <pa-device-name> +5%

    pactl set-sink-volume <pa-device-name> -5%

    ThanX Irusak for that idea! I couldn't make use of the pulseaudio output setting in Kodi, as my bluetooth is a separate straight through command line script for pulseaudio to auto route a connected bluetooth device (source) to play audio out of the audio jack (sink).

    This doesn't give me volume control from my phone, but at least I have a universal consistent volume control for the system. That is very necessary and good enough for me!

    On a side not Kodi remembers the volume of the system on reboot, so I included a line in the autostart.sh to set the volume very low on each start-up.

    I'll check into the Kodi remote app later, but would rather not be switching apps to change volume.

  • Hi Proximo737. The reason why volume adjustment doesnt work via bluetooth is because the used version of PulseAudio doesnt support Flat Audio. With the latest version, it is supported. See the release notes: https://www.freedesktop.org/wiki/Software/…pabsolutevolume

    I dont know when PA15 ends up in LibreElec. I hope quicklly.

    If you had an Android device you could disable Bluetooth Absolute Volume in the Developer options, after which you can control volume again. but the proper fix is in Pa15.

  • Dear Proximo737 ,

    will you share the modification to the file includes.xml you have done? Where is ti located? Is this skin dependant?

    I also would like to have a control on LibreElec Volume and not on the Kodi Volume through the Kodi interface and your soultion seems to do exactly that.

    Thanks for your support.

    Andrea