alsa-project / alsa-lib

The Advanced Linux Sound Architecture (ALSA) - library
GNU Lesser General Public License v2.1
345 stars 176 forks source link

[question] [ucm] how to manage the ucm and ucm2 for different kernels #312

Closed leif1992 closed 1 year ago

leif1992 commented 1 year ago

I got a problem which confused me for a long time. Wish I can get a good answer from here.

I write the ucm and ucm2 files for my sound card which can work well with my driver. And I need to support both 4.19 kernel (which use the ucm) and the 5.4 kernel (which use the ucm2). They are all deployed in the /usr/share/alsa. However, I need to install to audio driver for both 4.19 and 5.4 (DKMS). The ucm and ucm2 were both deployed at the same time. When I switch the kernel to 5.4, my ubuntu can't load my UCM files normally, and if I removed the files in the usr/share/alsa/ucm and then reboot the OS. My ucm files in the usr/share/alsa/ucm2 can be loaded normally.

Would you please help me figure out this incompatibility problem?

leif1992 commented 1 year ago

I dumped the log about pulseaudio (version 13.99.1):

pulseaudio[1263]: could not open configuration file /usr/share/alsa/ucm/MooreTh/HiFi.conf pulseaudio[1263]: error: failed to open verb file /usr/share/alsa/ucm/MooreTh/HiFi.conf : -2 pulseaudio[1263]: error: failed to import hw:1 use case configuration -2 pulseaudio[1263]: could not open configuration file /usr/share/alsa/ucm/MooreTh/HiFi.conf pulseaudio[1263]: error: failed to open verb file /usr/share/alsa/ucm/MooreTh/HiFi.conf : -2 pulseaudio[1263]: error: failed to import MooreThreads use case configuration -2 pulseaudio[1263]: UCM not available for card MooreThreads pulseaudio[1263]: Parsing configuration file '/usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf'

I have read the alsa lib(1.2.2) code about loading the ucm file. It will firstly check the ucm2 for the conf for one card. But here pulseaudio just loaded the ucm first and it didn't get the right folder name so that failed to load the ucm. The correct folder name is 'MooreThreadsGen1' and 'MooreThreadsGen2'.