[pulseaudio-discuss] Routing questions of module-switch-on-connect, module-device-manager and device profiles

Lin, Mengdong mengdong.lin at intel.com
Tue Sep 20 20:41:12 PDT 2011


Hi Col,

Thanks a lot for your advice and guiding me to the great design doc of routing! I hope to continue the discussion from the other thread http://lists.freedesktop.org/archives/pulseaudio-discuss/2011-September/011374.html

I have some concerns with module-switch-on-connect (m-s-on-c), module-device-manager (m-d-m) and device profiles:
1. m-s-on-c can route audio to the new connected sink/source, and the new device will become the default sink/source (or become the top of default priority list in the future).
  But when a port becomes available on a non-default device (not of highest priority), audio will not be routed to that device's new active port. 
  (from David's patch http://lists.freedesktop.org/archives/pulseaudio-discuss/2011-August/011167.html)
  So if user is playing music via HDMI and then want to use the wired-headset (a port on ALSA sink), he cannot just plug in the headset but still need disconnect HDMI manually. 
  I would be more convenient if m-s-on-c treats the port more like a device, i.e. can route audio to the device with a new available port no matter the device is default or not. The logic is same: if a user connects/plug-in some device, he want to use it.

2. m-d-m maintains a media-role-based priority list, m-s-on-c can route audio to the new connected device but never update the priority list. This may caused unexpected behaviors for some policy requriements:
  Use case: If I have 3 devices, dev 1 has highest priority, dev 2 has 2nd priority and dev 3 lowest. Both dev 2 and dev 3 are removable device.
  If I plug in dev2, audio will be routed to dev 2 and then I plug in dev 3 (without unplugging dev 2), audio will be routed to dev 3. Then I feel dev 3 is not so good and want to switch back to my previous choice dev2. But when I unplug dev 3, audio is routed back to dev 1 by m-d-m. Is it doable to allow m-s-on-c affect the role-based priority list, so new connected device has a higher priority?
I mean a dynamic priority list made from user connection/disconnection rather than a pre-defined one.
 
3. device profiles
  I hope when a new card is created, it does not always use highest priority profile. Rather, it can check all live streams' roles and decide it profile and create the sink/source. E.g. If the Bluetooth headset is connected during a phone call, it will use HSP profile, otherwise use A2DP profile. In addition, when new stream is put or unlinked, the card can change its profile accordingly. I previous patch Bluetooth modules to do such thing but I feel this is not only for Bluetooth but a general feature. Is it worth to write a module to handle this feature?

I would be grateful if you could give me some advice!

Great thanks
Mengdong


More information about the pulseaudio-discuss mailing list