[Solved] UDOO with USB DAC problems: no sound in Volumio

Hi all,

I am only into Volumio for a couple of weeks now and have moved from RPi to UDOO because I want to use hires (24/192) output as well and have not been able to get that 100% ok on the raspberry. My conclusion was that it was due to hardware (USB bus traffic on the same bus as network), so decided to go a step up with the harware.

My UDOO is connected to a USB DAC, which nicely shows up in the playback device list in Volumio. However, it does not play. I have tried mixer settings: hardware, software and disabled, all with no luck. I have also tried the CMedia fix, but with no luck either.

The MPD log file says:

ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card
Feb 28 13:28 : output: Failed to open "Output" [alsa]: Failed to open ALSA device "hw:2,0": No such file or directory
Feb 28 13:28 : player_thread: problems opening audio device while playing "RAMPLAY/03 What's up.flac"

But using the same device in aplay works fine.

root@volumio:~# aplay -D plughw:2,0 /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

I have also set the device to “plughw:2,0” in etc/mpd.conf:

audio_output {

                 type           "alsa"
                 name           "Output"
                 device         "plughw:2,0"
                 dsd_usb        "no"

}

Same error:

ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card
Feb 28 13:33 : output: Failed to open "Output" [alsa]: Failed to open ALSA device "plughw:2,0": No such file or directory
Feb 28 13:33 : player_thread: problems opening audio device while playing "RAMPLAY/03 What's up.flac"

If I try to play aplay with device hw:2,0 it gives me an issue with the sample:

root@volumio:~# aplay -D hw:2 /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1081: Sample format non available
Available formats:
- S32_LE

So I am thinking along the lines that there is something not ok with the USB hardware dvices addresses, but cannot see that.

aplay -L gives:

root@volumio:~# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=vt1613audio
    vt1613-audio,
    Default Audio Device
sysdefault:CARD=imxhdmisoc
    imx-hdmi-soc,
    Default Audio Device
sysdefault:CARD=X
    Peachtree24/192 USB X, USB Audio
    Default Audio Device
front:CARD=X,DEV=0
    Peachtree24/192 USB X, USB Audio
    Front speakers
surround40:CARD=X,DEV=0
    Peachtree24/192 USB X, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=X,DEV=0
    Peachtree24/192 USB X, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=X,DEV=0
    Peachtree24/192 USB X, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=X,DEV=0
    Peachtree24/192 USB X, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=X,DEV=0
    Peachtree24/192 USB X, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=X,DEV=0
    Peachtree24/192 USB X, USB Audio
    IEC958 (S/PDIF) Digital Audio Output

and aplay -l gives:

root@volumio:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: vt1613audio [vt1613-audio], device 0: HiFi vt1613-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: imxhdmisoc [imx-hdmi-soc], device 0: IMX HDMI TX mxc-hdmi-soc-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: X [Peachtree24/192 USB X], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Any input much appreciated!

Seems same people have serious problem with cm6631 and volumio + udoo or utilite.

Inviato dal mio SM-N9005 utilizzando Tapatalk

After posting this, I just wanted to go from scratch and keep a clear history of what I exactly did and created a new SD from the image.

So even before switching the “Audio Output” in Volumio to the USB DAC (it was default vt1613audio), I just pressed play after placing a music file on the RAM.

Strangely enough, it then played! :confused:

MPD.conf has:

audio_output {

                 type           "alsa"
                 name           "Output"
                 device         "hw:2,0"
                 mixer_control  "PCM"
                 mixer_device   "hw:2"
                 mixer_index    "0"
                 dsd_usb        "yes"

}

So now I go step by step to make sure I get it totally correct (DSD off, mixer to software as hardware doesn’t work). All through the front-end.

After putting the hardware mixer to software, it did not play anymore. The MPD.conf then said:

audio_output {

                 type           "alsa"
                 name           "Output"
                 device         "hw:0,0"
                 dsd_usb        "yes"

}

