winealsa.drv: If we can't open a device as stereo, try mono. This is necessary for snd-usb-audio mics.

This commit is contained in:
Jeff Cook 2010-08-02 17:49:16 -06:00 committed by Alexandre Julliard
parent 6120d7cc14
commit 343f85ea66
1 changed files with 4 additions and 0 deletions

View File

@ -105,6 +105,10 @@ static int ALSA_TestDeviceForWine(int card, int device, snd_pcm_stream_t stream
/* set the count of channels */
retcode = snd_pcm_hw_params_set_channels(pcm, hwparams, 2);
if (retcode < 0)
{
retcode = snd_pcm_hw_params_set_channels(pcm, hwparams, 1); /* If we can't open stereo, try mono; this is vital for snd_usb_audio microphones */
}
if (retcode < 0)
{
reason = "Could not set channels";
goto exit;