winealsa.drv patch to enum all software devices from .asoundrc

Chris Robinson chris.kcat at gmail.com
Fri Feb 10 14:05:34 CST 2012


On Friday, February 10, 2012 5:09:05 PM Нискородов Серёжа wrote:
> > There's no $HOME/.asoundrc on any of my systems, yet I'd like to
> > use "plug:dmix" with Wine, e.g. on systems with PulseAudio installed.
> > I can use speaker-test -Dplug:dmix with no trouble.
> > Will your patch make that appear in the list?
> 
> The devices that I can add to the list can be seen in output of "aplay
> -L". But I did not add devices with a colon in the title, because most
> of them are useless without extra "plug:" wrapper. I can add a wrapper
> "plug:" in front of them, but I think it's wrong.

The only thing "plug:" would do that mmdevapi would need is sample type 
conversion. Wine will have to do some sample fiddling eventually anyway if it 
wants to support surround sound output (Windows and ALSA disagree on the 
channel ordering, so Wine needs to swap when writing between the app and ALSA; 
adding sample conversions on top of this shouldn't be hard). Plain mmdevapi 
can't do rate conversions or channel remixing and is up to the app, or other 
components sitting on top of mmdevapi, to do them.

FWIW, my custom dmix device for 5.1 Surround output shows up in aplay -L with 
a colon, as it's defined to accept arguments for the output device instead of 
hardcoding one, and neither plain 'dmix' or 'default' get listed. The only 
name without a colon is 'null'.


Ultimately, I can't say I'm a fan of snd_device_name_hint for enumerating 
devices. I get this from aplay -L:

null
    Discard all samples (playback) or generate zero samples (capture)
front:CARD=NVidia,DEV=0
    HDA NVidia, ALC888 Analog
    Front speakers
surround40:CARD=NVidia,DEV=0
    HDA NVidia, ALC888 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=NVidia,DEV=0
    HDA NVidia, ALC888 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=NVidia,DEV=0
    HDA NVidia, ALC888 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=NVidia,DEV=0
    HDA NVidia, ALC888 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=NVidia,DEV=0
    HDA NVidia, ALC888 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=NVidia,DEV=0
    HDA NVidia, ALC888 Digital
    IEC958 (S/PDIF) Digital Audio Output
dmix51:CARD=NVidia,DEV=0
    HDA NVidia, ALC888 Analog
    Direct sample mixing device (5.1 Surround)
dmix51:CARD=NVidia,DEV=1
    HDA NVidia, ALC888 Digital
    Direct sample mixing device (5.1 Surround)

All but "dmix51:CARD=NVidia,DEV=0" is completely useless, and except for 
iec958, null, and the very bottom one, they all describe the same device (just 
with different output channel configs, which should be configured separately 
and not as a separate device entry)... and except for dmix51 and null, all 
will take exclusive use of the underlying device.



More information about the wine-devel mailing list