Hello, janui!
Finally I got debug output enabled so now I can see exactly what is happening inside!
So my DAC has the following description string (output of cat /proc/asound/cards | grep : | cut -b 1-3,21-):
0 : USB-Audio - PARASOUND - Digital Audio
and after
explode and
trim commands in original code it turns to:
aplay -l -v | grep "\[PARASOUND\]"
brackets correctly escaped with backslashes, but because the output of (aplay -l -v) is:
card 0: Audio [PARASOUND - Digital Audio], device 0: USB Audio [USB Audio]
grep command couldn't find
[PARASOUND] (there is no second closing bracket in the above text) and produces zero output, which leads to erratic behavior and subdevice number in hw:0,
0 gone missing.
I got fixed this by deleting the square brackets completely, in that case the "grep" worked out fine by locating the partial name PARASOUND.
Your suggestion is worked too, by extending the card name to
PARASOUND - Digital Audio, it matches perfectly with the brackets in aplay output!
Thanks again, janui.
So now we have at least two ways to go to fix this issue.
Please, devs, include this fix into your next build!
Regards,
Vlad.