USB Audio - Creative Soundblaster X-FI 5.1 - no 5.1 surround sound, only stereo

  • Hi,

    I have the last development version of Libreelec right now (20190906173149-60568a1 9.80) for s905, but the issue is the same even for the stable one (i have tried stable coreelec and it is the same as well).

    When USB Sound card is connected, i could not see all the options related to the audio card, only default (@) and surround21, although when I tried aplay -L I got surround51 as well:

    LibreELEC:~ # aplay -L 

    null 

    Discard all samples (playback) or generate zero samples (capture) 

    sysdefault:CARD=AMLGX 

    AMLGX, 

    Default Audio Device 

    hdmi:CARD=AMLGX,DEV=0 

    AMLGX, 

    HDMI Audio Output 

    sysdefault:CARD=Pro 

    SB X-Fi Surround 5.1 Pro, USB Audio 

    Default Audio Device 

    front:CARD=Pro,DEV=0 

    SB X-Fi Surround 5.1 Pro, USB Audio 

    Front speakers 

    surround21:CARD=Pro,DEV=0 

    SB X-Fi Surround 5.1 Pro, USB Audio 

    2.1 Surround output to Front and Subwoofer speakers 

    surround40:CARD=Pro,DEV=0 

    SB X-Fi Surround 5.1 Pro, USB Audio 

    4.0 Surround output to Front and Rear speakers 

    surround41:CARD=Pro,DEV=0 

    SB X-Fi Surround 5.1 Pro, USB Audio 

    4.1 Surround output to Front, Rear and Subwoofer speakers 

    surround50:CARD=Pro,DEV=0 

    SB X-Fi Surround 5.1 Pro, USB Audio 

    5.0 Surround output to Front, Center and Rear speakers 

    surround51:CARD=Pro,DEV=0 

    SB X-Fi Surround 5.1 Pro, USB Audio 

    5.1 Surround output to Front, Center, Rear and Subwoofer speakers 

    surround71:CARD=Pro,DEV=0 

    SB X-Fi Surround 5.1 Pro, USB Audio 

    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers 

    iec958:CARD=Pro,DEV=0 

    SB X-Fi Surround 5.1 Pro, USB Audio 

    IEC958 (S/PDIF) Digital Audio Output

    surround sound is working when testing using speaker-test:

    LibreELEC:~ # speaker-test -c 5 -d surround51:Pro 


    speaker-test 1.1.9 


    Playback device is default 

    Stream parameters are 48000Hz, S16_LE, 5 channels 

    Using 16 octaves of pink noise 

    Rate set to 48000Hz (requested 48000Hz) 

    Buffer size range from 96 to 87381 

    Period size range from 48 to 43690 

    Using max buffer size 87380 

    Periods = 4 

    was set period_size = 21845 

    was set buffer_size = 87380 

    Plug PCM: Route conversion PCM 

    Transformation table: 

    0 <- 0 

    1 <- 1 

    2 <- 4 

    3 <- 5 

    4 <- 2 

    5 <- 3 

    Its setup is: 

    stream : PLAYBACK 

    access : RW_INTERLEAVED 

    format : S16_LE 

    subformat : STD 

    channels : 5 

    rate : 48000 

    exact rate : 48000 (48000/1) 

    msbits : 16 

    buffer_size : 87380 

    period_size : 21845 

    period_time : 455104 

    tstamp_mode : NONE 

    tstamp_type : MONOTONIC 

    period_step : 1 

    avail_min : 21845 

    period_event : 0 

    start_threshold : 87380 

    stop_threshold : 87380 

    silence_threshold: 0 

    silence_size : 0 

    boundary : 1431633920 

    Slave: Hardware PCM card 1 'SB X-Fi Surround 5.1 Pro' device 0 subdevice 0 

    Its setup is: 

    stream : PLAYBACK 

    access : MMAP_INTERLEAVED 

    format : S16_LE 

    subformat : STD 

    channels : 6 

    rate : 48000 

    exact rate : 48000 (48000/1) 

    msbits : 16 

    buffer_size : 87380 

    period_size : 21845 

    period_time : 455104 

    tstamp_mode : NONE 

    tstamp_type : MONOTONIC 

    period_step : 1 

    avail_min : 21845 

    period_event : 0 

    start_threshold : 87380 

    stop_threshold : 87380 

    silence_threshold: 0 

    silence_size : 0 

    boundary : 1431633920 

    appl_ptr : 0 

    hw_ptr : 0 

    0 - Front Left 

    1 - Front Right 

    2 - Unknown 

    3 - Unknown 

    4 - Unknown 

    Time per period = 11.868019 

    0 - Front Left 

    1 - Front Right 

    2 - Unknown 

    3 - Unknown 

    4 - Unknown 

    Time per period = 13.657329 

    0 - Front Left 

    ...

    althoug there is missing label for 2nd,3rd and 4th speaker (dont know why)

    I have tried to add default ALSA card as surround51:Pro to the asound.conf:

    LibreELEC:~ # more /storage/.config/asound.conf 

    pcm.!default { 

    type plug 

    slave.pcm { 

    @func getenv 

    vars [ ALSAPCM ] 

    default "surround51:Pro" 

    channels 6 

    }

    After that I can see one more default ALSA card in the Libreelec Audio options, but still no 5.1 surround sound, only left and right speaker plays the music:

    When i speaker-test-ed default card, the test is successful as well and all 5 speakers works as expected:

    LibreELEC:~ # speaker-test -c 5 -d default 


    speaker-test 1.1.9 


    Playback device is default 

    Stream parameters are 48000Hz, S16_LE, 5 channels 

    Using 16 octaves of pink noise 

    Rate set to 48000Hz (requested 48000Hz) 

    ...

    boundary : 1431633920 

    appl_ptr : 0 

    hw_ptr : 0 

    0 - Front Left 

    1 - Front Right 

    2 - Unknown 

    3 - Unknown 

    4 - Unknown 

    Time per period = 11.863601 

    0 - Front Left 

    1 - Front Right 

    2 - Unknown 

    3 - Unknown 

    ...

    I have tried fixed 5.1 speakers config in Libreelec Audio options and upmixing stereo switch as well. Nothing helped.

    Is there anything else I can try? How can I achieve to have surround51 option in the Libreelec audio selection box as there is surroun21 option right now.

    The card is definitely capable of 5.1 and system, because of successful speaker-test.

    Why there is no surround51:CARD=Pro item in the audio options in Librelec (and several other options as well)?

    Thanks for any hints.

    Edited 2 times, last by fcela (September 9, 2019 at 11:31 AM).

  • Is there any advise how to map channels explicitly to the speakers positions in asound.conf?

    Something like:

    pcm.mychannels51 {
    @args.0 SLAVE
    @args.SLAVE {
    type string
    default "surround51"
    }
    type route
    slave {
    pcm $SLAVE
    channels 6
    }
    ttable {
    0.0= 1
    1.4= 1
    2.5= 1
    3.2= 1
    4.1= 1
    5.3= 1
    }
    } thanks.

  • Hi!

    If anyone is still looking for a solution in 2023, I have the same USB sound card and i had a similar issue on Libreelec 10.0.3 on a Raspberry Pi 4. I traced it back to the erroneous detection of the sound card channels and i was able to fix it by creating a custom channel mapping.

    Just create a file named asound.conf in /storage/.config/ with the following content:

    pcm.myoutput {

    type hw

    card "Pro"

    chmap [ "FL,FR,FC,LFE,SL,SR" ]

    channels 6

    hint.description "my output with fixed chmap"

    }

    Then select the output in Kodi in Settings -> System -> Audio. It will be the one with the strange incomplete name.

    I haven't tested it too much but it seems to work.