[DragonFlyBSD - Submit #2804] Blocking IO in sound subsystem.

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Wed Mar 18 07:22:59 PDT 2015


Issue #2804 has been updated by shamaz.

File FIONBIO_test.tar.bz2 added
File fionbio_master.patch added

Well, this is what I got. My solution is somewhat ugly, but let you be the judge.

fionbio_master.patch makes fcntl call an appropriate ioctl on the file pointer if O_NONBLOCK flag is requested (patch to sys/kern/kern_descrip.c)
All other changes to the kernel were made to ioctl implementations to make them return 0 (no error) if a corresponding device or whatever supports non-blocking mode. These specific implementations do not need to do anything on their own, so they just return 0. PCM subsystem, on the other hand, finally executes its ioctl call and does everything it needs to switch back to non-blocking mode.

To be sure, that this does not break anything, I wrote a set of tests that checks if O_NONBLOCK flag can be set to any of the typical descriptor types: kqueues, pipes, sockets, vnodes (including regular files, some character/block devices, klog device) etc. All of them must silently return if executed (maybe with exception of klog, as you may have not permissions to open /dev/klog).

There is test_dsp.c in the set to test pcm subsystem. It must play 6 second silence and silently quit.

----------------------------------------
Submit #2804: Blocking IO in sound subsystem. 
http://bugs.dragonflybsd.org/issues/2804#change-12625

* Author: yellowrabbit2010
* Status: New
* Priority: Normal
* Assignee: 
* Category: Driver
* Target version: 
----------------------------------------

Reapply old patch to the new sound system

>commit 3e2b80a43e8d3778b07c4680c8a2719cd4c7f621
>Author: Hasso Tepper <hasso at dragonflybsd.org>
>Date:   Mon Oct 8 17:55:00 2007 +0000
>    Dragonfly always passes a flag for every IO operation depending whether
>    the mode of the operation or of the fd is set to NBIO, but it doesn't
>    pass down fcntl() changes to the drivers. So, if you open /dev/dsp with
>    NONBLOCK and later fcntl it to blocking, the sound driver won't be aware
>    of this fact.

>    Fix: don't maintain this setting in the sound driver.

>    Requested and tested by corecode at .


---Files--------------------------------
sound.patch (645 Bytes)
FIONBIO_test.tar.bz2 (6.7 KB)
fionbio_master.patch (4.54 KB)


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account



More information about the Submit mailing list