4

I have Raspberry PI 3 with HifiBerry running with OSMC:

$ cat /proc/version
Linux version 4.4.27-5-osmc (root@vero2a) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 SMP PREEMPT Tue Nov 22 02:23:12 UTC 2016

I've had no problems with that configuration until recently. Working asound.conf:

pcm.!default {    
  type hw card 0  
}                 
ctl.!default {    
  type hw card 0  
}

With that config I can select ALSA output device in OSMC Settings / System / Audio output.

Recently I've tried to add equalizer to my ALSA driver. I've installed equal plugin as mentioned on this page:

$ sudo apt-get install -y libasound2-plugin-equal

Then I've edited my asound.conf file to make use of that plugin:

pcm.plugequal {
  type equal;
  slave.pcm "plughw:0,0";
}

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

ctl.!default {
  type hw card 0
}

After reboot, I can play sound with aplay and it works fine using the equalizer plugin. Unfortunately, now OSMC (Kodi) does not list my ALSA device anymore, leaving me with those default ones (HDMI, Analogue, HDMI and Analogue).

Why Kodi does not recognize ALSA output device anymore? What to do to fix that?


Edit I even tried to dumb down the asound.conf file to this:

pcm.!default {
  type equal;
  slave.pcm "plughw:0,0"
}

But this doesn't seem to change anything: aplay still works, but Kodi doesn't list the device...

  • Does anyone has some idea how to fix this problem? – Archie Dec 21 '16 at 19:10
1

I recently faced a similar problem to this (using alsaequal with a USB sound card). It seems that Kodi is sensitive to the floating point input/output of that plugin, even if the hardware can handle it.

The solution is to explicitly slave the output of alsaequal to an lfloat plugin, and specify a non-float format (probably signed 16bit little endian). Then slave that to plughw (or hw if you're sure it's compatible).

pcm.plugequal {
  type equal

  slave.pcm {
     type lfloat
     slave {
       # the final output plugin
       pcm "plughw:DAC,0"

       # a compatible format
       format "S16_LE"
     }
  }
}

Note that Kodi doesn't seem to name the ALSA device if you nest the slave (it should show up as plug equal), but if you extract it, it does, like so:

pcm.pluglfloat {
  type lfloat 

  slave {
     pcm "plughw:1,0"
     format S16_LE
  }
}

pcm.plugequal {
  type equal

  slave.pcm "pluglfloat"
}
0

According to that document you have linked to the asound.conf should be:

pcm.!default {
  type plug
  slave.pcm plugequal;
} 
ctl.!default {
  type hw card 0
}
ctl.equal {
  type equal;
}
pcm.plugequal {
  type equal; 
  slave.pcm "plughw:0,0";
}
pcm.equal {
  type plug;
  slave.pcm plugequal;
}

So it would seem you are missing a couple of blocks, which if my shaky understanding of things go, may be related to the things you are missing...

  • Even when I copy those settings into asound.conf, Kodi still does not list the device. – Archie Dec 26 '16 at 13:32
0

For anyone interested, i've found a fix using dmix. For example, if you want to use alsaequal plugin, go for dmix:

ctl.equal {
type equal;
}

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

pcm.equal{
type plug;
slave.pcm plugequal;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.