summaryrefslogtreecommitdiff
path: root/sys/dev/sound/isa/ess.c
Commit message (Collapse)AuthorAgeFilesLines
* sound: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-5/+0
| | | | Notes: svn path=/head/; revision=365085
* Add ISA PNP tables to ISA drivers. Fix a few incidental comments.Warner Losh2018-01-291-0/+1
| | | | | | | ACPI ISA PBP tables not tagged, there's bigger issues with them. Notes: svn path=/head/; revision=328524
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Replace 0 with NULL for pointers in misc. device drivers.Pedro F. Giffuni2016-04-121-4/+4
| | | | | | | Found with devel/coccinelle. Notes: svn path=/head/; revision=297862
* Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.Justin Hibbits2016-03-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some architectures, u_long isn't large enough for resource definitions. Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, but type `long' is only 32-bit. This extends rman's resources to uintmax_t. With this change, any resource can feasibly be placed anywhere in physical memory (within the constraints of the driver). Why uintmax_t and not something machine dependent, or uint64_t? Though it's possible for uintmax_t to grow, it's highly unlikely it will become 128-bit on 32-bit architectures. 64-bit architectures should have plenty of RAM to absorb the increase on resource sizes if and when this occurs, and the number of resources on memory-constrained systems should be sufficiently small as to not pose a drastic overhead. That being said, uintmax_t was chosen for source clarity. If it's specified as uint64_t, all printf()-like calls would either need casts to uintmax_t, or be littered with PRI*64 macros. Casts to uintmax_t aren't horrible, but it would also bake into the API for resource_list_print_type() either a hidden assumption that entries get cast to uintmax_t for printing, or these calls would need the PRI*64 macros. Since source code is meant to be read more often than written, I chose the clearest path of simply using uintmax_t. Tested on a PowerPC p5020-based board, which places all device resources in 0xfxxxxxxxx, and has 8GB RAM. Regression tested on qemu-system-i386 Regression tested on qemu-system-mips (malta profile) Tested PAE and devinfo on virtualbox (live CD) Special thanks to bz for his testing on ARM. Reviewed By: bz, jhb (previous) Relnotes: Yes Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D4544 Notes: svn path=/head/; revision=297000
* Sound Mega-commit. Expect further cleanup until code freeze.Ariff Abdullah2009-06-071-23/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Flush remaining malloc() cleanups (M_NOWAIT -> M_WAITOK).Ariff Abdullah2007-06-171-4/+1
| | | | Notes: svn path=/head/; revision=170873
* Filter/compress the amount of channel trigger. This should reduceAriff Abdullah2007-06-111-1/+1
| | | | | | | | | | much of lock/unlock contentions within the interrupt handler. Most of these drivers only need PCMTRIG_START or STOP (ABORT). Discussed with: scottl Notes: svn path=/head/; revision=170521
* Fix broken binary issues with latest gcc 4.x due to bitfield signessAriff Abdullah2007-05-271-1/+2
| | | | | | | | | mishaps for emu10k1 [1] and few other places. Reported/Submitted/Tested by: Ed Schouten <ed@fxq.nl> [1] Notes: svn path=/head/; revision=170032
* sndbuf_alloc() now accept dmaflags argument which will be forwarded toAriff Abdullah2007-04-181-1/+1
| | | | | | | | internal bus_dmammem_alloc() for greater flexibility on setting up DMA / page attributes. Notes: svn path=/head/; revision=168847
* MFp4 (114068):Alexander Leidinger2007-02-231-1/+2
| | | | | | | | | | | | | Use bus_get_dma_tag() to obtain the parent DMA tag to make the drivers a little bit more non-ia32/amd64 friendly. There is no man page for bus_get_dma_tag, so this is modelled after rev. 1.62 of src/sys/dev/sound/pci/es137x.c by marius. Inspired by: commit by marius Notes: svn path=/head/; revision=166904
* Clean up the BSD license to match the preferred license inJoel Dahl2007-02-021-1/+1
| | | | | | | | | | /usr/share/examples/etc/bsd-style-copyright. I've fixed a few minor wording and formatting differences. Approved by: luigi, Hannu Savolainen <hannu@opensound.com> Notes: svn path=/head/; revision=166426
* Fix broken capabilites. There are possible calculation errors withinAriff Abdullah2006-01-161-2/+2
| | | | | | | | | | | | | ess_calcspeed8() and ess_calcspeed9() that need to be fixed as well (TODO). Reported by: [1] Claude Buisson <cbuisson at nerim.net> MFC after: 3 days [1] http://lists.freebsd.org/pipermail/freebsd-multimedia/2006-January/003566.html Notes: svn path=/head/; revision=154438
* - Fixup the locking.Alexander Leidinger2005-07-311-2/+8
| | | | | | | | | - Don't mark MPSAFE (yet). Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my> Notes: svn path=/head/; revision=148598
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139749
* Audio drivers failed to detect failure condition and attempted toPyun YongHyeon2004-10-131-1/+1
| | | | | | | | | | | | | assign DMA address to the wrong address. It can cause system lockup or other mysterious errors. Since most sound cards requires low DMA address(BUS_SPACE_MAXADDR_24BIT) sndbuf_alloc() would fail when the audio driver is loaded after long running of operations. Approved by: jake (mentor) Reviewed by: truckman, matk Notes: svn path=/head/; revision=136469
* * Remove the acpi attachment from the es1888. It has an identify methodNate Lawson2004-10-121-1/+1
| | | | | | | | | | | | that conjures up the device node so it isn't true PNP. Noticed by jhb@. * Add an attachment for esscontrol since it too uses ISA_PNP_PROBE. * Move an attachment from snd_mss to snd_pnpmss. The latter is the real PNP user. Notes: svn path=/head/; revision=136410
* Rename the sound device drivers:Seigo Tanimura2004-07-161-1/+1
| | | | | | | | | | | | | | | | | - `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 Notes: svn path=/head/; revision=132236
* The newpcm headers currently #define away INTR_MPSAFE and INTR_TYPE_AVBrian Feldman2004-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | 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> Notes: svn path=/head/; revision=128232
* Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson2004-03-171-13/+9
| | | | | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde Notes: svn path=/head/; revision=127135
* Augment /dev/sndstat with the module names, if applicable.Mathew Kanner2004-03-061-2/+3
| | | | | | | Approved by: tanimura (mentor) Notes: svn path=/head/; revision=126695
* update my email address.Cameron Grant2003-09-071-1/+1
| | | | Notes: svn path=/head/; revision=119853
* Mega busdma API commit.Scott Long2003-07-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg. Lockfunc allows a driver to provide a function for managing its locking semantics while using busdma. At the moment, this is used for the asynchronous busdma_swi and callback mechanism. Two lockfunc implementations are provided: busdma_lock_mutex() performs standard mutex operations on the mutex that is specified from lockfuncarg. dftl_lock() is a panic implementation and is defaulted to when NULL, NULL are passed to bus_dma_tag_create(). The only time that NULL, NULL should ever be used is when the driver ensures that bus_dmamap_load() will not be deferred. Drivers that do not provide their own locking can pass busdma_lock_mutex,&Giant args in order to preserve the former behaviour. sparc64 and powerpc do not provide real busdma_swi functions, so this is largely a noop on those platforms. The busdma_swi on is64 is not properly locked yet, so warnings will be emitted on this platform when busdma callback deferrals happen. If anyone gets panics or warnings from dflt_lock() being called, please let me know right away. Reviewed by: tmm, gibbs Notes: svn path=/head/; revision=117126
* - Clean up ISA DMA supports.Yoshihiro Takahashi2003-02-071-5/+7
| | | | | | | | | | - Rename all sndbuf_isadma* functions to sndbuf_dma* and move them into sys/dev/sound/isa/sndbuf_dma.c. No response from: sound Notes: svn path=/head/; revision=110499
* Do not return(foo()) in void function.Semen Ustimenko2002-12-181-3/+3
| | | | | | | | Submitted by: marius@alchemy.franken.de MFC after: 3 days Notes: svn path=/head/; revision=108064
* Fix code that had rotted behind debugging macros.Scott Long2002-01-251-1/+1
| | | | | | | | Approved by: cg (in principle) MFC after: 2 weeks Notes: svn path=/head/; revision=89774
* allow the hardware buffer size to be controlled with hintsCameron Grant2001-09-291-9/+17
| | | | | | | release isa dma channels on unload (ad1816, ess, sb8) Notes: svn path=/head/; revision=84111
* many changes:Cameron Grant2001-08-231-4/+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. Notes: svn path=/head/; revision=82180
* Use the M_ZERO flag to malloc(9)George C A Reid2001-06-211-2/+1
| | | | | | | | Reviewed by: cg MFC after: 1 week Notes: svn path=/head/; revision=78564
* use a global devclass for all drivers - i'm not entirely sure why thisCameron Grant2001-06-161-2/+0
| | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=78362
* Reinitialise the DSP and mixer after a resume from suspendGeorge C A Reid2001-04-081-0/+21
| | | | | | | | | PR: 22372 Submitted by: Hiroyuki Aizu <aizu@jaist.ac.jp> Reviewed by: cg Notes: svn path=/head/; revision=75326
* mega-commit.Cameron Grant2001-03-241-21/+34
| | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=74763
* Add speaker volume adjusting supportCameron Grant2001-02-271-2/+6
| | | | | | | | Submitted by: Tai-hwa Liang <avatar@mmlab.cse.yzu.edu.tw> PR: i386/21452 Notes: svn path=/head/; revision=73151
* quieten the esscontrol deviceCameron Grant2001-02-021-1/+6
| | | | Notes: svn path=/head/; revision=71932
* change irq handler slightly, get rid of superflous messagesCameron Grant2000-12-271-6/+4
| | | | Notes: svn path=/head/; revision=70392
* update code dealing with snd_dbuf objects to do so using a functional interfaceCameron Grant2000-12-231-10/+12
| | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=70291
* kobjify.Cameron Grant2000-12-181-138/+124
| | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=70134
* add reinit functions to mixersCameron Grant2000-10-261-0/+1
| | | | | | | | unstaticize chn_start() add reset/resetdone functions to channels Notes: svn path=/head/; revision=67652
* detach supportCameron Grant2000-09-091-15/+34
| | | | | | | | | | remove un-needed setdir functions add bus_teardown_intr calls where necessary destroy our dma tags where necessary destroy ac97 before releasing resources Notes: svn path=/head/; revision=65644
* change mixer api slightlyCameron Grant2000-09-011-6/+14
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=65340
* rework feeder sytem to allow feeders in kldsCameron Grant2000-08-201-8/+24
| | | | | | | | | | | modify driver capability reporting format to list every audio format seperately- required for above and because we could not previously indicate that mono was unsupported. there should be no functional impact. Notes: svn path=/head/; revision=64881
* add module metadata. this is a hack, sound drivers will eventually present aCameron Grant2000-07-031-4/+4
| | | | | | | bus to which pcm, mixer, etc will attach. Notes: svn path=/head/; revision=62483
* Unused include: #include "sbc.h"Peter Wemm2000-06-101-2/+0
| | | | Notes: svn path=/head/; revision=61478
* handle emulated dma readsCameron Grant2000-05-261-1/+1
| | | | | | | don't try to get sample size from snd_dbuf Notes: svn path=/head/; revision=60958
* fix a speed bug that nobody noticedCameron Grant2000-05-151-4/+5
| | | | Notes: svn path=/head/; revision=60571
* make drivers start at beginning of buffer when triggered - improves mmap.Cameron Grant2000-04-171-1/+1
| | | | | | | | | not all tested. not sure about aureal.c or csapcm.c Notes: svn path=/head/; revision=59323
* bump the buffer size from 4k to 16k. should improve performance under load.Cameron Grant2000-04-011-1/+1
| | | | Notes: svn path=/head/; revision=58903
* split up ess and sb codeCameron Grant2000-03-281-0/+930
rewrite ess mixer to use native registers rewrite play/rec code to use more accurate timer when available add code to use audio2 for playback, but disable it as no irqs are generated Notes: svn path=/head/; revision=58756