Kodi Community Forum

Full Version: kodi and graphic equalizers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm using kodi 18.4 on a pi 4 with audio going out of the usb port into a dac (NOT a dac attached to the pic directly). The audio options i can choose between within kodi are a little odd as they are a mixture of analog (really? on a usb port?), s/pdif (the pi doesn't have that!) and digital.  But whatever I choose, it works.

But I'd like to use a graphic equalizer and I understand that alsa has one. Unfortunately I just have absolutely no idea how to configure and use.  I've spent a while fiddling around with .asoundrc but I'm not sure what i'm trying to do or how to do it.  I've even read that kodi doesn't use alsa, so maybe even if I got it configured correctly in linux it wouldn't actually work in kodi.

Is there some easy way of getting an equalizer to work on Kodi?
(2019-11-06, 02:22)Troy McClure Wrote: [ -> ]I'm using kodi 18.4 on a pi 4 with audio going out of the usb port into a dac (NOT a dac attached to the pic directly). The audio options i can choose between within kodi are a little odd as they are a mixture of analog (really? on a usb port?), s/pdif (the pi doesn't have that!) and digital.  But whatever I choose, it works.

Post: lsusb and aplay -l  - then we can see if your Linux agrees with your reasoning above. Hint: It won't :-)
(2019-11-06, 09:07)fritsch Wrote: [ -> ]
(2019-11-06, 02:22)Troy McClure Wrote: [ -> ]I'm using kodi 18.4 on a pi 4 with audio going out of the usb port into a dac (NOT a dac attached to the pic directly). The audio options i can choose between within kodi are a little odd as they are a mixture of analog (really? on a usb port?), s/pdif (the pi doesn't have that!) and digital.  But whatever I choose, it works.

Post: lsusb and aplay -l  - then we can see if your Linux agrees with your reasoning above. Hint: It won't :-)   

lsusb:
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0bc2:2343 Seagate RSS LLC 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0d8c:0004 C-Media Electronics, Inc.          <- the DAC uses c-media, I believe 
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


aplay -l:
**** List of PLAYBACK Hardware Devices ****
card 1: G2 [Schiit 4490 G2], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

I disabled the usual pi audio (bcm) via  blacklisting.

For completeness, here's aplay -L:
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=G2
    Schiit 4490 G2, USB Audio
    Default Audio Device
sysdefault:CARD=G2
    Schiit 4490 G2, USB Audio
    Default Audio Device
front:CARD=G2,DEV=0
    Schiit 4490 G2, USB Audio
    Front speakers
surround21:CARD=G2,DEV=0
    Schiit 4490 G2, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=G2,DEV=0
    Schiit 4490 G2, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=G2,DEV=0
    Schiit 4490 G2, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=G2,DEV=0
    Schiit 4490 G2, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=G2,DEV=0
    Schiit 4490 G2, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=G2,DEV=0
    Schiit 4490 G2, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=G2,DEV=0
    Schiit 4490 G2, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=G2,DEV=0
    Schiit 4490 G2, USB Audio
    Direct sample mixing device
dsnoop:CARD=G2,DEV=0
    Schiit 4490 G2, USB Audio
    Direct sample snooping device
hw:CARD=G2,DEV=0
    Schiit 4490 G2, USB Audio
    Direct hardware device without any conversions
plughw:CARD=G2,DEV=0
    Schiit 4490 G2, USB Audio
    Hardware device with all software conversions

I found this link:

88719 (thread)

And using the first .asoundrc snippet I can make changes to the equalizer and then play a wav with aplay and it takes effect but I don't seem to be able to get Kodi to use it.  There's no additional audio output options; the existing ones sound the same as before, and in raspbian itself, preferences/audio device settings/sound card is the same as before and unchangeable, and I still only have pcm as a switch.

It has an effect on youtube, though.
With your lsusb and your aplay you could clearly see that instead what you describe the DAC is directly attached to Linux, means: Linux uses the c-media driver to output, resample, etc. the bits to your external DAC, depending on what you have in kodi.log you get the full range and samplerates or not.

There is limited sense in doing SW equalizer on PC side, if you rely on audiophile quality with your DAC. You need to find something that processes in float and losslessly converts to 24 bit or whatever you had before. An old version of kodi (version 17) had some biquad filters that you can use to implement an equalizer.
(2019-11-07, 10:29)fritsch Wrote: [ -> ]With your lsusb and your aplay you could clearly see that instead what you describe the DAC is directly attached to Linux, means: Linux uses the c-media driver to output, resample, etc. the bits to your external DAC, depending on what you have in kodi.log you get the full range and samplerates or not.

There is limited sense in doing SW equalizer on PC side, if you rely on audiophile quality with your DAC. You need to find something that processes in float and losslessly converts to 24 bit or whatever you had before. An old version of kodi (version 17) had some biquad filters that you can use to implement an equalizer.

Is there a way I can point kodi at the equalizer though? So that normally I listen as-is, but when I need to tweak the treble a little I can do so?   How is Kodi producing the audio output list?
Kodi's output list: https://github.com/xbmc/xbmc/blob/master....cpp#L1079 for ALSA, on the PI it's additionally: https://github.com/xbmc/xbmc/blob/master...i.cpp#L526 - not relevant for your DAC.

Other than that: No. There is currently no such option in kodi. Alternatives are:

- ADSP in older kodi versions v17 and writing a plugin by yourself
- Pulseaudio and using module-equalizer-sink
(2019-11-07, 12:58)fritsch Wrote: [ -> ]Kodi's output list: https://github.com/xbmc/xbmc/blob/master....cpp#L1079 for ALSA, on the PI it's additionally: https://github.com/xbmc/xbmc/blob/master...i.cpp#L526 - not relevant for your DAC.

Other than that: No. There is currently no such option in kodi. Alternatives are:

- ADSP in older kodi versions v17 and writing a plugin by yourself
- Pulseaudio and using module-equalizer-sink

Thanks - switching to Pulseaudio for now.