Volume Control for Chrome Add-On

  • I'm running out of ideas. The person, who knows the answer, is the add-on dev. Most add-on devs are at the Kodi forum. Try it there.

    I believe the "browser.chrome" addon is in the Libreelec repo and was developed by CvH , if I am not mistaken. I will try looking for support at the Kodi forum.

    Thanks again Da Flex

  • Hopefully someone would come along who can give me any pointers on why amixer has no effects on HDMI sound other than mute and unmute.

    The answer is simply that there is no volume control for the IEC958/HDMI outputs. Only the analog outputs have (software) volume control.

    so long,

    Hias

  • I was just talking to him. Unfortunately this is an open issue, and he can't fix it at the moment. Sorry. ?(

    Da Flex, you went above and beyond. Thank you! At least I learned something new.

    The answer is simply that there is no volume control for the IEC958/HDMI outputs. Only the analog outputs have (software) volume control.

    so long,

    Hias

    HiassofT Thank you for the explanation! Just to clarify, is that by design or can that be modified in the alsa config file ?

  • That's the default configuration of the Intel HDA driver. You can of course create another PCM using the "softvol" plugin - see here for details ALSA project - the C library reference: PCM (digital audio) plugins

    In LE use /storage/.config/asound.conf instead of ~/.asoundrc and simply set the slave PCM to the HDMI PCM device you normally use.

    so long,

    Hias

    Hello HiassofT ,

    I tried to get it running all day today but I need a few pointers if that's okay with you.

    When I looked at usr/share/alsa/alsa.conf to try to get the name of the slave PCM, I noticed that alsa set the devices dynamically, so I couldn't find a way to get the name of the device. So, I ran 'amixer' with the following result

    So, I assumed the slave PCM name to be "IEC958,0" since that the only one that muted the volume on my tests, with that in mind, i went ahead and created a new default device in the destination you told me with the name "asound.conf"

    Code
      pcm.!default {
    type softvol
    slave "IEC958,0"
    control.name "hdmi_out" <- I did not name it Master, since Master already exists.
    control.card 0
    }

    I do not see any results following a reboot.

    Can you give me any pointers on what I am missing here.

    Edited once, last by AmandaB (February 27, 2021 at 7:35 PM).

  • It's best to use card names instead of numbers as the latter may change (eg if you plug in a USB audio card).

    Simply run "aplay -L", that will show you the available PCMs with card names - then use the same PCM as you used in kodi. eg here on RPi4 it looks like this:

    Code
    ...
    hdmi:CARD=vc4hdmi0,DEV=0
        vc4-hdmi-0, MAI PCM vc4-hdmi-hifi-0
        HDMI Audio Output
    ...

    "hdmi:CARD=vc4hdmi0,DEV=0" is what you use as pcm and the name after CARD= (vc4hdmi0 in my case) is your card - on intel you'll have multiple devices (DEV=...), one for each HDMI output.

    You can then create .config/asound.conf like this (adapt to your PCM/card):

    This creates a new pcm "myoutput" with a control named "PCM My Volume". The hint is only there so you can check with "aplay -L" if your new PCM is available. It should look like this:

    Code
    LibreELEC:~ # aplay -L
    null
        Discard all samples (playback) or generate zero samples (capture)
    default
        Default Audio Device
    sysdefault
        Default Audio Device
    myoutput
        My Output with softvol
    ...

    A small gotcha is that the new mixer control will only show up after the device has been used once, so to see the new volume control you'll have to first access it. eg:

    Code
    speaker-test -c 2 -t sine -D myoutput

    Then you should see the new mixer in amixer output:

    Code
    LibreELEC:~ # amixer controls
    numid=6,iface=MIXER,name='PCM My Volume'
    numid=5,iface=MIXER,name='PCM Playback Volume'
    numid=2,iface=MIXER,name='IEC958 Playback Default'
    numid=3,iface=MIXER,name='IEC958 Playback Mask'
    numid=1,iface=PCM,name='ELD'
    numid=4,iface=PCM,name='Playback Channel Map'

    In alsamixer and "amixer scontrols" it will show as "PCM My", as it automatically strips "Volume" from the end.

    so long,

    Hias

  • That's great. I am pushing one step forward here.

    Here are the results of aplay -L

    When I first tried to get sound to Chrome. I knew that plughw was to set to plughw:0,3 to work.

    So Card was 0 and device was 3.

    When I tried that from the aplay results, I got no where. I would have Chrome playing audio and speaker-test running without issues.

    However, when I tried

    Code
    hdmi:CARD=PCH,DEV=0

    It worked when Chrome was not playing sound and failed to work when chrome was playing sound. So I figured, this is the right card and device.

    So next, it was time to test amixer volume change. I first ran

    So it was added there. But running

    Code
    amixer -c 0 sset PCM_MyVolume 100% 
    OR 
    amixer -c 0 sset PCM_MyVolume,0 100%
    OR
    amixer sset PCM_MyVolume 100%

    had no effect at all on what Chrome was playing.

    Is there any bindings that I should have done ? I tried rebooting to see if that was the issue, but that has no effect.

  • I have the same issues described here with my HDMI connection and would appreciate a summary of what was done and steps to fix it. I'm a bit confused as to what was entered and where?

    Thanks in advance.

    RD

  • I have the same issues described here with my HDMI connection and would appreciate a summary of what was done and steps to fix it. I'm a bit confused as to what was entered and where?

    Thanks in advance.

    RD

    That took long days to fix. Unfortunately, it was a long time ago (and I am away from my setup right now) so I will try to summarize it as much as I can.

    1- Figure out what is the pcm that Chrome is using. At this stage, you will only be able to mute/unmute Chrome. Use amixer over SSH to test.

    2- Once you figure that out, create a new file here "/storage/.config/asound.conf"

    3- Enter the following in the file (keep in mind that you have to change both the pcm and card parts.

    4- You should reboot first, then in Chrome addon settings, choose your new "myoutput" profile instead of its defaults.

    5- You should be able now to use amixer to control Chrome volume.

    Hope that helps.

  • Thanks so much Amanda. This issue has been a real bummer for the past few years and I had to create a dual boot system just to deal with this one little bug. Glad to know I'm not alone and thanks again for your hard work as well as the devs who made it happen.

    I'll let you know how it works out for me.

    RD

  • I admit I'm clueless here as to which PCM Chrome is using.

    I ran amixer with Chrome running and I get this:

    LibreELEC:~ # amixer

    Simple mixer control 'IEC958',0

    Capabilities: pswitch pswitch-joined

    Playback channels: Mono

    Mono: Playback [on]

    Simple mixer control 'IEC958',1

    Capabilities: pswitch pswitch-joined

    Playback channels: Mono

    Mono: Playback [on]

    Simple mixer control 'IEC958',2

    Capabilities: pswitch pswitch-joined

    Playback channels: Mono

    Mono: Playback [on]

    Simple mixer control 'IEC958',3

    Capabilities: pswitch pswitch-joined

    Playback channels: Mono

    Mono: Playback [on]

    Simple mixer control 'IEC958',4

    Capabilities: pswitch pswitch-joined

    Playback channels: Mono

    Mono: Playback [on]