I tried all solutions for this problem but still can't get sound from the digital port, only analog port. I'm running Ubuntu 20.04.2 LTS.
From this solutionI only get something.wav: No such file or directory when I try aplay -D plughw:CARD=SoundCard,DEV=X something.wav with any value 0..3 for X.
The solution required a reboot before it took effect. So my change to the file /usr/share/alsa/cards/USB-Audio.conf was to add "Xonar SoundCard" 2.