Comment 7 for bug 746023

David Henningsson (diwic) wrote :

I was asked today to make a review of the current PA patches for UCM. I've been told that for omap4, sound is currently dysfunctional and these patches help. For all others, no added functionality and so we need to take all precautions possible to avoid regressions.

Seems like there are two distinct parts of functionality added, the UCM configuration to PA profile mapping, and jack detection.

Let's focus on the UCM to PA first:

This seems relatively safe from regressions: the only thing that is now called for all cards is snd_use_case_mgr_open. It would be preferable if this was proactively selected, e g through a udev rule or through a module parameter passed on through module-udev-detect to the alsa card module. All other usages of ucm functions are never called if snd_use_case_mgr_open returns false.

A few comments on the code:
- It would be great if all the new ucm functionality was in a separate pair of .c and .h files. That would make it easier for us to pick up patches to the alsa-card.c file from upstream. I also believe upstream would appreciate that separation.
- pa_log is used extensively, should be pa_log_debug, pa_log_info to avoid annoying syslog messages.

For the jack detection code, that's currently not finished. The current code doesn't add anything of value to the end user, so my recommendation is not to merge it at this point. Margarita is working on a new version but it is not finished yet. Anyway, that part is more invasive to current code and so if we decide to merge it I strongly recommend to keep it disabled by default and make a module parameter to module-udev-detect to enable jack detection explicitly.