summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pcm
Commit message (Collapse)AuthorAgeFilesLines
* Wrap the calls to the ISA DMA specific sndbuf_dma*() functions ofmarius2005-06-101-0/+10
| | | | | | | sys/dev/sound/isa/sndbuf_dma.c (compilation depending on device isa) in #ifdef DEV_ISA so sound(4) can be compiled without isa(4). MFC after: 1 month
* Fix the output ports on the AD1988 codec. From the submitter:scottl2005-04-101-0/+1
| | | | | | | | | | | | | | | | | | | | | Affects to people WITH an AD1888 codec, the system will output to the port labeled "speaker" instead of microphone. System will work the same in multiple operating systems. If people are currently using their systems with this codec they will need to swap their output ports. I have _not_ checked audio input or line input (basically, I have checked nothing other than line-out). I believe this is an appropriate change, it makes us consistent with documentation, and other operating systems. Furthermore, this feature (playing) is the vast majority of sound activities, so if this makes is right for playback and wrong for recording... playback is more important, and we can fix recoding in the future without worries of screwing people again in the future (since we'll be "right" on the playback). Submitted by: David Cross
* Explicitly hold a reference to the cdev we have just cloned. Thisphk2005-03-312-1/+4
| | | | | closes the race where the cdev was reclaimed before it ever made it back to devfs lookup.
* Use dynamic major number allocation.phk2005-02-274-8/+0
|
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-0626-22/+26
|
* Plug possible memory leak in sound DMA buffer handling. It alsoyongari2004-10-151-9/+24
| | | | | | | changes return code to ENOMEM in case of allocation failure. Approved by: jake (mentor), scottl (co-mentor) Reviewed by: truckman, matk
* Convert sndstat_lock from a mutex to an sx lock. sndstat_read()truckman2004-09-101-26/+29
| | | | | | | | | | | | | | | holds sndstat_lock across a call to uiomove(), which is not legal to do with a mutex because of the possibility that the data transfer could sleep because of a page fault. It is not possible to just unlock the mutex for the uiomove() call without introducing another locking mechanism to prevent the body of sndstat_read() from being re-entered. Converting sndstat_lock to an sx lock is the least complicated change. This is a candidate for RELENG_5. LOR: 030 MFC after: 4 days
* Rename the sound device drivers:tanimura2004-07-162-11/+16
| | | | | | | | | | | | | | - `sound' The generic sound driver, always required. - `snd_*' Device-dependent drivers, named after the sound module names. Configure accordingly to your hardware. In addition, rename the `snd_pcm' module to `sound' in order to sync with the driver names. Suggested by: cg
* Remove DDB. The one user of this macro has been changed to use BVDDB.marcel2004-07-101-1/+0
| | | | | Yes, DDB is unrelated to the debugger with the same acronym. Hence, the change.
* Implement SNDCTL_DSP_SETDUPLEX. This may fix sound apps which want tonetchild2004-07-021-0/+10
| | | | | | use full duplex mode. Approved by: matk
* Fix uninitialized variable, that breaks the build.josef2004-06-251-2/+2
| | | | | | Approved by: hmp Reviewed by: chris Pointy hat to: josef (for ignoring warning)
* Change the possibility to configure pcm(4) via boot/loader.confjosef2004-06-241-8/+7
| | | | | | | | to use boot/device.hints now As discussed on cvs-src@ Reviewed by: Hiten Pandya <hmp@backplane.com>
* Enable pcm to read kenv variables to set default values forjosef2004-06-201-2/+11
| | | | | | | | | | | | | mixer channels. e.g.: pcm0.line=0 to muten input line per default. Approved by: cg Reviewed by: le, stefanf Requested by: Eugene Grosbein <eugen@grosbein.pp.ru> (implicitly) PR: kern/63771
* Second half of the dev_t cleanup.phk2004-06-172-2/+2
| | | | | | | | | | | The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev() Various minor adjustments including handling of userland access to kernel space struct cdev etc.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-165-36/+36
| | | | Bump __FreeBSD_version accordingly.
* Nuke a cryptic and useless diagnostic printf().truckman2004-06-071-1/+0
|
* Add support CS4294sanpei2004-05-081-0/+1
| | | | | PR: kern/66280 Submitted by: Christian Brueffer <chris@unixpages.org>
* Don't do malloc(M_WAITOK) for sound buffers while locks are held.green2004-04-291-1/+1
|
* The newpcm headers currently #define away INTR_MPSAFE and INTR_TYPE_AVgreen2004-04-141-8/+3
| | | | | | | | | | | | | | | | | | because they bogusly check for defined(INTR_MPSAFE) -- something which never was a #define. Correct the definitions. This make INTR_TYPE_AV finally get used instead of the lower-priority INTR_TYPE_TTY, so it's quite possible some improvement will be had on sound driver performance. It would also make all the drivers marked INTR_MPSAFE actually run without Giant (which does seem to work for me), but: INTR_MPSAFE HAS BEEN REMOVED FROM EVERY SOUND DRIVER! It needs to be re-added on a case-by-case basis since there is no one who will vouch for which sound drivers, if any, willy actually operate correctly without Giant, since there hasn't been testing because of this bug disabling INTR_MPSAFE. Found by: "Yuriy Tsibizov" <Yuriy.Tsibizov@gfk.ru>
* Augment /dev/sndstat with the module names, if applicable.matk2004-03-061-0/+6
| | | | Approved by: tanimura (mentor)
* Create a new mutex type for virtual channels. This allows us to gettruckman2004-02-284-29/+24
| | | | | | | | rid of the MTX_DUPOK flag on channel mutexes, which allows witness to do a better job of lock order checking. Nuke snd_chnmtxcreate() since it is no longer needed. Tested by: matk
* Lock channels only as necessary in dsp_ioctl(), and only lock onetruckman2004-02-281-65/+173
| | | | | | | | | | channel at a time unless it is actually necessary to lock both. This avoids problems with lock order reversal and malloc() calls with a mutex held when lower level code unlocks a channel, calls malloc(), and relocks the channel. This also avoids the cost of some unnecessary locking and unlocking. Tested by: matk
* Device megapatch 4/6:phk2004-02-213-0/+6
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* Fix a glitch in my last commit and revert to using selwakeupprimatk2004-02-201-1/+1
| | | | | Noticed by: tanimura Noticed by: truckman
* Fix a long-standing bug where select on vchans doesn't workmatk2004-02-191-3/+13
| | | | | | (never wake up) by iterating over them when they exist. Approved by: tanimura (mentor)
* Change KASSERT() in feed_vchan16() into an explicit test and call totruckman2004-01-288-140/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 in dsp_clone when trying to access a soundmatk2004-01-251-0/+3
| | | | | | | device that doesn't exists. I'm using my discretion and committing without mentor approval since Seigo is away. Noticed by: Maxime Henrion <mux@freebsd.org>
* Sync with DFBSD v.1.16. Add new codecs IDs, fix some spelling.matk2004-01-231-3/+21
| | | | Approved by: des (interim mentor)
* Reduce latency when using the SNDCTL_DSP_RESET ioctl by callingmatk2004-01-201-2/+10
| | | | | | | chn_resetbuf(). Submited by: Pyun YongHyeon <yongari@kt-is.co.kr> Approved by: tanimura (mentor)
* Fix a panic when kldloading a sound driver. Do this by replacing thematk2004-01-205-217/+95
| | | | | | link-list of dev_t's with named variables. Remove used code. Approved by: tanimura (mentor)
* As previously announced: discontinue use of makedev() call in soundcode.phk2004-01-175-55/+170
| | | | | | | | | | | This takes us a lot closer to refcounting dev_t. This patch originally by cg@ with a few minor changes by me. It is largely untested, but has been HEADSUP'ed twice, so presumably people have not found any issues with it. Submitted by: cg@
* The last argument to mtx_init() should be MTX_DEF, not 0. This is not atruckman2003-12-082-2/+2
| | | | functional change since MTX_DEF happens to be defined as 0.
* Fix some locking violations by creating seperate mutex classesmatk2003-12-051-3/+6
| | | | | | | for play and record channels. Approved by: seigo (mentor) Approved by: scottl (re)
* Fix a panic due to holding a lock over calls to uiomove.matk2003-11-273-30/+39
| | | | | | | Pointed out by: Artur Poplawski Explained by: Don Lewis (truckman) Approved by: tanimura (mentor) Approved by: scottl (re)
* Add ID for ALC658 CODEC.kuriyama2003-11-111-0/+1
| | | | | Tested on: GIGABYTE GA-8S655FX-L Reviewed by: orion
* Fix sound LOR problems:scottl2003-11-112-83/+88
| | | | | | | | | | | | | | | | dsp_open: rearrange to only hold one lock at a time dsp_close: ditto mixer_hwvol_init: delete locking, the only consumer seems to be the ess driver and it only call it a creation time, I think the device will be stable across the sleepable malloc. cmi interrupt routine: Release locks while caller chn_intr, either this or do what emu10k1 does which is have no locks at in the interrupt handler. Submitted by: mat@cnd.mcgill.ca
* - Implement selwakeuppri() which allows raising the priority of atanimura2003-11-091-1/+1
| | | | | | | | | | | | | thread being waken up. The thread waken up can run at a priority as high as after tsleep(). - Replace selwakeup()s with selwakeuppri()s and pass appropriate priorities. - Add cv_broadcastpri() which raises the priority of the broadcast threads. Used by selwakeuppri() if collision occurs. Not objected in: -arch, -current
* Recognize the Avance Logic ALC655 codec found on some ICH4/5-baseddes2003-10-121-0/+1
| | | | | | | | motherboards, such as the Gigabyte I848P. PR: kern/54176 Submitted by: Chris Keladis <chris@cmc.optus.net.au> Forgotten by: orion
* update my email address.cg2003-09-0719-20/+20
|
* Add Creative EV1938.orion2003-08-291-0/+2
| | | | | Submitted by: David Xu <davidxu@FreeBSD.org> PR: kern/54810
* When present use ogain instead of master for surround sound channels.orion2003-08-231-14/+14
| | | | | | The latter has lead to reports of broken audio. Do not swap ogain and master when headphones detected.
* Fix an off-by-one error in feed_monotostereo16() that caused theiedowse2003-08-231-1/+1
| | | | | | | | first sample in the buffer to be ignored. The bug caused a repetitive glitch in one of the stereo channels when playing mono sound on configurations that use the monotostereo16 feeder. Reviewed by: orion
* Additional VT1616 id.orion2003-08-211-1/+1
| | | | Submitted by: Greg Lewis
* Apply Rudolf Cejka's patch for:orion2003-08-212-47/+42
| | | | | | | | | | | | o AD1980 hook. o ac97_fix_auxout. and: o Associate AC97_MIX_AUXOUT with SOUND_MIXER_OGAIN rather than SOUND_MIXER_MONITOR. o Add ac97_fix_tone to remove tone controls from mixer if invalid.
* Add patch for AD198x.orion2003-08-212-0/+7
| | | | Submitted by: Oleg Sharoiko, Rudolf Cejka.
* handle locking when creating or destroying vchans bettercg2003-08-182-38/+104
|
* try to make really sshort sounds actually playcg2003-08-181-16/+43
|
* modify commentscg2003-08-151-3/+11
|
* Change gcc-specific aggregate initialization member specifiersdds2003-08-052-12/+12
| | | | | | | into C9X initializer designators. Reviewed by: schweikh (mentor) MFC after: 4 weeks
* * add a function to display a complete feeder chain on the console, forcg2003-07-072-1/+18
| | | | | | | | | debugging. * set the parent of non-format feeders, so that sndstat doesn't miss out things like feeder_rate. MFC: 1 week
OpenPOWER on IntegriCloud