[SOLVED] Audio output device - 192Khz to 384Khz sampling rates

  • Hi,

    My audio output is set to HD-AMP1 SPDIF (My amp's DAC USB input).

    Sample rate is set to Best match.

    My amp's DAC USB is properly detected, as 384khz capable, see kodi log :

    09:01:48.031 T:140599197644928 NOTICE: Device 5

    09:01:48.031 T:140599197644928 NOTICE: m_deviceName : iec958:CARD=HDAMP1,DEV=0

    09:01:48.031 T:140599197644928 NOTICE: m_displayName : HD-AMP1

    09:01:48.031 T:140599197644928 NOTICE: m_displayNameExtra: S/PDIF

    09:01:48.031 T:140599197644928 NOTICE: m_deviceType : AE_DEVTYPE_IEC958

    09:01:48.031 T:140599197644928 NOTICE: m_channels : FL,FR

    09:01:48.031 T:140599197644928 NOTICE: m_sampleRates : 44100,48000,88200,96000,176400,192000,384000

    09:01:48.031 T:140599197644928 NOTICE: m_dataFormats : AE_FMT_RAW,AE_FMT_S32NE

    09:01:48.031 T:140599197644928 NOTICE: m_streamTypes : STREAM_TYPE_AC3,STREAM_TYPE_DTSHD_CORE,STREAM_TYPE_DTS_1024,STREAM_TYPE_DTS_2048,STREAM_TYPE_DTS_512

    Why is there no option above 192khz in "Limit sample rate" setting ? Is there a way I can overide this (useless) limit ?

    thanks for help

    notes :

    every audio file is streamed properly to DAC/Amp according to its resoltution up to 192khz, higher resolutions files are downsampled because of the above reason.

  • I'm not sure what you are wanting to do. It seems like what you are trying to do is get everything sampled at 384khz, why?

    If you limit the sample rate it will resample everything above, which isn't what you want. Typically the "limit sample rate" option is to set a maximum sample rate, not a minimum.

  • Hi,

    Sorry if I was not clear.

    I want no resampling at all. I have some 384khz audio file, I had like them to be played at their native resolution (384khz) but kodi downsample them to 192khz.

    In Kodi's settings I can't get any higher sample rate limit than 192khz. Why isn't there a 384 option or even "no limit" option ?

    See settings screenshots below (FR), highlighted in yellow is the "limit sample rate" settings I can't overide. As already said, output sample config is set to "best match"

    Thanks

    1504851412.png

    ">

    Edited once, last by SyntaXErroR (September 10, 2017 at 2:02 AM).

  • Because my DAC/AMP displays the actual "received" sample rate from USB.

    Here is a debug :

    dTIQ

    Hi believe this is what I want to overide :

    Code
    08:47:46.651 T:140214724192000    INFO: CActiveAE::ApplySettings - limit samplerate for SPDIF to 192000
  • thanks but as said, above result is with Best match selected.

    Moreover, I have already tried all 3 output options (Best match, Optimized and Fixed) and Kodi request a max sample rate value for all of them. See screenshot.

    So no solution there.

  • Ok apparently 384khz is out of spec for spdif devices. So lets just test by taking kodi out of the equation.

    Please try stopping kodi via ssh, then using speakertest

    Warning that this may blow up your AVR! I take no responsibility.

    Code
    systemctl stop kodi
    speaker-test -D iec958:CARD=HDAMP1,DEV=0 -c 2 -r 384000 -t sine

    and see what alsa reports.

    you can start kodi again by rebooting or

    Code
    systemctl start kodi


    EDIT:

    Is this your device? Marantz CA | HD-AMP1

    If so you need to make sure that you are using the USB type B plug in the back of the receiver. Spdif or the front USB won't support 384khz.

  • Thanks Irusak,

    seems there is something wrong with some command parameters, tried several other options (not pasted below) but no success :

    NUCLibreELEC:~ # speaker-test -D iec958:CARD=HDAMP1,DEV=0 -c 2 -r 384000 -t sine


    speaker-test 1.1.2


    Playback device is iec958:CARD=HDAMP1,DEV=0

    Stream parameters are 384000Hz, S16_LE, 2 channels

    Sine wave rate is 440.0000Hz

    Sample format not available for playback: Invalid argument

    Setting of hwparams failed: Invalid argument


    NUCLibreELEC:~ # speaker-test -D iec958:CARD=HDAMP1,DEV=0 -c 2 -r 48000 -t sine


    speaker-test 1.1.2


    Playback device is iec958:CARD=HDAMP1,DEV=0

    Stream parameters are 48000Hz, S16_LE, 2 channels

    Sine wave rate is 440.0000Hz

    Sample format not available for playback: Invalid argument

    Setting of hwparams failed: Invalid argument


  • got it working : "default:CARD=HDAMP1"

    Below is the error message for 384Khz

    but something else is wrong since I also tried successfully with -r 192000 but DAC/AMP is receiving 48Khz

    384 :

    NUCLibreELEC:~ # speaker-test -D default:CARD=HDAMP1 -c 2 -r 384000 -t sine


    speaker-test 1.1.2


    Playback device is default:CARD=HDAMP1

    Stream parameters are 384000Hz, S16_LE, 2 channels

    Sine wave rate is 440.0000Hz

    Rate set to 384000Hz (requested 384000Hz)

    Buffer size range from 16384 to 131072

    Period size range from 8191 to 8193

    Using max buffer size 131072

    Periods = 4

    Unable to set hw params for playback: Invalid argument

    Setting of hwparams failed: Invalid argument

    192 :

    NUCLibreELEC:~ # speaker-test -D default:CARD=HDAMP1 -c 2 -r 192000 -t sine


    speaker-test 1.1.2


    Playback device is default:CARD=HDAMP1

    Stream parameters are 192000Hz, S16_LE, 2 channels

    Sine wave rate is 440.0000Hz

    Rate set to 192000Hz (requested 192000Hz)

    Buffer size range from 8192 to 65536

    Period size range from 4095 to 4097

    Using max buffer size 65536

    Periods = 4

    was set period_size = 4096

    was set buffer_size = 65536

    0 - Front Left

    1 - Front Right

    Time per period = 5.676804

    0 - Front Left

    1 - Front Right

    Time per period = 5.973334

    0 - Front Left

  • Well, no.

    Result of aplay -L provides my with 2 relevant output :

    default:CARD=HDAMP1

    HD-AMP1, USB Audio

    Default Audio Device


    iec958:CARD=HDAMP1,DEV=0

    HD-AMP1, USB Audio

    IEC958 (S/PDIF) Digital Audio Output

    speaker-test -D default:CARD=HDAMP1 plays everything at 48khz for -r <= 192000 and then fails to play for -r >192000 (error message above)

    speaker-test -D iec958:CARD=HDAMP1 fails to play, whatever -r value

  • Thanks but I just got it fully working now, from 44.1 up to 384Khz. (incl. 352.8 Khz)

    And guess how ? by applying exact same solution I suggested 3 years ago on openelec when I had crackling sound issue with a previous DAC !

    I just remebered and found my old post, here it is if it helps ("Ykar"'s post #9).

    OpenELEC Mediacenter - OpenELEC Forum - USB DAC - OE 4.0 resamples everything to 48kHz? (1/1)

    But in short, asound.conf with below content, and selecting the "new" available audio output in Kodi audio settings.

    pcm.device{
    type hw

    card 2
    device 0

    }
    pcm.!default{

    type plug

    slave.pcm "device"

    }

    Edited once, last by SyntaXErroR (September 9, 2017 at 12:24 PM).