Then I changed it back to my USB DAC in the front-end and it started working again. MPD.conf was then:

audio_output {

                 type           "alsa"
                 name           "Output"
                 device         "hw:2,0"
                 dsd_usb        "yes"

}

So honestly I am afraid I am missing the clue here: this config is the same as it was when it did NOT work…

So I decided to go for a reboot, to see if it all comes back up again ok as well. After the reboot BOTH options did not work, not aplay and not volumio. I disconnected / connected the USB DAC and then aplay worked again, but volumio did not. Same error (note that in the clean install I did also not install ntpdate yet, so it says Jan 1st 1970…):

Jan 01 00:23 : output: "Output" [alsa] failed to play: No such device
ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card
Jan 01 00:24 : output: Failed to open "Output" [alsa]: Failed to open ALSA device "hw:2,0": No such file or directory
Jan 01 00:24 : player_thread: problems opening audio device while playing "RAMPLAY/03 With or Without You.flac"

So I did a system shutdown, removed power, and rebooted. For some reason Volumio did not get up, so I rebooted again.

Then in volumio, I started playing a song. It showed like it was playing, but I did not hear anything then in parallel I did the aplay of the WAV.

That then gave a different error (still no sound):

root@volumio:~# aplay -D plughw:2,0 /usr/share/sounds/alsa/Front_Center.wav
aplay: main:682: audio open error: Device or resource busy

So then I removed and plugged back in the USB connector to the DAC and volumio noticed and stopped “playing” (i.e. stopped the timer of the song). Then APLAY did work again, but volumio not at all anymore (not even increasing the time of the song after reselecting it for playing).

Unfortunately I am not a linux expert at all, but logical thinking would indicate that there is something the matter with the USB mapping of MPD (and also aplay until I remove/reconnect the USB) after the reboot. So I provide a listing of my USB devices as well:

root@volumio:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 002 Device 005: ID 20b1:0002 XMOS Ltd
Bus 002 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter

Is there a way to tell MPD to use DEVICE 005 (as that is the DAC), e.g. by using the ID? I’ll google on it as well but any input here is much appreciated.

Haraudio do you have this problem with an xmos usb interface or dac?
I see device 05 is listed as xmos.

Inviato dal mio SM-N9005 utilizzando Tapatalk

Actually, my DAC (PeachTree) has the XMOS USB receiver chip inside. So it is just one component which I connect using a USB cable.

I have only one USB cable in the UDOO: the one to the DAC (which has the XMOS chip inside). So no other hardware at all connected but this USB DAC.

To give more info, I have also run the lsusb first WITH and then WITHOUT the DAC attached and finally with DAC re-attached.

With DAC after boot (no sound in Volumio or aplay):

root@volumio:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 002 Device 003: ID 20b1:0002 XMOS Ltd
Bus 002 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter

Without:

root@volumio:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 002 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter

Plugged it back in (it then is DEVICE No. 5 instad of 3! And then aplay plays, but Volumio still doesn’t):

root@volumio:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 002 Device 005: ID 20b1:0002 XMOS Ltd
Bus 002 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter

Really hope someone knows how to point Debian / Volumio to the right USB device for sound, as the more I think of it, the more it must be a USB address issue… (but again: not an expert :wink: )

I re-created the image again - plays right out of the box, correctly with the DAC/XMOS as Device 3:

root@volumio:/# cat /proc/asound/card2/stream0
Peachtree Peachtree24/192 USB X at usb-fsl-ehci.1-1.1, high speed : USB Audio

Playback: Status: Running Interface = 1 Altset = 1 URBs = 8 [ 8 8 8 8 8 8 8 8 ] Packet Size = 1024 Momentary freq = 88199 Hz (0xb.0660) Feedback Format = 16.16 Interface 1 Altset 1 Format: S32_LE Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 44100, 48000, 88200, 96000, 176400, 192000 Data packet interval: 125 us root@volumio:/# lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub Bus 002 Device 003: ID 20b1:0002 XMOS Ltd Bus 002 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
So then, without touching anything, I did a reboot.

