summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pcm/buffer.h
Commit message (Collapse)AuthorAgeFilesLines
* Change KASSERT() in feed_vchan16() into an explicit test and call totruckman2004-01-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | panic() so that the buffer overflow just beyond this point is always caught, even when the code is not compiled with INVARIANTS. Change chn_setblocksize() buffer reallocation code to attempt to avoid the feed_vchan16() buffer overflow by attempting to always keep the bufsoft buffer at least as large as the bufhard buffer. Print a diagnositic message Danger! %s bufsoft size increasing from %d to %d after CHANNEL_SETBLOCKSIZE() if our best attempts fail. If feed_vchan16() were to be called by the interrupt handler while locks are dropped in chn_setblocksize() to increase the size bufsoft to match the size of bufhard, the panic() code in feed_vchan16() will be triggered. If the diagnostic message is printed, it is a warning that a panic is possible if the system were to see events in an "unlucky" order. Change the locking code to avoid the need for MTX_RECURSIVE mutexes. Add the MTX_DUPOK option to the channel mutexes and change the locking sequence to always lock the parent channel before its children to avoid the possibility of deadlock. Actually implement locking assertions for the channel mutexes and fix the problems found by the resulting assertion violations. Clean up the locking code in dsp_ioctl(). Allocate the channel buffers using the malloc() M_WAITOK option instead of M_NOWAIT so that buffer allocation won't fail. Drop locks across the malloc() calls. Add/modify KASSERTS() in attempt to detect problems early. Abuse layering by adding a pointer to the snd_dbuf structure that points back to the pcm_channel that owns it. This allows sndbuf_resize() to do proper locking without having to change the its API, which is used by the hardware drivers. Don't dereference a NULL pointer when setting hw.snd.maxautovchans if a hardware driver is not loaded. Noticed by Ryan Sommers <ryans at gamersimpact.com>. Tested by: Stefan Ehmann <shoesoft AT gmx.net> Tested by: matk (Mathew Kanner) Tested by: Gordon Bergling <gbergling AT 0xfce3.net>
* Fix a panic due to holding a lock over calls to uiomove.matk2003-11-271-1/+0
| | | | | | | Pointed out by: Artur Poplawski Explained by: Don Lewis (truckman) Approved by: tanimura (mentor) Approved by: scottl (re)
* update my email address.cg2003-09-071-1/+1
|
* Implement a "sndbuf_getbufaddr" function and use it instead of vtophys().cognet2003-02-201-0/+3
| | | | Reviewed by: orion
* - Clean up ISA DMA supports.nyan2003-02-071-9/+29
| | | | | | | - Rename all sndbuf_isadma* functions to sndbuf_dma* and move them into sys/dev/sound/isa/sndbuf_dma.c. No response from: sound
* * improve error handlingcg2002-01-261-1/+1
| | | | | | | | | | * be more specific in verbose boot messages * allow the feeder subsystem to veto pcm* attaching if there is an error initialising the root feeder * don't free/malloc a new tmpbuf when resizing a snd_dbuf to the same size as it currently is * store the feeder description in the feeder structure instead of mallocing space for it
* don't erase info in sndbuf_setup()cg2001-05-271-0/+1
| | | | | set free'd pointers to NULL in sndbuf_free() add a new function
* mega-commit.cg2001-03-241-19/+65
| | | | | | | | | | | | | | | this introduces a new buffering mechanism which results in dramatic simplification of the channel manager. as several structures have changed, we take the opportunity to move their definitions into the source files where they are used, make them private and de-typedef them. the sound drivers are updated to use snd_setup_intr instead of bus_setup_intr, and to comply with the de-typedefed structures. the ac97, mixer and channel layers have been updated with finegrained locking, as have some drivers- not all though. the rest will follow soon.
* update code dealing with snd_dbuf objects to do so using a functional interfacecg2000-12-231-0/+49
modify chn_setblocksize() to pick a default soft-blocksize appropriate to the sample rate and format in use. it will aim for a power of two size small enough to generate block sizes of at most 20ms. it will also set the hard-blocksize taking into account rate/format conversions in use. update drivers to implement setblocksize correctly: updated, tested: sb16, emu10k1, maestro, solo updated, untested: ad1816, ess, mss, sb8, csa not updated: ds1, es137x, fm801, neomagic, t4dwave, via82c686 i lack hardware to test: ad1816, csa, fm801, neomagic others will be updated/tested in the next few days.
OpenPOWER on IntegriCloud