Customise downmix

  • I use a 2.0 audio amp pluged to my NUC's USB port with LE dev build 921 (generic).

    I really whish I could tweak the way movie's audio (5.1, 7.1, etc.) is downmixed to output speakers config, mainly adding some LFE (currently discarded) and playing with surround phase and levels.

    Unfortunatly I can't find solution for that,

    As I understand AudioDSP seems in between life and death and not included anymore. I've tried tweaking asound.conf with type route and ttables with no success and I've read about adding code to ActiveAEResampleFFMPEG.cpp (av_opt_set_double(m_pContext, "lfe_mix_level", 1.0, 0)but I can't even find that file in LE.

    Is there any proper way to achieve that ?

  • ActiveAEResampleFFMPEG.cpp is part of Kodi (going by the name) so you'd have to "patch" Kodi sources at build time and create your own custom image. There are instructions on self-building in the wiki. There are no other current options. AFAIK the ADSP work should reappear in Leia, though that is still some way off.

  • Thanks Chewitt, I feared that answer, now I feel like I need to use a tank to blow a mosquito...

    I'm not familiar with Kodi/LE audio processing architechture, what is ActiveAE reponsible for (Kodi audio processing ?) and what's Alsa responsible for (Driver layer ?).

    Is there a chance if I persist with custom asound.conf ?

    As I understand I need to create new virtual slave device, creat new channel's route using that device. I then expect to have this new route/device available as an output into kodi, but nothing show up, still the same old output device list (HDMI, AMP Analog, AMP iec958).

  • So, I achieved to create new ALSA device : new plug using new route (8 channels mapped to 2) using existing HW, namely the Amp.

    It seems properly detected as 8 channels device :

    22:10:33.912 T:139735173458048 NOTICE: Device 1

    22:10:33.912 T:139735173458048 NOTICE: m_deviceName : CustomDmix

    22:10:33.912 T:139735173458048 NOTICE: m_displayName : HD-AMP1 ()

    22:10:33.912 T:139735173458048 NOTICE: m_displayNameExtra: Analog

    22:10:33.912 T:139735173458048 NOTICE: m_deviceType : AE_DEVTYPE_PCM

    22:10:33.912 T:139735173458048 NOTICE: m_channels : FL, FR, BL, BR, FC, LFE, SL, SR

    22:10:33.912 T:139735173458048 NOTICE: m_sampleRates : 44100,48000,88200,96000,176400,192000,384000

    22:10:33.912 T:139735173458048 NOTICE: m_dataFormats : AE_FMT_S32NE

    22:10:33.912 T:139735173458048 NOTICE: m_streamTypes : No passthrough capabilities

    It can be selected as an audio output into Kodi settings, where I've also set number of channels to 7.1

    BUT audio test files in Kodi, or speaker-test -D CustomDmix -c 8 -t sine seems to keep using only 2 channels :

    Time per period = 21.848475

    0 - Front Left

    2 - Front Left

    4 - Front Left

    5 - Front Left

    6 - Front Left

    7 - Front Left

    3 - Front Right

    1 - Unused

    keep digging