kern/159236: [patch] set PCM_CAP_DEFAULT for the default snd device's caps

David Naylor naylor.b.david at
Wed Jul 27 16:20:04 UTC 2011

>Number:         159236
>Category:       kern
>Synopsis:       [patch] set PCM_CAP_DEFAULT for the default snd device's caps
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 27 16:20:04 UTC 2011
>Originator:     David Naylor
>Release:        FreeBSD-9
FreeBSD dragon.dg 9.0-BETA1 FreeBSD 9.0-BETA1 #0: Wed Jul 27 17:16:02 SAST 2011     root at dragon.dg:/tmp/home/freebsd9/src/sys/DRAGON  amd64
FreeBSD currently does not set PCM_CAP_DEFAULT for any audio device.  The attached patch sets that flag for the default (hw.snd.default_unit) device.  

It is noted that the OSS implementation from 4Front Technologies sets PCM_CAP_DEFAULT for all devices.  
This issue is obvious with Wine-1.3.25 where it checks for the first device with PCM_CAP_DEFAULT set.  winecfg has an audio tab that can be used to test the sound.  

Patch attached with submission follows:

--- dsp.c~	2011-07-27 16:57:42.000000000 +0200
+++ dsp.c	2011-07-27 17:08:32.000000000 +0200
@@ -2640,6 +2640,11 @@
 			    ((ch->direction == PCMDIR_PLAY) ? PCM_CAP_OUTPUT : PCM_CAP_INPUT);
+			/*
+			 * If the device is the default one (as per snd_unit) then indicate that.
+			 */
+			if (device_get_unit(d->dev) == snd_unit)
+				ai->caps |= PCM_CAP_DEFAULT;
 			 * Collect formats supported @b natively by the


More information about the freebsd-bugs mailing list