aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/soundcard.h
Commit message (Collapse)AuthorAgeFilesLines
* sys: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-4/+0
| | | | Notes: svn path=/head/; revision=365223
* SPDX: mostly fixes to previous changes.Pedro F. Giffuni2017-12-131-0/+2
| | | | | | | | Introduce the recently approved BSD-1-Clause and replace 0BSD which never did fit well our use cases. Notes: svn path=/head/; revision=326823
* Don't test for INKERNEL to check whether we're in kernel space.Ed Schouten2016-06-041-1/+1
| | | | | | | | | | | | | It turns out that <machine/param.h> actually defines a macro under this name, even when we're not in kernelspace. This causes us to suppress some macro definitions that are used by userspace apps. PR: 210026 Reported by: jbeich@ MFC after: 2 weeks Notes: svn path=/head/; revision=301406
* sys/sys: minor spelling fixes.Pedro F. Giffuni2016-05-031-2/+2
| | | | | | | | | While the changes are minor, these headers are very visible. MFC after: 2 weeks Notes: svn path=/head/; revision=298981
* add SNDCTL_DSP_HALT specified by OSSAndriy Gapon2011-06-291-1/+2
| | | | | | | | | | | | This is really a new name for SNDCTL_DSP_RESET. And this what commit r222723 should really have been in the first place. PR: kern/156874 Submitted by: gerald MFC after: 1 week Notes: svn path=/head/; revision=223663
* revert r222723: wrong change was committedAndriy Gapon2011-06-291-2/+1
| | | | | | | | | | | The commit intended to add SNDCTL_DSP_HALT, but actually added SNDCTL_SEQ_HALT, which is not defined in the OSS specs. Reported by: Pan Tsu <inyaoo@gmail.com> Pointyhat to: gerald, avg Notes: svn path=/head/; revision=223662
* add SNDCTL_DSP_HALT specified by OSSAndriy Gapon2011-06-051-1/+2
| | | | | | | | | | | This is really a new name for SNDCTL_DSP_RESET. PR: kern/156874 Submitted by: gerald MFC after: 1 week Notes: svn path=/head/; revision=222723
* Move machine dependant AFMT_* definition from sound.hAriff Abdullah2009-06-101-6/+29
| | | | | | | to global soundcard.h . Notes: svn path=/head/; revision=193886
* Sound Mega-commit. Expect further cleanup until code freeze.Ariff Abdullah2009-06-071-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For a slightly thorough explaination, please refer to [1] http://people.freebsd.org/~ariff/SOUND_4.TXT.html . Summary of changes includes: 1 Volume Per-Channel (vpc). Provides private / standalone volume control unique per-stream pcm channel without touching master volume / pcm. Applications can directly use SNDCTL_DSP_[GET|SET][PLAY|REC]VOL, or for backwards compatibility, SOUND_MIXER_PCM through the opened dsp device instead of /dev/mixer. Special "bypass" mode is enabled through /dev/mixer which will automatically detect if the adjustment is made through /dev/mixer and forward its request to this private volume controller. Changes to this volume object will not interfere with other channels. Requirements: - SNDCTL_DSP_[GET|SET][PLAY|REC]_VOL are newer ioctls (OSSv4) which require specific application modifications (preferred). - No modifications required for using bypass mode, so applications like mplayer or xmms should work out of the box. Kernel hints: - hint.pcm.%d.vpc (0 = disable vpc). Kernel sysctls: - hw.snd.vpc_mixer_bypass (default: 1). Enable or disable /dev/mixer bypass mode. - hw.snd.vpc_autoreset (default: 1). By default, closing/opening /dev/dsp will reset the volume back to 0 db gain/attenuation. Setting this to 0 will preserve its settings across device closing/opening. - hw.snd.vpc_reset (default: 0). Panic/reset button to reset all volume settings back to 0 db. - hw.snd.vpc_0db (default: 45). 0 db relative to linear mixer value. 2 High quality fixed-point Bandlimited SINC sampling rate converter, based on Julius O'Smith's Digital Audio Resampling - http://ccrma.stanford.edu/~jos/resample/. It includes a filter design script written in awk (the clumsiest joke I've ever written) - 100% 32bit fixed-point, 64bit accumulator. - Possibly among the fastest (if not fastest) of its kind. - Resampling quality is tunable, either runtime or during kernel compilation (FEEDER_RATE_PRESETS). - Quality can be further customized during kernel compilation by defining FEEDER_RATE_PRESETS in /etc/make.conf. Kernel sysctls: - hw.snd.feeder_rate_quality. 0 - Zero-order Hold (ZOH). Fastest, bad quality. 1 - Linear Interpolation (LINEAR). Slightly slower than ZOH, better quality but still does not eliminate aliasing. 2 - (and above) - Sinc Interpolation(SINC). Best quality. SINC quality always start from 2 and above. Rough quality comparisons: - http://people.freebsd.org/~ariff/z_comparison/ 3 Bit-perfect mode. Bypasses all feeder/dsp effects. Pure sound will be directly fed into the hardware. 4 Parametric (compile time) Software Equalizer (Bass/Treble mixer). Can be customized by defining FEEDER_EQ_PRESETS in /etc/make.conf. 5 Transparent/Adaptive Virtual Channel. Now you don't have to disable vchans in order to make digital format pass through. It also makes vchans more dynamic by choosing a better format/rate among all the concurrent streams, which means that dev.pcm.X.play.vchanformat/rate becomes sort of optional. 6 Exclusive Stream, with special open() mode O_EXCL. This will "mute" other concurrent vchan streams and only allow a single channel with O_EXCL set to keep producing sound. Other Changes: * most feeder_* stuffs are compilable in userland. Let's not speculate whether we should go all out for it (save that for FreeBSD 16.0-RELEASE). * kobj signature fixups, thanks to Andriy Gapon <avg@freebsd.org> * pull out channel mixing logic out of vchan.c and create its own feeder_mixer for world justice. * various refactoring here and there, for good or bad. * activation of few more OSSv4 ioctls() (see [1] above). * opt_snd.h for possible compile time configuration: (mostly for debugging purposes, don't try these at home) SND_DEBUG SND_DIAGNOSTIC SND_FEEDER_MULTIFORMAT SND_FEEDER_FULL_MULTIFORMAT SND_FEEDER_RATE_HP SND_PCM_64 SND_OLDSTEREO Manual page updates are on the way. Tested by: joel, Olivier SMEDTS <olivier at gid0 d org>, too many unsung / unnamed heroes. Notes: svn path=/head/; revision=193640
* Import some new constants and structures fields from OSSv4.Alexander Motin2009-01-101-14/+93
| | | | | | | | Implement some OSSv4 ioctls to make ossinfo tool work and print something reasonable. Notes: svn path=/head/; revision=187030
* Add some new oss_sysinfo structure fields from OSSv4.Alexander Motin2009-01-071-1/+4
| | | | Notes: svn path=/head/; revision=186875
* MFP4 (109713):Alexander Leidinger2006-11-261-0/+5
| | | | | | | | | | | Add OSS_GETVERSION ioctl for compatibility. Some ports expect this and fail to compile on -current ATM. Submitted by: ryanb Notes: svn path=/head/; revision=164613
* MFP4:Alexander Leidinger2006-10-281-2/+2
| | | | | | | | | | | | | Rename MAX_SAMPLE_RATES macro to OSS_MAX_SAMPLE_RATES. The old macro clashed with those used in other applications and libaries (ex: RtAudio). 4Front responded by updating their spec, so we will follow suit. Submitted by: ryanb Noticed by: pointyhat/kris Notes: svn path=/head/; revision=163731
* MFp4 the sound Google Summer of Code project:Alexander Leidinger2006-09-231-3/+436
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal was to sync with the OSSv4 API 4Front Technologies uses in their proprietary OSS driver. This was successful as far as possible. The part of the API which is stable is implemented, for the rest there are some stubs already. New system ioctls: - SNDCTL_SYSINFO - obtain audio system info (version, # of audio/midi/ mixer devices, etc.) - SNDCTL_AUDIOINFO - fetch details about a specific audio device - SNDCTL_MIXERINFO - fetch details about a specific mixer device New audio ioctls: - Sync groups (SNDCTL_DSP_SYNCGROUP/SNDCTL_DSP_SYNCSTART) which allow triggered playback/recording on multiple devices (even across processes simultaneously). - Peak meters (SNDCTL_DSP_GETIPEAKS/SNDCTL_DSP_GETOPEAKS) - can query audio drivers for peak levels (needs driver support, disabled for now). - Per channel playback/recording levels - SNDCTL_DSP_{GET,SET}{PLAY,REC}VOL. Note that these are still in name only, just wrapping around the AC97-style mixer at the moment. The next step is to push them down to the drivers. Audio ioctls still under development by 4Front (for which stubs may exist in this commit): - SNDCTL_GETNAME, SNDCTL_{GET,SET}{SONG,LABEL} - SNDCTL_DSP_{GET,SET}_CHNORDER - SNDCTL_MIX_ENUMINFO, SNDCTL_MIX_EXTINFO - (might be documented enough in the OSS releases to work on this. These ioctls cover the cool "twiddle any knob on your card" features.) Missing: - SNDCTL_DSP_COOKEDMODE -- this ioctl is used to give applications direct access to a card's buffers, bypassing the feeder architecture. It's a toughy -- "someone" needs to decide : (a) if this is desireable, and (b) if it's reasonably feasible. Updates for driver writers: So far, only two routines to the channel class (in channel_if.m) are added. One is for fetching a list of discrete supported playback/recording rates of a channel, and the other is for fetching peak level info (useful for drawing peak meters). Interested parties may want to help pushing down SNDCTL_DSP_{GET,SET}{PLAY,REC}VOL into the drivers. To use the new stuff you need to rebuild the sound drivers or your kernel (depending on if you use modules or not) and to install soundcard.h (a buildworld/installworld handles this). Sponsored by: Google SoC 2006 Submitted by: ryanb Many thanks to: 4Front Technologies for their cooperation, explanations and the nice license of their soundcard.h. Notes: svn path=/head/; revision=162588
* OSS defines AFMT_x32_xE as:Alexander Leidinger2005-07-311-0/+4
| | | | | | | | | | | | | | | | | | | | | | 1) 32bit data, packed within 32bit (4bytes) boundary. 2) 24bit data, packed within 32bit (4bytes) boundary where the data is stored in the 24 most significant bits and least significant 8 bits are not used and should be set to 0. While this might hold true in few cases, lots of applications (notably mplayer, sweep) really deal / produce 24bit as what they should meant to be: 24bit data / 3bytes per sample. To handle this "true" 24bit pcm format add AFMT_x24_xE, so the in-kernel conversion space did not confuse itself with 32bit variant. You need to rebuild mplayer after installing this change (this header and the upcomming kernel changes), if you want to use this new feature. Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my> Tested by: multimedia@ Notes: svn path=/head/; revision=148605
* /* -> /*- for license, minor formatting changesWarner Losh2005-01-071-1/+3
| | | | Notes: svn path=/head/; revision=139825
* New defines that paves the way for new midi features and ports.Mathew Kanner2003-11-221-0/+2
| | | | | | | | | | | | Changes consists of an IOCTL (SNDCTL_SEQ_GETTIME) and a constant. PR: kern/59233 Approved by: tanimura (mentor) Approved by: scottl (re) MFC after: 3 weeks Notes: svn path=/head/; revision=122954
* add a few missing bits for future useCameron Grant2003-08-151-1/+27
| | | | Notes: svn path=/head/; revision=118923
* My previous commit broke builds for restricted namespaces. AddMartin Blapp2003-05-041-1/+1
| | | | | | | | | a underscore to fix this. Reviewed by: peter Notes: svn path=/head/; revision=114642
* Define AFMT_S16_NE for "16-bit signed format in machine'sMartin Blapp2003-04-281-0/+8
| | | | | | | | | | | native endian convention. Needed by newer OSS ports. Reviewed by: orion PR: 27270 MFC: 2 weeks Notes: svn path=/head/; revision=114181
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,Jens Schweikhardt2003-01-011-2/+2
| | | | | | | especially in troff files. Notes: svn path=/head/; revision=108533
* Remove __PAlfred Perlstein2002-03-191-1/+1
| | | | Notes: svn path=/head/; revision=92719
* Correct the URL to the Hacker's Guide to Voxware.George C A Reid2001-08-211-3/+3
| | | | | | | | PR: 29896 Submitted by: Gerhard Gonter <gonter@whisky.wu-wien.ac.at> Notes: svn path=/head/; revision=82033
* Extend comments documenting various supported audio formats and mixer devices.Maxim Sobolev2001-08-181-37/+54
| | | | | | | | | | Reviewed by: ru, cg Approved by: cg Obtained from: 4Front's OSS Programming Guide MFC after: 2 weeks Notes: svn path=/head/; revision=81891
* add 32bit formats and a couple of ioctlsCameron Grant2000-09-011-26/+36
| | | | Notes: svn path=/head/; revision=65335
* Finally merge newmidi.Seigo Tanimura2000-07-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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 Notes: svn path=/head/; revision=62947
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"Peter Wemm1999-12-291-1/+1
| | | | | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come. Notes: svn path=/head/; revision=55205
* tanimura implemented SNDCTL_DSP_GETODELAY for pcm.Alfred Perlstein1999-11-291-0/+1
| | | | | | | Submitted by: tanimura Notes: svn path=/head/; revision=53901
* Make the idempotency ifdefs uniform with the rest of src/sys/sys.Doug Rabson1999-09-041-3/+3
| | | | Notes: svn path=/head/; revision=50906
* Fixed a gratuitous ANSIism again. The fix in rev.1.23 was blown awayBruce Evans1999-09-041-1/+1
| | | | | | | in rev.1.25. Notes: svn path=/head/; revision=50902
* Add $FreeBSD$Peter Wemm1999-09-011-0/+2
| | | | Notes: svn path=/head/; revision=50734
* o sys/i386/include/soundcard.hKATO Takenori1999-04-081-1/+1
| | | | | | | | | | | | Reduce synth_info.name lenght for binary compatibility. o sys/i386/isa/sound/mpu401.c Reduce mpu device number info to avoid overflow of mpu_synth_info.name. Submitted by: Akio Morita <amorita@meadow.scphys.kyoto-u.ac.jp> Notes: svn path=/head/; revision=45462
* o sys/i386/include/soundcard.hKATO Takenori1999-04-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Sound Card ID for the nss(NEC PC-9801-86 Sound System) driver. Old name of this driver was pcm driver in FreeBSD 2.2.x. Fix lack of the length of the name member of the synth_info structure. (attach_mpu401 in sys/i386/isa/sound/mpu401.c requires 33 chars.) o sys/i386/isa/sound/dev_table.h Add the DMAbuf flags definition DMA_DISABLE. Add the nss driver entry. o sys/i386/isa/sound/dmabuf.c Add the DMA_DISABLE flag check in DMAbuf_outputintr and DMAbuf_inputintr to disable DMA control in FIFO only use (nss driver required). o sys/i386/isa/sound/local.h Add the nss driver entry. o sys/i386/isa/sound/mpu401.c Replace inb function in probe_mpu401 to mpu401_status macro. Wrap macro argument for above replace. Add I/O port maping macro for NEC PC-98x1 arch. Add delay in NEC PC-98x1 arch. o sys/i386/isa/sound/pcm86.c Change driver name to avoid name space conflict to new pcm driver. Fix NEC PC-9801-86 driver to work on RELENG_3 branch or latter. o sys/i386/isa/sound/sound_calls.h Fix the mpuintr definition. Add the nss driver entry. attach_nss, probe_nss, nssintr o sys/i386/isa/sound/soundcard.c Fix lack of the mpuintr registration. Add the nss driver entry. o sys/pc98/conf/files.pc98 Add the nss driver entry. Reviewed by: kato Submitted by: Akio Morita <amorita@meadow.scphys.kyoto-u.ac.jp> Notes: svn path=/head/; revision=45240
* soundcard.h wasn't upgraded when i386/isa/snd wasMarc G. Fournier1998-02-181-0/+42
| | | | Notes: svn path=/head/; revision=33530
* Upgrade Luigi's audio driver to Jan/23 version... will bring in Feb/15thMarc G. Fournier1998-02-171-303/+458
| | | | | | | | | | version as soon as I've tested it... Installed/tested on my home machine...any problems, please report directly to me. Notes: svn path=/head/; revision=33473
* Enable NEC 86 sound card when PC98 is defined.KATO Takenori1998-02-171-0/+3
| | | | | | | Submitted by: Takahashi Yoshihiro <nyan@wyvern.cc.kogakuin.ac.jp> Notes: svn path=/head/; revision=33453
* Fixed a gratuitous ANSIism.Bruce Evans1998-02-031-1/+1
| | | | Notes: svn path=/head/; revision=33048
* update the AWE32 wave table driver to Iwai's 0.4.2c version. This alsoJohn-Mark Gurney1998-01-081-0/+1
| | | | | | | | | includes the patches to make it work under -current from Randall Hopper. Remove the old AWE driver. Notes: svn path=/head/; revision=32348
* Add back a #include <sys/types.h> so that this header isSteve Price1997-12-281-0/+1
| | | | | | | | | | | self-sufficient again. This is a quick fix that should really be remedied by removing all of the gratuitous changes made in revision 1.20. PR: 5351 Notes: svn path=/head/; revision=32065
* Upgrade the sound sources to Amancio Hasty's latest-and-greatest.Mark Murray1997-10-311-247/+354
| | | | | | | | | This is based on Voxware 3.5, and corresponds to Amancio's `guspnp21'. Bug reports to Amancio, please! Notes: svn path=/head/; revision=30866
* Bug fix for SNDCTL_DSP_GETOSPACE ioctl. It would report 0 bytesSteven Wallace1997-02-121-0/+1
| | | | | | | | | | | available in buffer when buffer was completely empty. It now correctly reports the total buffer space available. Reviewed by: jkh, davidg Obtained from: Linux 1.3.20's sound driver code Notes: svn path=/head/; revision=22580
* Commit AWE32 changes I forgot in my first round. Whoops!Jordan K. Hubbard1996-11-161-0/+3
| | | | Notes: svn path=/head/; revision=19807
* Cleaned up all headers that include <sys/ioctl.h> or <sys/ioccom.h>:Bruce Evans1996-09-211-5/+7
| | | | | | | | | | | | | | | | - don't include <sys/ioctl.h> in any header. Include <sys/ioccom.h> instead. This was already done in 4.4Lite for the most important ioctl headers. Header spam currently increases kernel build times by 10-20%. There are more than 30000 #includes (not counting duplicates) for compiling LINT. - include <sys/types.h> if and only it is necessary to make the header almost self-sufficient (some ioctl headers still need structs from elsewhere). - uniformized idempotency ifdefs. Copied the style in the 4.4Lite ioctl headers. Notes: svn path=/head/; revision=18444
* The Great PC98 Merge.Satoshi Asami1996-06-141-0/+3
| | | | | | | | | | | All new code is "#ifdef PC98"ed so this should make no difference to PC/AT (and its clones) users. Ok'd by: core Submitted by: FreeBSD(98) development team Notes: svn path=/head/; revision=16363
* Fix a bunch of spelling errors in the comment fields ofMike Pritchard1996-01-301-5/+5
| | | | | | | a bunch of system include files. Notes: svn path=/head/; revision=13765
* Merge in changes for VOXWARE 3.05Jordan K. Hubbard1995-07-281-59/+167
| | | | | | | Submitted by: Amancio Hasty and Jim Lowe Notes: svn path=/head/; revision=9750
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-25/+25
| | | | Notes: svn path=/head/; revision=8876
* Remove redundant IORW definition..Ugen J.S. Antsilevich1995-03-081-23/+1
| | | | | | | | | because of this definition never ioctl's for sound devices worked..For me this resulted also in loss of snd1 device... Notes: svn path=/head/; revision=6959
* The following patches are for the sound drivers. These changes willJordan K. Hubbard1995-02-131-2/+4
| | | | | | | | | | add a an ioctl call to set the transfer block size (SNDCTL_DSP_SETBLKSIZE) and add the select system call to the drivers. They also fix a problem with the #EXCLUDE macros for the PAS-16 card. Submitted by: Jim Lowe <james@blatz.cs.uwm.edu> Notes: svn path=/head/; revision=6347
* Remove extra idempotency ifdef and uniformize the other one.Bruce Evans1994-11-141-9/+6
| | | | | | | Comment about support for 4 different spellings of KERNEL. Notes: svn path=/head/; revision=4472