Bug 159236 - [pcm] [patch] set PCM_CAP_DEFAULT for the default snd device's caps
Summary: [pcm] [patch] set PCM_CAP_DEFAULT for the default snd device's caps
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-multimedia (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-27 17:20 UTC by David Naylor
Modified: 2014-12-16 14:24 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (498 bytes, patch)
2011-07-27 17:20 UTC, David Naylor
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Naylor 2011-07-27 17:20:04 UTC
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.

Fix: Patch attached with submission follows:
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.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2011-07-28 00:50:47 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-multimedia

Over to maintainer(s).
Comment 2 Andriy Gapon freebsd_committer freebsd_triage 2011-07-28 13:21:27 UTC
I think that for this change to be complete we also need to have a sysctl handler
for hw.snd.default_unit that would appropriately update PCM_CAP_DEFAULT flag.

-- 
Andriy Gapon
Comment 3 David Naylor freebsd_committer freebsd_triage 2014-03-10 20:04:33 UTC
On Thursday, 28 July 2011 15:21:27 Andriy Gapon wrote:
> I think that for this change to be complete we also need to have a sysctl
> handler for hw.snd.default_unit that would appropriately update
> PCM_CAP_DEFAULT flag.

Can you please clarify why a sysctl handler is required?  

My understanding of the code is that dsp_oss_audioinfo() does not store the 
device capabilities but gets called every time dsp_ioctl() is called with 
SNDCTL_ENGINEINFO thus there is no persistent state to update when 
hw.snd.default_unit changes?  
Comment 4 David Naylor freebsd_committer freebsd_triage 2014-12-16 14:24:53 UTC
To my knowledge, Wine was the only software having an issue with this, and it no longer has such a problem.