Kodi Community Forum

Full Version: [Linux] is that possible to remap XBMC master volume action?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I notice that XBMC has its internal audio mixer and I cannot figure out how to remap the volume action "up and down" to the alsa PCM volume instead.
You could ask me why? Because I think that XBMC is cutting some frequencies with volume less than the maximum. I know it's hard to explain in a language not mine, with an example:

CONFIGURATION 1:
- XBMC volume 50%
- ALSA PCM volume 100%
overall volume is then, just for example, 50db.
CONFIGURATION 2:
- XBMC volume 100%
- ALSA PCM volume 50%
then the overall volume decibel is the same in both configuration, 50db.

Well, with the same volume level (50db) with CONFIGURATION 2 I can hear that the sound is fuller (especially at low frequencies) than in CONFIGURATION 1, so I concluded that the XBMC mixer is cutting some frequencies. Another shortcoming is that the volume curve of XBMC seems not to be linear but logarithmic, up to 85% volume decibels grows very slow and then quickly climb in the range between 85% and 100% (so if for example my speakers can go from 0 to 100db until 85% the volume level is 30db). With alsa PCM volume instead the curve is linear.
So my intention was to leave the XBMC mixer volume at 100% and vary the alsa PCM volume instead with volume up and down XBMC actions. I think I can do it by removing the reference to the volume in Lircmap.xml and drive the volume externally with irexec, but in this manner I lose the osd volume feedback. I hope I was clear and sorry for my google translate english
(Eek)
Anyone that can point me in the right investigation route? :confused2:
after a deep research finally I found that I'm not alone (Rofl)... http://forum.xbmc.org/showthread.php?tid=61819, and my post seems to be an answer to lcapriotti (http://forum.xbmc.org/showpost.php?p=439970&postcount=6). It seems nothing can I do without writing the necessary code. Angry
Ok, now I can control my system volume rather than the xbmc volume without the feeling that "the xbmc mixer cutting off frequencies" with the following steps:
1. Turned at 100% volume in xbmc then exited from xbmc (so the volume is stored for next startup)
2. edited (or created if none is present) ~<xbmc_user>/.lircrc and added:
Code:
begin
        prog=irexec
        remote=devinput
        button=KEY_VOLUMEUP
        config=amixer -q -c 0 sset PCM 1+
        repeat=1
        delay=5
end

begin
        prog=irexec
        remote=devinput
        button=KEY_VOLUMEDOWN
        config=amixer -q -c 0 sset PCM 1-
        repeat=1
        delay=5
end
3. Modified in ~<xbmc user>/.xbmc/userdata/Lircmap.xml the two lines
Code:
<volumeplus>KEY_VOLUMEUP</volumeplus>
<volumeminus>KEY_VOLUMEDOWN</volumeminus>
in
Code:
<volumeplus>KEY_VOLUMEUP[b]_DISABLED[/b]</volumeplus>
<volumeminus>KEY_VOLUMEDOWN[b]_DISABLED[/b]</volumeminus>
to disable xbmc volume
4. finally added in /etc/rc.local the execution of irexec at system boot adding the line
Code:
su - <xbmc_user> -c irexec -d

Done, now when XBMC is running I can change system volume but with this method I've lost the OSD feedback.

Looking for a pure XBMC solution with the execution of personal scripts with XBMC.RunScript, I see that with this method I've a lot of lag while changing volume (I've also opened in a console alsamixer to see the volume bar behavior) so I reverted to irexec solution that works better.

At the end I tried the XBMC.notification instruction to print out the current volume when xbmc catch the volume keys, but I can't set a timeout less than 1 second and if I hold down the volume button the osd remains on screen for too long (number of volume change x 1 sec may results in an OSD displaying for more than one minute).
Any suggestions for improving the OSD situation?
Sorry to revive this old thread, but I have a related problem; I get a weird static/popping noise if XBMC's volume is set too low. See http://forum.xbmc.org/showthread.php?tid=117260

I think I can hear what you mean about the sound "fullness" if I don't use XBMC's software mixer, but its kinda subjective and hard to describe. However, I can /definitely/ record the popping/static noises I'm getting.
adq_uk Wrote:Sorry to revive this old thread, but I have a related problem; I get a weird static/popping noise if XBMC's volume is set too low. See http://forum.xbmc.org/showthread.php?tid=117260

I think I can hear what you mean about the sound "fullness" if I don't use XBMC's software mixer, but its kinda subjective and hard to describe. However, I can /definitely/ record the popping/static noises I'm getting.

I don't have a solution but am wondering why people don't just keep their system volume alone and map the remote's volume button to control the TV/AMP instead of XBMC or system volume. Most modern remotes either have a bypass mode or can learn from another remote.
there are still analog people out there Big Grin
I have this problem too.....