Volumio pretends to play (timer goes) but no sound.

Outputs from lsusb and stream are exactly the same:

root@volumio:~# cat /proc/asound/card2/stream0
Peachtree Peachtree24/192 USB X at usb-fsl-ehci.1-1.1, high speed : USB Audio

Playback:
  Status: Running
    Interface = 1
    Altset = 1
    URBs = 8 [ 8 8 8 8 8 8 8 8 ]
    Packet Size = 1024
    Momentary freq = 88199 Hz (0xb.0660)
    Feedback Format = 16.16
  Interface 1
    Altset 1
    Format: S32_LE
    Channels: 2
    Endpoint: 1 OUT (ASYNC)
    Rates: 44100, 48000, 88200, 96000, 176400, 192000
    Data packet interval: 125 us
root@volumio:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 002 Device 003: ID 20b1:0002 XMOS Ltd
Bus 002 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
root@volumio:~#

So what is different after the reboot?

To make totally sure there is nothing wrong on the XMOS/DAC side, I have then shut down the UDOO with Volumio, disconnected the DAC and switched it off and on. Then connected the cable again and switched on the UDOO. No sound. So that should rule out anything being wrong with the DAC.

So the question is: what happens when you boot the fresh Volumio UDOO Quad image and then reboot? Does it write some configuration somewhere for me to check? Again: I did not change anything at all in the Volumio front-end or in any file. I only copied one audio file to RAMPLAY and played it. And with the fresh image that was correct immediately.

Any pointers on what I can check further would be greatly appreciated: config files, log files etc.

This is the exactly same error that I had with my xmos.
I don t know why… but after I changed the default power supply with another a little more powered the issue is gone.
My dac use an xmos powered by usb cable.
Ciao

Inviato dal mio SM-N9005 utilizzando Tapatalk

Grazie!
I will look for better power supply (or powered usb hub) and see if that helps. Will be not before the weekend, but I will revert back as soon as I tried it.
H.

Also after adding extra power directly on the USB port (2A) it has exactly the same behaviour. So that did not work. To be complete: I was already using a 12V power supply other than the one that can be ordered together with the UDOO. But I tried the exta power anyway.

So to summarize:

  • aplay (and also squeezelite) play only AFTER removing / replugging the USB when the UDOO is switched on
  • volumio pretends to play before replugging the USB (it locks the card2 and song timer runs) - but no audio
  • volumio does not play at all after replugging: also timer does not run and nothing shown at the card output (cat /proc/asound/card2/stream0)

So please if anyone would:

  • know what I can log further when the timer goes, but no audio
  • know how to make sure the right USB audio device is used - or reset the USB drivers by a command (then I could script it at startup and then at least squeezelite would work)
  • can tell me how to restart all volumio services (restarting MPD is not enough) after replugging to maybe have the option to use Volumio in the same way as squeezelite: after replugging the USB cable and then restarting the service

But in general: this must be some sort of bug: a fresh image on the SD card works fine (!) at first boot and not at all anymore after a reboot (or shutdown, or power off etc. etc.) - the only way aplay an volumio work then is by replugging the USB after reboot of the UDOO

Any input appreciated!

At the first start of volumio you have to select your device in playback option and save, then wait for one or two minute, unplug the power and reboot volumio.
I think you already tried this?

Inviato dal mio SM-N9005 utilizzando Tapatalk

Yes, tried it. So am now doing the cycle again:
Put the image freshly on the SD
Put the SD in Volumio and power on (dual power: 12V on the DC and another 5V on the USB)
Copy a song to Ramplay and play it (in this case 192kHz) and it works right away out of the box:

