alsa-project / alsa-lib

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

Ucm2 device sorting / ordering #397

Closed beatboxa closed 1 month ago

beatboxa commented 1 month ago

The sort order that devices are probed and ultimately listed in my OS sound settings is reversed--though consistent--from the order that they appear (top to bottom) in the UCM configuration files. And they also do not appear consistent with configured device priority.

In other words, if the UCM configuration file hypothetically lists the following, from top to bottom:

  1. Device 1 - priority 300
  2. Device 2 - priority 100
  3. Device 3 - priority 200

These devices will be probed and listed in the OS in the following order:

  1. Device 3
  2. Device 2
  3. Device 1

I am currently creating a UCM config file for a device with 32 discreet output channels and 30 discreet input channels (and both stereo and mono device versions of many of these), so the sort order is crucial for user experience in a list this long.

I originally tried to reorder and rename the devices in the ucm configuration file to make it easier to follow and list correctly in my OS, but then I ran afoul of the alsa-lib rules for naming and ordering.

Related:

perexg commented 1 month ago

It's not alsa-lib issue (see direct alsaucm dump text output), but a sound server issue (the user of UCM API). I already wrote this in https://github.com/alsa-project/alsa-ucm-conf/pull/416#issuecomment-2111101525 .