Alsaequal not working: CAESinkALSA: Slave PCM not usable
#1
Hi,
I'm trying to use the 'alsaequal' plugin to get a simple equalizer for Kodi. So I installed the alsaequal plugin, added the .asoundrc file from [1] and selected the 'equal' PCM device in Kodi's advancedsettings.xml.
However Kodi cannot use the device and outputs the following (see full debug log below):
Code:
DEBUG: CActiveAESink::OpenSink - trying to open device ALSA:equal
INFO: CAESinkALSA::Initialize - Attempting to open device "equal"
INFO: CAESinkALSA::Initialize - Opened device "equal"
DEBUG: CAESinkALSA::SelectALSAChannelMap - Selected ALSA map "FL FR"
INFO: CAESinkALSA - ALSA: pcm_params.c:2162:(snd1_pcm_hw_refine_slave) Slave PCM not usable
INFO: Previous line repeats 6 times.
INFO: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
INFO: CAESinkALSA - ALSA: pcm_params.c:2162:(snd1_pcm_hw_refine_slave) Slave PCM not usable
INFO: Previous line repeats 7 times.
ERROR: CAESinkALSA::InitializeHW - Unable to find a suitable output format
INFO: CAESinkALSA - ALSA: pcm.c:1101:(snd_pcm_drop) PCM not set up
DEBUG: CActiveAESink::OpenSink - trying to open device ALSA:@
INFO: CAESinkALSA::Initialize - Attempting to open device "@"
INFO: CAESinkALSA::Initialize - Opened device "sysdefault"
DEBUG: CAESinkALSA::SelectALSAChannelMap - Selected ALSA map "FL FR"
INFO: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
INFO: CAESinkALSA::InitializeHW - Using data format AE_FMT_S16NE
DEBUG: CAESinkALSA::InitializeHW - Request: periodSize 1024, bufferSize 9600
DEBUG: CAESinkALSA::InitializeHW - Got: periodSize 1024, bufferSize 9216
DEBUG: CAESinkALSA::InitializeHW - Setting timeout to 192 ms
DEBUG: CAESinkALSA::GetChannelLayout - Input Channel Count: 2 Output Channel Count: 2
DEBUG: CAESinkALSA::GetChannelLayout - Requested Layout: FL,FR
DEBUG: CAESinkALSA::GetChannelLayout - Got Layout: FL,FR (ALSA: FL FR)
DEBUG: CActiveAESink::OpenSink - ALSA Initialized:
However playing a file with either
Code:
aplay -D equal somefile.wav
mplayer -ao alsa:device=equal someotherfile.mp3
fully works and shows no errors (both use format S16_LE, if that's relevant).

Kodi shows the same errors when the slave.pcm in .asoundrc is set to 'plug:dmix', 'plug:default' or 'plughw:0,0', or any of them without 'plug'.

When I select 'null' as slave PCM in the .asoundrc file, Kodi can open the 'equal' device (but it plays no sound, of course).
With the 'jack' or 'pulse' plugins as slave.pcm, it somehow creates a feedback loop (as those use ALSA for output again) and outputs a screeching noise when Kodi starts.

This was tested on Arch Linux on both a x86_64 machine (Linux 4.3.3) and a Raspberry Pi 2 (Linux 4.1.15), with Kodi 15.2 and alsa-lib 1.1.0.

Any help would be greatly appreciated. Big Grin

[1] http://www.thedigitalmachine.net/alsaequal.html
[2] Debug log: http://xbmclogs.com/pt2jc5dtr
Reply
#2
Jep - we don't support it.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#3
(2015-12-28, 13:09)fritsch Wrote: Jep - we don't support it.

Hi,
now I don't know what exactly is not supported, but I've solved the problem anyway. There seem to be 2 issues here:
  1. The alsaequal plugin is not working correctly on ARMv7 (it creates a loud shrieking feedback noise).
  2. Alsa's "plug" device can't figure out automatically how to match the audio formats between Kodi, an Alsa plugin and the sound card.
The first issue was solved by using a (LADSPA based) high-pass filter instead of the alsaequal plugin, the second issue was solved by configuring the float <-> integer transition manually in the config file.
The working .asoundrc is as follows, and can be used by configuring the Alsa device "plug:highpass" in Kodi:
Code:
# Based on: https://bbs.archlinux.org/viewtopic.php?id=168026

# Convert float data to integer data
pcm.ladspa_float {
    type lfloat
    slave {
        pcm "hw:0,0"
        format "S16_LE"
    }
}

# High-pass filter.
# Requires "ladspa" for plugin support
# and "swh-plugins" for lpf plugin.
# See http://www.ladspa.org/.
pcm.highpass {
    type ladspa
    slave.pcm "ladspa_float"
    path "/usr/lib/ladspa"
    plugins [
        # Actual high-pass filter functionality.
        {
            label lpf # High Pass Filter (One Pole)
            input {
                controls [ 200 ]
            }
        }
    ]
}
Reply
#4
This is excellent, I am trying to create a similar setup and divert Kodi's audio to the equalizer. Getting problems as Kodi is not seeing the equalizer.

Could you please post your advancedsettings.xml file
Reply
#5
kodi's ALSA enumeration bypasses _all_ plughw devices and enumerates the hw device device itself. Therefore the plughws won't work.
See: https://github.com/xbmc/xbmc/blob/master....cpp#L1186
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#6
(2016-06-06, 02:46)sanjibm Wrote: This is excellent, I am trying to create a similar setup and divert Kodi's audio to the equalizer. Getting problems as Kodi is not seeing the equalizer.

Could you please post your advancedsettings.xml file

Hi sanjibm,
sorry for the late reply. You can force Kodi to use the equalizer/high pass with the following advancedsettings.xml file:
Code:
<advancedsettings>
<audiooutput>
<audiodevice>ALSA:plug:highpass</audiodevice>
</audiooutput>
</advancedsettings>
However it's a bit unstable, when opening the audio menu in Kodi's system settings, it switches back to the Raspi's default audio device.
Reply

Logout Mark Read Team Forum Stats Members Help
Alsaequal not working: CAESinkALSA: Slave PCM not usable0