kern/80974: SIMPLEX flag is not set properly in sound drivers

Hans Petter Selasky hselasky at c2i.net
Fri May 13 12:50:08 GMT 2005


>Number:         80974
>Category:       kern
>Synopsis:       SIMPLEX flag is not set properly in sound drivers
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 13 12:50:07 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     HPS
>Release:        FreeBSD 6.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD 6.0-CURRENT FreeBSD 6.0-CURRENT #45: Mon Mar 21 15:40:17 CET 
2005 root@:/usr/obj/usr/src/sys/custom i386

>Description:

SIMPLEX flag is not set properly in sound drivers

Several device drivers call "pcm_setflags" before "pcm_register". The problem 
is that "pcm_register" clears these flags. Maybe the device drivers should be 
changed, or maybe "pcm_register" should be changed.

>How-To-Repeat:

>Fix:

Here is my solution: In the file "/sys/dev/sound/pcm/sound.c" in the function 
"pcm_register()" "d->flags = 0;" should be changed into:

        /* d->flags = 0; should be cleared by allocator of softc;
         * cannot clear this field here, because several devices set
         * this flag before calling pcm_register()
         */

For example see /sys/dev/sound/isa/sb8.c:
pcm_setflags(dev, pcm_getflags(dev) | SD_F_SIMPLEX);
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list