On usb dac hw changes after reboot

Required Information

  • DietPi version | cat /boot/dietpi/.version
    G_DIETPI_VERSION_CORE=8
    G_DIETPI_VERSION_SUB=21
    G_DIETPI_VERSION_RC=1
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’
  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
    bookworm
  • Kernel version | uname -a
    Linux DietPi 6.1.0-12-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.52-1 (2023-09-07) x86_64 GNU/Linux
  • Architecture | dpkg --print-architecture
    amd64
    -DAC FiiO R7

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Playback open error: -16,Device or resource busy

I use the usb-dac-plugin. When I have to reboot Dac or Dietpi the audio hw changes. It changes from hw:1,0 to hw:0,0 It should be static at hw:1,0 to work properly.

I have to turn of both devices and power on again te get it back to hw:1,0.

Tested another dac (edifier 3000 pro) gives the same result

Hello

You can fix the number with this file :
/usr/lib/modprobe.d/dist-alsa.conf

just had this in the file :
options snd-usb-audio index=1

Thomas

1 Like

thank you for reply I save the email off this topic. I did return to windows and running logitechmediaserver,squeezelite plexserver and plexamp. There the FiiO-R7 has an asio driver which is working well.

Do you mean that The default PCM changes in /etc/around.conf, i.e. that changes to this file do not survive reboots, or that the card ID of the particular PCM changes in aplay -l output? If the latter, do you have multiple sound cards attached and they exchange their IDs randomly?

yes I did try that to look what happens and then the cards changes randomly. When you only use one usb device it changes with the internal sound devices.

Okay, interesting. Especially if one sound card is internal, I’d expect this to be always detected first by the kernel and hence always become card 0 while the USB DAC then becomes always card 1. But indeed it is not assured, same as with classic network interface and block device numbers.

The kernel driver parameter mentioned by th2j indeed should work:

# modinfo snd-usb-audio
filename:       /lib/modules/6.4.0-1-amd64/kernel/sound/usb/snd-usb-audio.ko
...
parm:           index:Index value for the USB audio adapter. (array of int)
...

If it is detected first, index 0 is free afterwards for the internal sound card, and otherwise it gets index 1 anyway.

Another solution would be to blacklist the module for the internal sound card. You could check lsmod to find it, then add a blacklist <module> entry to a modprobe config file like /etc/modprobe.d/disable-onboard-audio.conf.

And it is also possible to define the default card in /etc/asound.conf with another identifier than the card index. But I’d have to check the syntax.

And last but not least, what you seem to have done, is to pick an explicit PCM with the player, rather than the default.