summaryrefslogtreecommitdiff
path: root/sys/dev/audio.c
AgeCommit message (Collapse)Author
2018-12-31Use the return value of task_add(9) to determine whether the task wasMark Kettenis
already scheduled and whether we have to unref the device ourselves. ok tedu@, ratchov@
2018-12-27must remember to unref device if setting the task isn't done.Ted Unangst
ok anton
2018-10-31sc argument of start_output, start_input, trigger_output and trigger_inputmiko
is void* so no need to cast; ok ratchov@
2018-06-24Save all mixer elements in the suspend/resume array instead of onlyAlexandre Ratchov
enum, sets, and values. This is simpler and less error prone. This fixes the record.enable elements replacing the last few hardware mixer controls. Help from Laurence Tratt, tested by landry@
2018-05-26In addition to "on" and "off", allow the audio "record.enable" mixerAlexandre Ratchov
knob to take the new "sysctl" value, which is the default. In this case, the device behavior is determined by the new "kern.audio.record" sysctl(2), which defaults to zero. ok florian
2018-05-26Add a "record.enable" mixer knob to control recording. When recordingAlexandre Ratchov
is disabled, the device records silence. The control may be modified only by root and defaults to "off", ie. recording is disabled by default. ok florian, deraadt
2018-04-11Add mixer save/restore capability to the audio(4) driver andAlexandre Ratchov
use it during suspend/resume. Remove driver-specific mixer save/restore bits that don't need to be duplicated in every low-lever driver. ok mpi
2018-03-21Fix the way we detect xrun on the recording end, which may prevent theAlexandre Ratchov
ring read pointer from wrapping, in turn allowing the process to read past the ring boundaries. ok deraadt@
2018-01-10Remove assignement of sc->round to itself that makes no sense. FromAlexandre Ratchov
Michael W. Bombardieri, thanks.
2017-11-23No need to grab the audio lock to call audio_canstart() as it checksAlexandre Ratchov
whether the device is started before using structures shared with the interrupt handler. From Michael W. Bombardieri, tested by me.
2017-06-26Factor a variable assignment in audiopoll().Alexandre Ratchov
From Michael Bombardieri, thanks.
2017-05-16Remove references to /dev/soundN, which was removed last year.Alexandre Ratchov
From Jan Stary <hans at stare.cz>, thanks.
2017-05-03style improvement from Michael W. Bombardieri <mb at ii.net>Alexandre Ratchov
2017-03-28Simplify rate/channels/bits bounds checking code. FromAlexandre Ratchov
Michael W. Bombardieri <mb at ii.net>. Thanks.
2017-03-11AUDIO_ENCODING_{S,U}LINEAR constants are neither used by low levelAlexandre Ratchov
drivers nor exposed to user-land. Remove definitions and code to handle convertions.
2017-01-03If gain is above MAX, no need to check whether it's below MIN.Alexandre Ratchov
From Michael W. Bombardieri. Thanks.
2016-12-20Fix many typos. From Michael W. Bombardieri <mb at ii.net>. ThanksAlexandre Ratchov
2016-12-12Remove few useless #ifdef AUDIO_DEBUG, spotted byAlexandre Ratchov
Michael W. Bombardieri <mb at ii.net>. Thanks
2016-11-08Log start/stop of DMA if AUDIO_DEBUG is defined and be less verboseAlexandre Ratchov
about buffer parameters. No behaviour change.
2016-10-09Don't allocate struct mixer_devinfo instances on the stack. It is a fairlyMark Kettenis
large data structure and if the compiler gets clever and inlines some code we hit the stack size compiler warning. This makes things compile with clang. ok ratchov@
2016-10-06Fix the condition used to decide whether to automatically start theAlexandre Ratchov
device, and factor it into a single function. Without this fix, if the device is open in full-duplex mode, it could start with empty play buffer.
2016-10-04At acpithinkpad attach time determine the value of the mute, and deferTheo de Raadt
telling the audio subsystem about this later on in boot. (Mute state is maintained by the BIOS over a suspend, hibernate, reboot, etc -- this may be last missing piece of the puzzle we tore our hair out in Brisbane) diagnosis and code by Anton Lindqvist, ok ratchov
2016-09-19Remove unused getdev() audio driver functions.Alexandre Ratchov
2016-09-14Remove drain(), query_encoding(), mappage() and get_default_params()Alexandre Ratchov
methods from all audio drivers and from the audio_if structure as they are never called.
2016-08-31Delete unused ioctls and associated macros. Move macros that are stillAlexandre Ratchov
used internally by low-level drivers from sys/audioio.h to dev/audio_if.h instead of deleting them.
2016-06-21fix typos in comments and spacingAlexandre Ratchov
2016-06-18Add a new AUDIO_GETSTATUS ioctl to get various audio driver variables.Alexandre Ratchov
It's intended for use with diagnostic tools (like audioctl) and is of no use to audio programs.
2016-06-01New USB device driver for Audio/Video capture devices based on theMarcus Glocker
Fushicai USBTV007 chip. The chip specific code has been written by Lubomir Rintel and Federico Simoncelli. Patrick Keshishian has ported it to OpenBSD and wrote the remaining code based on uvideo(4). Input and help also from mpi@ and ratchov@. ok mpi
2016-05-11Use round_blocksize() to determine the maximum hardware block size (inAlexandre Ratchov
bytes) then, adjust the block size accordingly. Fixes zaudio(4) not starting when large blocks are requested. Found and reported by Andre Smagin <as at smagin.com>, thanks.
2016-05-11Dont reuse "mult" local variable. Use separate variable for hardwareAlexandre Ratchov
block size multiplier (in bytes) and for the driver block size multiplier (in frames). No behaviour change.
2016-03-16Expose new audio ioctls that do one thing only: start and stop DMA,Alexandre Ratchov
set and get parameters. This is much simpler. ok semarie, armani, tweaks from jmc
2016-01-29Move the AUDIO_GETDEV ioctl in its own routine.Alexandre Ratchov
2016-01-20make AUDIO_GETDEV ioctl return the device name (ex "azalia0") ratherAlexandre Ratchov
than driver specific strings. ok kettenis
2016-01-20Set byte order the default encoding in the attach method toAlexandre Ratchov
native byte order. No behaviour change, as attach time parameters are just hints, except thay this makes audioctl output nicer if the device was never opened.
2016-01-09missing breakJonathan Gray
ok ratchov@ deraadt@
2015-12-14"harware" -> "hardware"mmcc
2015-09-04Fix condition used while seaching candidates for "record level"Alexandre Ratchov
control for wskbd. This may fix "record level" keys on certain keyboards.
2015-07-29Fix spacing and be more verbose in printfs under #ifdef AUDIO_DEBUG.Alexandre Ratchov
No binary change.
2015-07-28add missing space, from Donovan Watteau <tsoomi at gmail.com>Alexandre Ratchov
thanks!
2015-07-28In case the system misses enough audio interrupts for DMAAlexandre Ratchov
pointers to wrap, recover by detecting and compensating for the missed interrupts. Fixes certain audio hangs on MP machines. with help from armani@, typos fixed by Alexey Suslikov
2015-07-28Add the AUDIO_GETPOS ioctl() to fetch a snapshot of the 4 countersAlexandre Ratchov
returned by AUDIO_GETxOFFS and AUDIO_xERROR ioctls. ok deraadt
2015-07-24Switch back into counting bytes rather than blocks. We can't justAlexandre Ratchov
multiply the block count by the block size to get the bytes count because they won't wrap correctly.
2015-07-22Represent the current stream position in blocks rather than bytesAlexandre Ratchov
just because it's simpler this way. No behaviour change.
2015-06-25Reimplement the audio driver in a simpler way, removing unused/unusableAlexandre Ratchov
functionality. Same API and ABI except for the removed bits and no behaviour change for programs using libsndio. With help from armani@ and mpi@, thanks.
2015-05-22LITTE_ENDIAN -> LITTLE_ENDIANJonathan Gray
ok ratchov@
2015-05-11Remove all audio format conversion code from the kernel (btw holdingAlexandre Ratchov
the kernel_lock), as we already do better conversions in user-mode. Yet, no need for every single driver to fiddle with the conversion code as they are done transparently by common MI code. With help from armani and miod, support from mpi ok armani@
2015-02-10First step towards making uiomove() take a size_t size argument:Miod Vallat
- rename uiomove() to uiomovei() and update all its users. - introduce uiomove(), which is similar to uiomovei() but with a size_t. - rewrite uiomovei() as an uiomove() wrapper. ok kettenis@
2015-02-07Let a volume key event unmute. This makes the software state follow theMark Kettenis
hardware behaviour on Thinkpads making it harder for software state and hardware state get out of sync. ok deraadt@
2015-01-27remove the second void * argument on tasks.David Gwynne
when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
2015-01-20rework the audio key handling to allocate a message to send to theDavid Gwynne
task, rather than abusing task arguments to carry long values around. this is unreliable, but so was the previous mechanism, just in a different way. if you're so low on memory that you cant change the volume, you probably have other more important problems going on too. tested by jim smith