I am using OSMC 2018.03-2 on a pi2, reinstalled actually yesterday to see if it improved the situation which is that USB audio cracks randomly.
I just acquired a USB DAC (NUPRIME DAC10H). I know it works flawlessly on USB with other sources (PC, NAS). But I bought it to connect it to the pi2.
In Audio setting, I selected ALSA:Nuprime DAC-10 S/PDIF, Best Match, Low quality resampling, resampling bitrate 192kHz, and no or off to all other settings outside of the passthrough HDMI settings.
When in KODI I play a mp3, flac or DSD, from 16/44.1 to 24/192, from my library on the NAS or from Qobuz, the sound is randomly crackling. The DAC displays the right rate (matching source file). As it does not have the capability to display format / bit depth I am not sure when it is 16, 24, or 32. Also it looks like the higher the rate the more often it cracks.
HDMI audio for movies is completely fine
I already tried to add “dwc_otg.fiq_split_enable=0” to cmdline.txt, which did not change anything and the alsa conf from this post, without changes as well
Just executed debug mode for audio module and this is what I can see in the kodi.log when I play a 24/192 flac file:
19:29:24.418 T:1886384896 INFO: CActiveAESink::OpenSink - initialize sink
19:29:24.419 T:1886384896 DEBUG: CActiveAESink::OpenSink - trying to open device ALSA:iec958:CARD=DAC10,DEV=0
19:29:24.419 T:1886384896 INFO: CAESinkALSA::Initialize - Attempting to open device “iec958:CARD=DAC10,DEV=0”
19:29:24.438 T:1886384896 INFO: CAESinkALSA::Initialize - Opened device “iec958:CARD=DAC10,DEV=0,AES0=0x04,AES1=0x82,AES2=0x00,AES3=0x0e”
19:29:24.440 T:1886384896 DEBUG: CAESinkALSA::SelectALSAChannelMap - Selected ALSA map “FL FR”
19:29:24.440 T:1886384896 INFO: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
19:29:24.440 T:1886384896 INFO: CAESinkALSA::InitializeHW - Using data format AE_FMT_S32NE
19:29:24.440 T:1886384896 DEBUG: CAESinkALSA::InitializeHW - Request: periodSize 9600, bufferSize 38400
19:29:24.470 T:1886384896 DEBUG: CAESinkALSA::InitializeHW - Got: periodSize 9600, bufferSize 38400
19:29:24.470 T:1886384896 DEBUG: CAESinkALSA::InitializeHW - Setting timeout to 200 ms
19:29:24.470 T:1886384896 DEBUG: CAESinkALSA::GetChannelLayout - Input Channel Count: 2 Output Channel Count: 2
19:29:24.471 T:1886384896 DEBUG: CAESinkALSA::GetChannelLayout - Requested Layout: FL,FR
19:29:24.471 T:1886384896 DEBUG: CAESinkALSA::GetChannelLayout - Got Layout: FL,FR (ALSA: FL FR)
19:29:24.471 T:1886384896 DEBUG: CActiveAESink::OpenSink - ALSA Initialized:
19:29:24.471 T:1886384896 DEBUG: Output Device : NuPrime DAC-10
19:29:24.471 T:1886384896 DEBUG: Sample Rate : 192000
19:29:24.471 T:1886384896 DEBUG: Sample Format : AE_FMT_S32NE
19:29:24.471 T:1886384896 DEBUG: Channel Count : 2
19:29:24.471 T:1886384896 DEBUG: Channel Layout: FL,FR
19:29:24.471 T:1886384896 DEBUG: Frames : 9600
19:29:24.471 T:1886384896 DEBUG: Frame Size : 8
19:29:24.478 T:1895908096 DEBUG: CActiveAE::ClearDiscardedBuffers - buffer pool deleted
19:29:24.506 T:1410331392 DEBUG: Previous line repeats 1 times.
19:29:24.507 T:1410331392 ERROR: EXCEPTION: XBMC is not playing any file
19:29:24.555 T:1926265344 INFO: PAPlayer::PrepareStream - Ready
19:29:24.555 T:1926265344 DEBUG: PlayFile: OpenFile succeed, play state 1
19:29:24.556 T:1284498176 DEBUG: Thread PAPlayer start, auto delete: false
19:29:24.556 T:1284498176 DEBUG: PAPlayer::Process - Playback started
19:29:24.557 T:1284498176 DEBUG: OnPlayBackStarted: play state was 1, starting 0
19:29:24.659 T:1906307840 DEBUG: Thread JobWorker start, auto delete: true
19:29:24.659 T:1926251264 DEBUG: CAnnouncementManager - Announcement: OnPlay from xbmc
This is what I can gather from alsa utils regarding my DAC:
3) USB Audio Class Digital alsa audio output interface `hw:1,0’
- device name = DAC10
- interface name = USB Audio
- usb audio class = 2 - isochronous asynchronous
- character device = /dev/snd/pcmC1D0p
- samplerates (Hz) = S16_LE:44100,48000,88200,96000,176400,192000,352800,384000
- monitor file = /proc/asound/card1/pcm0p/sub0/hw_params
- stream file = /proc/asound/card1/stream0
Looks like the format “AE_FMT_S32_NE” is not in the list, but I have no idea how I can change that.
Any idea of what is going wrong or how I could debug this?