RFC: Remove auto-scan of ALSA devices from winealsa.drv

Andrew Eikum aeikum at codeweavers.com
Wed Dec 12 08:28:49 CST 2012


On Tue, Dec 11, 2012 at 04:46:34PM +0100, Henri Verbeet wrote:
> On 11 December 2012 16:05,  <Joerg-Cyril.Hoehle at t-systems.com> wrote:

My first reaction is that this is a good idea. We've had some
discussion about device enumeration before.  The final conclusion was
it's basically impossible to do usefully with ALSA. I can't think of a
way for us or for ALSA to enumerate only "useful" devices.  The
closest that currently exists is snd_device_name_hint, but that has
plenty of problems, too:
http://www.winehq.org/pipermail/wine-devel/2012-February/094182.html

For comparison, here's some examples of what various libraries and
applications do:

snd_device_name_hint: aplay, VLC
Hard-coded based on number of channels: mplayer, SDL
snd_card_next: Wine, gstreamer

There is clearly no consensus.

> > 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".
> >
> It will also pretty much just remove device selection on setup with
> multiple audio devices, which is actually fairly common these days
> with USB audio devices and HDMI outputs on graphics cards. I think the
> correct approach would to work with upstream ALSA to fix things,
> instead of just removing device enumeration.
> 

It's tricky because ALSA and PulseAudio have different theories about
where device selection should occur -- in the application or in the
audio mixer. In the ALSA case, we want to list devices. In the Pulse
case, we want to list only "default".

The fact that ALSA still doesn't have a usable enumeration API makes
me think that enumeration is not an intended use-case. The official
ALSA sample applications tend to use "default" or allow the user
to specify their own device. That seems like a fine compromise.

So it seems reasonable to me to list only "default", but also provide
an easy way to add new devices. Forcing users like Max to go to
regedit in every new prefix to add a new audio device really sucks.
This means some sort of driver-specific dialog in winecfg (or control
panel?). That sucks too, but I think it's the least-bad solution.

Andrew



More information about the wine-devel mailing list