alsa: device name

Jeremy White jwhite at codeweavers.com
Sun Jun 12 20:52:11 CDT 2005


Kevin,

I don't think this is correct.  Our job is to enumerate
devices available to Wine; the 'default' device is
generally card #0, device #0 on that card.  A system
may well have multiple card and multiple devices within
a card; by setting this to 'default', you have prevented
a meaningful scan.

I've actually got a fairly large patch coming which
reorganizes Alsa device discovery to be more correct,
imho.  (I iterate through the cards, and iterate through
device on cards; I detect and mark as the wine default
the default card identified by Alsa config; I respect
ALSA card/device environment variables, and, finally,
I allow for explict device name override within Wine).

I'm stymied currently by the fact that my patch correctly
identifies a greater range of devices reported by Alsa,
but then, at least with my laptop's sound card, one
of the devices reported doesn't work for beans.  I'm
trying to figure a way to detect that card 0, device 4
doesn't work for beans so I can strip it from the results;
once I finish that (if I can), I'll submit the larger patch.

Cheers,

Jeremy

Kevin Koltzau wrote:
> With ALSA 1.0, the device name "default" should be used.
> "default" is mapped to plug:hw by default, but allows remapping from your alsa config
> 
> 
> ------------------------------------------------------------------------
> 
> Index: dlls/winmm/winealsa/audio.c
> ===================================================================
> RCS file: /home/wine/wine/dlls/winmm/winealsa/audio.c,v
> retrieving revision 1.85
> diff -u -d -r1.85 audio.c
> --- dlls/winmm/winealsa/audio.c	9 Jun 2005 09:49:31 -0000	1.85
> +++ dlls/winmm/winealsa/audio.c	13 Jun 2005 00:47:09 -0000
> @@ -714,7 +714,7 @@
>  /******************************************************************
>   *             ALSA_GetDeviceFromReg
>   *
> - * Returns either "plug:hw" or reads the registry so the user can
> + * Returns either "default" or reads the registry so the user can
>   * override the playback/record device used.
>   */
>  static char *ALSA_GetDeviceFromReg(const char *value)
> @@ -741,7 +741,7 @@
>  
>  end:
>      if (!result)
> -        result = ALSA_strdup("plug:hw");
> +        result = ALSA_strdup("default");
>  
>      if (key)
>          RegCloseKey(key);




More information about the wine-patches mailing list