Peachtree Peachtree24/192 USB X at usb-fsl-ehci.1-1.1, high speed : USB Audio
Playback:
  Status: Running
    Interface = 1
    Altset = 1
    URBs = 8 [ 8 8 8 8 8 8 8 8 ]
    Packet Size = 1024
    Momentary freq = 191996 Hz (0x17.ffe0)
    Feedback Format = 16.16
  Interface 1
    Altset 1
    Format: S32_LE
    Channels: 2
    Endpoint: 1 OUT (ASYNC)
    Rates: 44100, 48000, 88200, 96000, 176400, 192000
    Data packet interval: 125 us
root@volumio:~#

Also try aplay:

root@volumio:~# aplay -D plughw:2 /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
root@volumio:~#

Also fine.

Then without setting anything: reboot. So no settings changed in Volumio or anywhere at all.

And it doesn’t work anymore aplay starts working after replugging the USB cable, but not Volumio. Pretty sure it is a bug somewhere… Volumio? The USB drivers? Something with the mixer settings in the ALSA part?

Happy to gather all logging that someone can think of - but just let me know what to log and how.

I have a xmos + udoo another guy have the same and volumio works… I am not a linux expert, sorry.
Mikelangelo at this point is the only one that can help.

Inviato dal mio SM-N9005 utilizzando Tapatalk

Keres, thanks for your input!

I guess Michelangelo has multiple threads to work on. But it would be good if I got some pointers on where to look: logging, config. It is so specific that it first works, but never again after a reboot, that it must point in a certain direction… And I started from scratch at least 5 times, so hard to beleive it is a coincidence :wink:

What I am anyway going to try is to make an alias/slave for the USB sound device. I hope Volumio is listing the alias and selecting it might help. I can fiddle around a bit with resampling as well, then. You never know.

I believe xmos is just the chip, the guys implementing it also need to do stuff around it. So your implementation could be totally different from mine.

Yes at first boot work, but if you go in playback option the listed working device is not the right device? It’s so?

Inviato dal mio SM-N9005 utilizzando Tapatalk

Yes, device is there, but not selected. So it is in the list and I can select it, but I have sound over USB even though the internal soundcard is selected. As soon as I select it it does not work anymore. And also if I just leave it untouched, it does not work anymore after reboot.

I now created the following:

pcm.primary {
        type plug
        slave.pcm "dmixer"
}

pcm.dmixer  {
        type dmix
        ipc_key 1024
        slave {
                pcm "hw:2,0"
                period_time 0
                period_size 1024
                buffer_size 4096
                rate 44100
        }
        bindings {
                0 0
                1 1
        }
}

ctl.dmixer {
        type hw
        card 2
}

aplay works with primary ONLY after replugging.

I created that in /etc/asound.conf by the way

As soon you select the right device after the first boot and clik save, you wait for one minute or two, then unplug the power … replug but the dac not work anymore?
This procedure works with my xmos device but your remain mute :frowning:
Wait for next release … :slight_smile:
Don’t sell the udoo it sound incredible well.

Inviato dal mio SM-N9005 utilizzando Tapatalk

Wow Keres, you just saved my day! :smiley:

If I do not do a REBOOT command from ssh after selecting the input, but unplug it from the power and replug, it works… So I just tried a reboot just now from ssh and it doesn’t work anymore…

So the good news: if I just refrain from rebooting, but just power it off by unplugging if I need to… I at least have a workaround.

Now waiting for the next release… where hopelfully all this detailed information has enabled Michelangelo to find a fix for it.

Thanks again :slight_smile:

You have to save your listed device only the first time booting, then unplug power and replug power and the right device work :slight_smile:

Inviato dal mio SM-N9005 utilizzando Tapatalk

Hi guys, sorry if I came too late! But happy you found a workaround for this! This is extremely funny, though…

An experiment. Try to issue a ssh command

mpc stop

before rebooting via ssh… Let me know! I suspect this is a combo of alsa bug, and xmos…