Bug XBMC does not respect audio levels in pavucontrol (Pulseaudio)
#1
Bug 
Hi everyone,

The setup:
I have installed XBMC onto Lubuntu 14.04 (I chose lubuntu 14.04 full install instead of XBMCbuntu for several reasons).

I use Pulseaudio instead of ALSA because I wanted to have sound from both my TV speakers as my bluetooth speakers and it seemed to be easier to setup. So I installed pulseaudio and pavucontrol, set up the bluetooth speakers using the Wifi+Bluetooth module installed in my NUC and also combined the 2 audio outputs into one sink using the guidelines on the wiki.

These bluetooth speakers (Logitech Z600) are pretty loud, so in Pavucontrol, I lowered the audio volume to 70% on the bluetooth speakers alone. The HDMI output remained at 100%. I tested this using a youtube video in Google Chrome and could indeed hear that the audio from the speakers was lower than from the TV.

You can see my setup in pavucontrol below. Don't mind the terminal window (also don't mind that the simultaneous output is at 105%, I also tested this with 100%):
Image

The problem:
It seems that XBMC does not acknowledge the levels I set in pavucontrol. When I started to play music in XBMC, it was much louder than anticipated.

The problem is NOT caused by the audio files themselves, because when I set XBMC to a windowed mode, play a song and then click on the audio level meter in pavucontrol to adjust the volume of the bluetooth speakers to 70%, suddenly the volume of the audio in XBMC drops significantly (so only then XBMC adjusts the audio output to match the 70% limit in pavucontrol.

So only after I put XBMC in a windowed mode, opened pavucontrol and "adjust" the volume (by 1 % f.e.), the volume of the bluetooth speakers is ok.

Seems like a bug to me, but it could be that I installed something wrong Confused.

Lubuntu 14.04
XBMC 13.0
Intel NUC with Intel 7260 Wifi + Bluetooth Module
Logitech Z600 (Bluetooth) and Samsung Smart TV (HDMI)
Reply
#2
Provide xbmc.log

I sync volumes whenever xbmc volume changes. PA fetches volume levels from a database per program (e.g. stream name). It does not touch / change output volume directly, it only changes stream.

Edit: Turn on debug logging and you will see what I said above. Search for "Restored Stream value to xy".

So in short: global volume is of no interest for us, we only check our xbmc stream, which is maintained ( you can see that in pavucontrol).
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#3
Hi fritsch!

My apologies for the late response...

My XBMC.log: http://pastebin.com/2iRJZSqq

I see that XBMC creates it own stream, but what I also see in the log is that in order to create that stream it needs to connect with the sink that has been enabled in settings. For my setup: that's sink 1, or the combined sink. Sink 0 is the HDMI output and Sink 2 is the bluetooth output.

In connecting with that sink, I think XBMC doesn't read the audio level that that sink is set at and just sets it at 100 %, while in fact, the sink has been set at an audio level of 60%.

After XBMC has started up, when I change the audio volume of the combined sink to the SAME volume as it was already set (60%), I can hear the output from XBMC considerably drop (while I have changed nothing in XBMC's internal volume control).

This behaviour is only visible in XBMC... Other programs (chromium f.e.) do respect the original audio volume set in pavucontrol.

What I do now as a "half-baked" solution is that I made a script that runs AFTER XBMC startup:

Code:
pactl set-sink-volume 1 0x9900

Pactl is just the command line version of pavucontrol, and I ask it to set the volume of the combined sink to 60% instead of me grabbing a mouse and keyboard and setting it through the GUI.

But still... weird that I have to do that and that it only affects XBMC Confused...
Reply
#4
xbmc does at no point change the levels of the sink, it only ever changes the volume of the stream.

PA has a database, where it saves the "last volume level" that a specific client program has used last and on start of that program it resets the sink to the original value - I cannot do anything about it.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#5
That's all I do:
Quote:22:28:26 T:140696032274176 DEBUG: Restored Stream value to 0.511098

Edit:
I try again:

Sink volume -> global volume
Stream volume -> value between 0 and 100%

In combination with the real sink it is used "internall in PA": sinkvolume * streamVolume -> output you hear.

Xbmc does at no point touch the value that the sink has. This would only(!) happen, if you configured your PA Server to have "flatten volumes" which is out of standard.

Edit2: When you change the xbmc volume (with pavucontrol) does that change your sink volume, too?
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply

Logout Mark Read Team Forum Stats Members Help
XBMC does not respect audio levels in pavucontrol (Pulseaudio)0