Hi,
Here's my proposal:
winealsa shall stop enumerating ALSA devices. By default, it should solely provide access to ALSA's default device adequately named "default".
The code that currently scans the registry Software\Wine\Drivers\winealsa.drv\devices=... shall remain in place, allowing a comma-separated list of alternate ALSA device names for those setups where "default" is not the preferred ALSA choice.
Rationale:
ALSA front-ends (pulse, dmix etc.) compete for the few back-ends (one or 2 sound cards or audio plugs). Some front-ends cling to the back ends even when unused. This has been known to cause random bugs.
- Test suites failing randomly ("resource temporarily unavailable") e.g. bug #28109, #28048 or randomly performing more or less tests, depending on whether the app managed to open the device or not.
- Sound stopping in apps (I believe when transitioning from intros to the main menu or game, at which time a rescan of all audio devices happens as mmdevapi is reopened).
Nobody found an elegant way to robustly enumerate ALSA devices (some apps hard-wire common names...), so let's simply avoid the issue entirely.
On many systems, the current code enumerates a quite uninteresting set of devices, e.g. "default", "plughw:0" and "plughw:4". These days, who wants hw:0 without mixing? I never heard any sound from "hw:4".
The current code fails to enumerate some existing devices like "plug:dmix".
OTOH, enumerating solely "default" or the user's hand-edited list of devices is expected to provide repeatable and best results.
Cost to users:
Users with a working ALSA device "default" should experience no drawback, only benefits. I believe this is the vast majority of users.
Users that edit their ~/.asoundrc to define other devices without simultaneously overriding !default will have to additionally edit the Wine registry to name their working ALSA capture and render devices, e.g. "asnoop" and "amix".
winecfg may or may not provide a GUI for editing this. This would be similar to most multimedia players allowing some way to change the ALSA device to use.
It's a pity that the registry scheme AFAIK does not allow per-app audio settings, but that's a completely unrelated issue.
Cost of non-adoption:
Users and audio devs remain annoyed. Bug reports remain open. Unpredictable and erratic loss of sound possible each time mmdevapi rescans the ALSA devices.
Please comment, Jörg Höhle