summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pcm/mixer.c
Commit message (Collapse)AuthorAgeFilesLines
* Explicitly hold a reference to the cdev we have just cloned. Thisphk2005-03-311-1/+3
| | | | | closes the race where the cdev was reclaimed before it ever made it back to devfs lookup.
* Use dynamic major number allocation.phk2005-02-271-1/+0
|
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* 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-171-1/+1
| | | | | | | | | | | 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-161-11/+11
| | | | Bump __FreeBSD_version accordingly.
* Device megapatch 4/6:phk2004-02-211-0/+2
| | | | | | | | 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.
* As previously announced: discontinue use of makedev() call in soundcode.phk2004-01-171-9/+10
| | | | | | | | | | | 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@
* Fix sound LOR problems:scottl2003-11-111-2/+0
| | | | | | | | | | | | | | | | 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
* update my email address.cg2003-09-071-1/+1
|
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-13/+5
| | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl)
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* (hopefully) fix build breakage some people are seeingcg2002-11-261-1/+1
| | | | Approved by: re
* Fix some of the places where sound(4) can sleep with a lock held. (Helpgreen2002-07-251-0/+2
| | | | courtesy of fenner).
* Use semicolons at the end of function-like macros for the sake ofmarkm2002-07-151-1/+1
| | | | consistency, style and future cleanliness.
* Add lock type arguments to callers of snd_mtxcreate().jhb2002-04-041-1/+1
|
* KSE Milestone 2julian2001-09-121-3/+3
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* MFS: allow multiple opens of mixer devicescg2001-08-231-8/+11
|
* many changes:cg2001-08-231-6/+4
| | | | | | | | | | | | | | | * add new channels to the end of the list so channels used in order of addition * de-globalise definition of struct snddev_info and provide accessor functions where necessary. * move the $FreeBSD$ tag in each .c file into a macro and allow the /dev/sndstat handler to display these when set to maximum verbosity to aid debugging. * allow each device to register its own sndstat handler to reduce the amount of groping sndstat must do in foreign structs.
* set default 'monitor' volume (ac97 headphones) to 75%cg2001-07-011-0/+1
|
* add defines and ifdefs so this code will compile on 4.xcg2001-06-231-3/+21
| | | | add spls so this code will work on 4.x
* use a global devclass for all drivers - i'm not entirely sure why thiscg2001-06-161-79/+172
| | | | | | | | | | | | | | | worked before. mixer, dsp and sndstat are seperate devices - give them their own cdevsws instead of demuxing requests sent to a single cdevsw. use the si_drv1/si_drv2 fields in dev_t structures for holding information specific to an open instance of mixer/dsp. nuke /dev/{dsp,dspW,audio}[0-9]* links - this functionality is now provided using cloning. various locking fixes.
* mega-commit.cg2001-03-241-63/+75
| | | | | | | | | | | | | | | 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.
* MFS: 4.x/5.x compatibility #ifdefscg2001-02-271-0/+6
|
* - Move all of the hwvol functions into a mixer_hwvol_* namespace, and makejhb2001-01-111-10/+16
| | | | | | | | | | | all of the hwvol members of struct snd_mixer live in a hwvol_* namespace. - When changing the mixer device via the hwvol_mixer sysctl, reset the muted state so that a mute operation on a new device won't try to unmute the new device with the old device's saved volume. - When the volume is muted, if a down or up volume request is received, first restore the saved volume level and then adjust it. Reviewed by: cg
* - Make the 'hwvol_mixer' and 'hwvol_step' variables be specific to ajhb2001-01-051-9/+66
| | | | | | | | | | | | | | | | | | specific snd_mixer device rather than global across all mixers. - Add per-mixer mute status and saved mute_level so that the mixer_hwmute() function can now toggle the mute state when the mute button is pressed. - Create a dynamic sysctl tree hw.snd.pcmX when a pcm device is registered. - Move the hw.snd.hwvol_* sysctl's to hw.snd.pcmX.hwvol_* so that they are now properly device-specific. Eventually when the mixers become their own devices these sysctl's will move to live under a mixerX tree. - Change the interface of the hwvol_mixer sysctl so that it reports the name of the current mixer device instead of the number and is settable with the name instead of the number. - Add a new function mixer_hwinit() used to setup the dynamic sysctl's needed for the hwvol support that can be called by drivers that support hwvol. Reviewed by: cg
* Add a new API for soundcards that have hardware volume control:jhb2001-01-031-0/+36
| | | | | | | | | | | | - The mixer_hwmute() function can be called when a soundcard receives a mute request. - The mixer_hwstep() function can be used to adjust the volume of one or both channels. - The 'hw.snd.hwvol_step' sysctl determines the amount that mixer_hwstep() adjusts the volume by on each call. - The 'hw.snd.hwvol_mixer' sysctl specifies the mixer device to adjust the volume on for both functions. The values used correspond to the SOUNDCARD_MIXER_* constants.
* update code dealing with snd_dbuf objects to do so using a functional interfacecg2000-12-231-2/+2
| | | | | | | | | | | | | | | 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.
* kobjify.cg2000-12-181-108/+141
| | | | | | | | | | this gives us several benefits, including: * easier extensibility- new optional methods can be added to ac97/mixer/channel classes without having to fixup every driver. * forward compatibility for drivers, provided no new mandatory methods are added.
* add reinit functions to mixerscg2000-10-261-6/+13
| | | | | unstaticize chn_start() add reset/resetdone functions to channels
* Fix warnings by moving static functions before they are used.peter2000-09-031-39/+39
|
* add a missing return statement, doh.cg2000-09-021-0/+1
|
* change mixer api slightlycg2000-09-011-6/+35
| | | | | | | | | change channel interface - kobj implementation coming soonish make pcm_makelinks not panic if modular add pcm_unregister() these changes support newpcm kld unloading, but this is only implemented by ds1.c
* Finally merge newmidi.tanimura2000-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (I had been busy for my own research activity until the last weekend) Supported devices: SB Midi Port (sbc + midi) SB OPL3 (sbc + midi) 16550 UART (midi, needs a trick in your hint) CS461x Midi Port (csa + midi) OSS-compatible sequencer (seq) Supported playing software: playmidi (We definitely need more) Notes: /dev/midistat now reports installed midi drivers. /dev/sndstat reports only pcm drivers. We need the new name(pcmstat?). EMU8000(SB AWE) does not sound yet but does get probed so that the OPL3 synth on an AWE card works. TODO: MSS/PCI bridge drivers Midi-tty interface to support general serial devices Modules
* make mixer reads return the value written instead of the value setcg2000-06-191-1/+1
| | | | people seem to want this even though it breaks oss spec compliance
* add a function to reinitialize the mixer, to be called by drivers oncg2000-03-201-0/+13
| | | | resuming after suspend
* repo-copied to make way for newmidi, this commit updates include pathscg1999-11-201-1/+1
|
* set default ogain to 50 since some sb cards produce no sound at 0cg1999-11-151-0/+1
|
* $Id$ -> $FreeBSD$peter1999-09-011-1/+1
|
* say hello to newpcm. it is not yet enabled, requiring new pnp code from dfrcg1999-09-011-0/+202
to compile successfully. further details will be provided in the commit enabling newpcm.
OpenPOWER on IntegriCloud