http://bugs.winehq.org/show_bug.cgi?id=27917
--- Comment #3 from David Naylor naylor.b.david@gmail.com 2011-07-27 10:15:01 CDT --- Thanks for your quick response.
Reading [2] I interpret that flag indicating a device's suitability as a default device, not that the device *is* the default device. Nor does it say only one device may have this flag set (and only implies multiple devices may have the flag set). What is the intended use of PCM_CAP_DEFAULT? And how is it used in other oss implementations?
Does not the second last paragraph imply /dev/dsp should be used as the default device?
I looked through the source code for FreeBSD and found:
# grep -r PCM_CAP_DEFAULT . ./sys/sys/soundcard.h:# define PCM_CAP_DEFAULT 0x40000000 /* "Default" device */ ./sys/sys/soundcard.h:#define DSP_CAP_DEFAULT PCM_CAP_DEFAULT # grep -r DSP_CAP_DEFAULT . ./sys/sys/soundcard.h:#define DSP_CAP_DEFAULT PCM_CAP_DEFAULT
Which I interpret that FreeBSD does not even set *_CAP_DEFAULT for any device. FreeBSD does provide a way to determine the default device (and change it) via the sysctl "hw.snd.default_unit". I think there is definitely a bug in FreeBSD's OSS implementation and will gladly report it.
I looked through the trace and found two different caps: 23200 and 13200. The first occurrence of 13200 is the default device. I cannot say if that is significant or just chance.
I have made a patch to set PCM_CAP_DEFAULT for the default device. I will test it, then the one you just posted, and report back.