From owner-freebsd-bugs@FreeBSD.ORG Wed Jul 27 16:20:04 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF3F71065673 for ; Wed, 27 Jul 2011 16:20:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 840528FC13 for ; Wed, 27 Jul 2011 16:20:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p6RGK4Lh067605 for ; Wed, 27 Jul 2011 16:20:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p6RGK4eq067604; Wed, 27 Jul 2011 16:20:04 GMT (envelope-from gnats) Resent-Date: Wed, 27 Jul 2011 16:20:04 GMT Resent-Message-Id: <201107271620.p6RGK4eq067604@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, David Naylor Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0C3B1065674 for ; Wed, 27 Jul 2011 16:11:36 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id C11EC8FC13 for ; Wed, 27 Jul 2011 16:11:36 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p6RGBaji003966 for ; Wed, 27 Jul 2011 16:11:36 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p6RGBaii003965; Wed, 27 Jul 2011 16:11:36 GMT (envelope-from nobody) Message-Id: <201107271611.p6RGBaii003965@red.freebsd.org> Date: Wed, 27 Jul 2011 16:11:36 GMT From: David Naylor To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/159236: [patch] set PCM_CAP_DEFAULT for the default snd device's caps X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 16:20:04 -0000 >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: