Pi Zero W - trouble with a usb soundcard

I’m running the most current DietPi version with all apt upgrades installed on Raspberry Pi Zero W.

I have a USB soundcard which run on Raspbian after these instructions: https://raspberrypi.stackexchange.com/questions/80072/how-can-i-use-an-external-usb-sound-card-and-set-it-as-default.

I have used dietpi-config to set the card as the default audio device (the utility correctly sees the card whenever it’s inserted and shows it as a plugged in device on the bottom at hw:1,0 as Device USB Audio)

However, afterwards the soundcard doesn’t produce any sound.

aplay -l && arecord -l results in

aplay: device_list:274: no soundcards found...
arecord: device_list:274: no soundcards found...

cat /proc/asound/cards shows

1 [Device         ]: USB-Audio - USB PnP Sound Device
                      C-Media Electronics Inc. USB PnP Sound Device at usb-20980000.usb-1.2, full spe

cat /proc/asound/modules shows 1 snd_usb_audio

amixer -c 1 shows Invalid card number.

/usr/share/alsa/alsa.conf has defaults.ctl.card 1 and defaults.pcm.card 1

during the process of using dietpi-config to change the audio device an error shows up:

[  OK  ] DietPi-Set_hardware | rm /var/lib/alsa/asound.state
alsa-lib parser.c:2179:(load_toplevel_config) Unable to find the top-level configuration file '/usr/share/alsa/ucm2/ucm.conf'.
alsa-lib main.c:1014:(snd_use_case_mgr_open) error: failed to import hw:1 use case configuration -2
Found hardware: "USB-Audio" "USB Mixer" "USB8086:0808" "" ""
Hardware is initialized using a generic method

I have tried rebooting, cold booting, going through dietpi-config multiple times, but nothing seems to work.

aplay -l shows “no soundcards found…” while at the same time cat /proc/asound/cards shows it? Those should use the exactly same information, so either both show it or both not. Can you replicate the same behaviour with both commands or is the connection probably flaky?

Do not touch /usr/share/alsa/alsa.conf, this is a defaults/fallback configuration and reverted on every ALSA package upgrade. dietpi-config set the default audio device via /etc/asound.conf, where you can tinker with or create an override .conf file in /etc/alsa/conf.d/ (create if missing).

After a reboot, as onboard audio should then be disabled, I’d actually expect the correct card number to be 0, as long as you do not have an KMS video driver enabled.

Please also check for kernel errors and related messages:

dmesg -l emerg,alert,crit,err
dmesg | grep -E 'audio|sound|snd'