kern/159236: [patch] set PCM_CAP_DEFAULT for the default snd
device's caps
David Naylor
naylor.b.david at gmail.com
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
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Jul 27 16:20:04 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: David Naylor
>Release: FreeBSD-9
>Organization:
Private
>Environment:
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
>Description:
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.
>How-To-Repeat:
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.
>Fix:
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 @@
*/
ai->caps = PCM_CAP_REALTIME | PCM_CAP_MMAP | PCM_CAP_TRIGGER |
((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
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list