Problem with USB DAC on OSMC RC

Hello,

I’m trying to run the following setup:
-Raspberry pi model B v1
-M-Audio Audiophile USB
-OSMC RC (latest as of today)

The USB DAC is recognized and I can select it in the system settings. However, whenever a sound is supposed to be played, all the gets output is (loud) white noise.

The DAC itself seems to be working fine- on x86-based Linux systems (alsa/pulseaudio) as well as on Volumino on the pi (i.e. on the very same machine/power supply/SD card, empty asound.conf). Hence I think there is a software problem somewhere.

Is there a difference in how USB DACs are accessed in OSMC/Kodi from other systems? I hope this is a known problem, so that someone can point me to a useful solution from the top of their heads.

Thanks in advance,

usenix

I got my USB dac to work by issuing
sudo apt-get install alsa-utils pulseaudio
then rebooting and then choosing pulseaudio as audio device in system settings.

Regards

Installing pulseaudio may work, but it’s too CPU-heavy for a RPi 1. ALSA is the way to go.

The problem turned out to be related to sample format- my device only accepts Big Endian format. So using aplay, I am able to get correct output if I use “plughw” instead of “hw”:

aplay -D plughw:1,0 sample14.wav #works
aplay -D hw:1,0 sample14.wav

aplay: set_params:1233: Sample format non available
Available formats:

  • S16_BE
  • S24_3BE

ALSA should use plughw by default, so I don’t know why this is not the case with OSMC. I can adjust ~/.asoundrc to use the “plug” device pointing to hw:1,0 by default:

#.asoundrc
pcm.!default {
type plug

slave {
pcm “hw:1,0”
}
}

This way, using simply “aplay sample14.wav” gives output. However, I don’t know how it is supposed to work inside the kodi that comes with OSMC. An entry “ALSA: Default (Audiophile USB™ Analog)” shows up, but still doesn’t produce correct output.

So, suggestions from ppl who know the insides of the ALSA support in OSMC are welcome, so I can get the card working now. Generally, for the future it would be nice if one could actually simply define an ALSA device string as a “custom” sound interface from within Kodi.

Best,

usenix

I’ll just give this a bounce after a week with no replies.
It’s a serious problem- .asoundrc isn’t properly treated by OSMC.

Any help is appreciated, otherwise I’ll have to file a bug.

Best,

usenix

I just reinstalled my Raspberry Pi 2 to upgrade from Alpha 4 to RC1 and I have the same problem.
My USB audio DAC shows up in the list of audio devices in Kodi > System > Audio.

When I choose it I get some UI audio but it is highly distorted. Music files don’t play, they just sit at 0:00 and videos lag a lot and play without sound. I can play audio files just fine with aplay and mpg123 so I believe my asound.conf is good. It is in fact an exact copy of the asound file posted by usenix.

I would also like to voice my interest in getting this to work. I tried to enable debugging but I couldn’t find any useful log records that showed where it failed. I’ll be happy to provide them if someone would find them useful.

Ps. is it possible to specify audio device directly in ~/.kodi/userdata/guisettings.xml ? It seems to have an audio device string.

Regards

get yourself an iqaudio dac or hifiberry which are currently supported by osmc

Check my topic on hot plugging dac. I bet this gets it working for you. Also, .asoundrc is overlooked I think. Put the same content in /etc/asound.conf and it will work.

I have the /etc/asound.conf symlinked to ~/.asoundrc to make sure it’s in both places.

I’ve tried with your asoundrc as well and it doesn’t work.
System sounds are distorted and come out as pops and clicks, music doesn’t play (regular MP3 files) and video stutters.

With your asoundrc I cant even play files with aplay or mpg123.

Thank you for your reply tough :-).

Regards

I would try not to symlink it, just make sure the file is in both places to make sure…

Also, what’s the card number of your dac? When running cat /proc/asound/cards. That’s the number to use in asound.conf.

The device number is indeed 1.
Having a hard copy in both places didn’t fix the issue either.

Very strange. Can you set a mode on the DAC itself that might change something? Maybe turn async usb of and revert to USB1 mode? (that’s what I have chosen, but usb2 does work but the faster bus gives me plops)…

I really don’t see it as a hardware issue since I CAN play media files, just not with Kodi.

Regards

I just want to add that this problem persists with RC2. There are no hardware issues- sound plays well with aplay. Adding the (correct, please don’t tell me to check it) .asoundrc or /etc/asounc.conf providing the “default” device DOES add the default device to the KODI menu. However, selecting it still produces distorted sound.
So as of now, ALSA support seems to be broken in OSMC.

Hmm just to add to this, I’m having a similar issue with a Native Instruments Audio 4 DJ. I get audio via aplay but not in Kodi. Behavior is the same whether or not I use the above suggested settings in .asoundrc or /etc/asound.conf. My audio device also works with plughw but now hw.

Not sure where to go from here, alas.

Hello.
I found that Kodi has an issue with some USB DACs with Gpu acceleration for resampling. Try change the resampling to anything else, stop and play your music again and see if it starts working. (try low quality resampling to test if this is the problem). If it does, I’ve put a post together External USB audio, hiss and clicking sound - #16 by Maz with how i fixed it for mine (lots of external links and stuff).
Good luck.
Maz