You are not logged in.

#1 2017-01-30 10:05:54

digitalone
Member
Registered: 2011-08-19
Posts: 328

ALSA equalizer config in Wiki is not working with Flash content

Hi everyone. I need equalizer to get a better sound on my sound card and installed alsaequal from AUR.
Before you ask me, no, I don't have pulseaudio and don't want to install it because alsa is enough and don't need another layer on it.
Anyway, I noticed and odd behaviour.

The custom configuration suggested on Wiki to get equalizer working properly is the following:

ctl.equal {
    type equal;
}

pcm.plugequal {
    type equal;
    slave.pcm "plug:dmix";
}

pcm.!default {
    type plug;
    slave.pcm plugequal;
}

As you can see, default sound card is redefined to use equalizer plugin as a slave. And successively equalizer uses software mixing plugin as a slave to mix sound from multiple sources (I need it because my sound card does not support hardware mixing).

This works on all software except flash content in the web browser. HTML5 content works too, the only problem is flash content. When I watch a video, the audio is mute and from console a can see the following errors:

ALSA lib pcm.c:8481:(snd_pcm_set_params) Unable to set hw params for PLAYBACK: Argomento non valido
ALSA lib pcm.c:8481:(snd_pcm_set_params) Unable to set hw params for PLAYBACK: Argomento non valido

I think the problem is the one specified on the Wiki: "if you have a x86_64-system and are using a 32bit-flashplugin the sound in flash will not work. You have to disable alsaequal or build alsaequal for 32bit".

But after some researches and many tries, looking here (point #6), I found this configuration:

pcm.dmixer {
    type dmix
    ipc_key 2048
    slave {
        pcm "hw:0,0"
        buffer_size 8192 
    }
}

ctl.equal {
    type equal;
}

pcm.equalizer {
    type equal
    slave.pcm "plug:dmixer"
}

pcm.!default {
    type plug
    slave.pcm equalizer
}

And it works! I can play sound from flash content and software mixing works if I play from other sources at the same time.

Another strange thing is that it doesn't work if I don't specify buffer_size as in the following syntax:

pcm.dmixer {
    type dmix
    ipc_key 2048
    slave {
        pcm "hw:0,0"
    }
}

The errors are the same as shown above.

But I tried this syntax (that is specific to my hardware) in which buffer_size is not mentioned:

pcm.dmixer {
    type dmix
    ipc_key 2048
    slave {
        pcm "hw:0,0"
        format S32_LE
        channels 2
        rate 48000
    }
}

and it works on everything!

Can someone explain me why this behavior?
And is it the case to change the configuration on the Wiki with the one shown above that works with flash content too? Even if it provides to specify the hardware to play, for example, if I want to play on HDMI, I have to change pcm line with pcm "hw:1,3".

Offline

#2 2017-01-30 17:00:39

digitalone
Member
Registered: 2011-08-19
Posts: 328

Re: ALSA equalizer config in Wiki is not working with Flash content

Well, I added this configuration in the Wiki. smile

Offline

Board footer

Powered by FluxBB