Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jul 2011 16:11:36 GMT
From:      David Naylor <naylor.b.david@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/159236: [patch] set PCM_CAP_DEFAULT for the default snd device's caps
Message-ID:  <201107271611.p6RGBaii003965@red.freebsd.org>
Resent-Message-ID: <201107271620.p6RGK4eq067604@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107271611.p6RGBaii003965>