summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/isa
Commit message (Collapse)AuthorAgeFilesLines
* - There's no need to overwrite the default device method with the defaultmarius2011-11-222-4/+2
| | | | | | | | | | one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID.
* Sound Mega-commit. Expect further cleanup until code freeze.ariff2009-06-078-117/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Spelling fix for interupt -> interruptkevlo2007-10-122-5/+5
|
* Flush remaining malloc() cleanups (M_NOWAIT -> M_WAITOK).ariff2007-06-175-19/+5
|
* Filter/compress the amount of channel trigger. This should reduceariff2007-06-115-5/+5
| | | | | | | much of lock/unlock contentions within the interrupt handler. Most of these drivers only need PCMTRIG_START or STOP (ABORT). Discussed with: scottl
* Fix broken binary issues with latest gcc 4.x due to bitfield signessariff2007-05-271-1/+2
| | | | | | mishaps for emu10k1 [1] and few other places. Reported/Submitted/Tested by: Ed Schouten <ed@fxq.nl> [1]
* Fix detection of PC-9821 V166 internal sound card.joel2007-05-191-1/+1
| | | | | | PR: kern/105600 Submitted by: rotus <rotus@takamanohara.dyndns.org> Approved by: ariff
* sndbuf_alloc() now accept dmaflags argument which will be forwarded toariff2007-04-185-5/+5
| | | | | internal bus_dmammem_alloc() for greater flexibility on setting up DMA / page attributes.
* Fix severe out-of-bound mtx "type" pointer, causing WITNESS refcountariff2007-03-153-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | confusions and panic provided that the following conditions are met: 1) WITNESS is enabled (watch/trace). 2) Using modules, instead of statically linked (Not a strict requirement, but easier to reproduce this way). 3) 2 or more modules share the same mtx type ("sound softc"). - They might share the same name (strcmp() == 0), but it always point to different address. 4) Repetitive kldunload/load on any module that shares the same mtx type (Not a strict requirement, but easier to reproduce this way). Consider module A and module B: - From enroll() - subr_witness.c: * Load module A. Everything seems fine right now. wA-w_refcount == 1 ; wA-w_name = "sound softc" * Load module B. * w->w_name == description will always fail. ("sound softc" from A and B point to different address). * wA->w_refcount > 0 && strcmp(description, wA->w_name) == 0 * enroll() will return wA instead of returning (possibly unique) wB. wA->w_refcount++ , == 2. * Unload module A, mtx_destroy(), wA->w_name become invalid, but wA->w_refcount-- become 1 instead of 0. wA will not be removed from witness list. * Some other places call mtx_init(), iterating witness list, found wA, failed on wA->w_name == description * wA->w_refcount > 0 && strcmp(description, wA->w_name) * Panic on strcmp() since wA->w_name no longer point to valid address. Note that this could happened in other places as well, not just sound (eg. consider lots of drivers that share simmilar MTX_NETWORK_LOCK). Solutions (for sound case): 1) Provide unique mtx type string for each mutex creation (chosen) or 2) Put "sound softc" global variable somewhere and use it.
* - Compile time compatibility for pre/post newbus API (intr filter)ariff2007-02-232-8/+25
| | | | | | changes. This should ease the job of maintaining codebase since much of the regression tests are done across os versions. - bus_setup_intr() -> snd_setup_intr().
* MFp4 (114068):netchild2007-02-235-5/+10
| | | | | | | | | | 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
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-232-7/+15
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* Remove dead email address.joel2007-02-022-2/+2
| | | | Requested by: luigi
* Clean up the BSD license to match the preferred license injoel2007-02-026-17/+13
| | | | | | | /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>
* Add a standard BSD license to these files.joel2007-02-022-5/+52
| | | | | Discussed with: rwatson Approved by: luigi
* Remove various bits of conditional Alpha code and fixup a few comments.jhb2006-05-121-3/+0
|
* Remove the snd_ess identify routine for the sound device in Alpha PWSjhb2006-05-121-177/+0
| | | | machines.
* Recover (?) support for AD1815 based ISA soundcards.ariff2006-03-211-0/+3
| | | | | | PR: kern/94388 Submitted by: Krzysztof Kotlenga <piernik at gmail dot com> MFC after: 3 days
* Fix memory leak in some failure cases.netchild2006-02-051-2/+6
| | | | | CID: 420 Found with: Coverity Prevent(tm)
* Fix broken capabilites. There are possible calculation errors withinariff2006-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
* Fix left/right channel mixed-up during recording by splitting recdevariff2005-11-141-13/+22
| | | | | | | mask to recdev_l and recdev_r, since each have its own unique mask. Submitted by: Watanabe Kazuhiro <CQG00620@nifty.ne.jp> Approved by: netchild (mentor)
* Fix kernel panic caused by double mss_unlock().ariff2005-11-071-1/+1
| | | | Noticed by: Watanabe Kazuhiro <CQG00620@nifty.ne.jp>
* more #ifndef PC98. This really fix the pc98 tinderbox.nyan2005-09-121-0/+4
|
* Since opti_detect is now only called on !PC98 machines, only declareimp2005-09-121-0/+4
| | | | and define there as well. This should fix the pc98 tinderbox.
* Add some ad_wait_init() calls to fix some problems in some configs (e.g.netchild2005-09-111-1/+5
| | | | | | | PC98, CS4231A, "pcm0: play interrupt timeout"). PR: 45682 Submitted by: Watanabe Kazuhiro <CQG00620@nifty.ne.jp>
* Allow to record non 8bit-mono formats even in half-duplex configurations.netchild2005-09-111-1/+2
| | | | | PR: 45679 Submitted by: Watanabe Kazuhiro <CQG00620@nifty.ne.jp>
* Fix misdetection of the sound chip on PC98 systems. The submitter doesn'tnetchild2005-09-111-0/+2
| | | | | | | | | | | | believe that there are PC98 systems with an OPTi chip. I don't know enough about this special PC architecture to be sure about this, so let's find out by letting people with such a system complain in case this commit breaks the sound system for them. It's easy to revert then. PR: 45673 Submitted by: Watanabe Kazuhiro <CQG00620@nifty.ne.jp>
* Fix panic caused by full duplex operation.netchild2005-09-101-2/+3
| | | | | | | | | | | | | From the PR: ---snip--- The vibra16X supports full duplex. I traced the Windows driver, and what is does is that it programs one DMA channel 8-bit, and the other 16-bit. There might be some kind of auto detection logic here, because it always uses 8-bit for playback, even if I play 16-bit sound ... ---snip--- PR: 80977 Submitted by: Hans Petter Selasky <hselasky@c2i.net>
* Style fix.netchild2005-07-311-1/+1
| | | | Noticed by: njl
* - Fixup the locking.netchild2005-07-311-3/+17
| | | | | | | - Don't mark MPSAFE (yet). - DSP_CMD_DMAEXIT_8 doesn't work on old cards, use sb_reset_dsp() instead. Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>
* - Fixup the locking.netchild2005-07-313-4/+26
| | | | | | - Don't mark MPSAFE (yet). Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>
* Add another ID.netchild2005-07-311-0/+1
| | | | Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>
* Don't attach the non-PnP mss pcm(4) driver to acpi busses as ACPI onlyjhb2005-07-131-1/+0
| | | | | | | enumerates PnP ISA-like devices. Reported by: Harry Coin harrycoin at qconline dot com MFC after: 3 days
* Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY inimp2005-03-011-1/+1
| | | | | preference to some random negative number to allow other drivers a bite at the apple.
* Use mss_{format,speed}() rather than chn_set{format,speed}() and holdmdodd2005-02-271-2/+4
| | | | | | | mss lock across call. This allows my Thinkpad 600E to resume with the sound driver loaded and vchans enabled.
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-0611-39/+39
|
* PNP BIOS devices are fundamentally different than ISA PNP devices.imp2004-12-071-1/+1
| | | | | | | These devices should be probed first because they are at fixed locations and cannot be turned off. ISA PNP devices, on the other hand, can be turned off and often can be flexible in the resources they use. Probe them last, as always.
* Re-add an acpi attachment for the legacy probe that was inadvertentlynjl2004-10-151-0/+1
| | | | removed.
* Audio drivers failed to detect failure condition and attempted toyongari2004-10-135-5/+7
| | | | | | | | | | 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
* * Remove the acpi attachment from the es1888. It has an identify methodnjl2004-10-123-3/+2
| | | | | | | | | 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.
* Add acpi attachments for ISA sound drivers. This is needed so they'llnjl2004-10-114-0/+4
| | | | | | | probe and attach when ACPI is enabled. Submitted by: takawata (sbc fix) MFC after: 1 day
* Change sb_lock() calls to sbc_lockassert() and remove the sb_unlock()truckman2004-09-121-4/+2
| | | | | | | | | | | calls in sb_cmd2() and sb_getmixer(). The lock has already be grabbed before these functions are called. This is a RELENG_5 candidate. PR: 71189 Submitted by: stephane MFC after: 3 days
* Rename the sound device drivers:tanimura2004-07-168-10/+10
| | | | | | | | | | | | | | - `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
* s/DDB/BVDDB/gmarcel2004-07-101-1/+1
| | | | Note that DDB is unrelated to the debugger with the same acronym.
* Improve mapping of relative to absolute volume.josef2004-06-141-2/+15
| | | | | | | | | | I added bounds checking to the patch and cg improved the formular. Submitted by: Andriy Gapon <avg@icyb.net.ua> PR: kern/65485 Approved by: cg Reviewed by: imp, rwatson, le
* Axe the old midi drivers and framework. matk has developed a newtanimura2004-06-015-5734/+0
| | | | module-friendly midi subsystem to be merged soon.
* Remove extraneous spaces.truckman2004-05-131-1/+1
|
* Implement sbc_lockassert() and sb_lockassert() functions to allowtruckman2004-05-133-3/+19
| | | | | | | | | | | | | proper locking to be checked at runtime. Remove sb_lock() and sb_unlock() calls from sb_reset_dsp() because the latter is called from sb_setup() with the lock already held. Add a call to sb_lockassert(). Surround the call to sb_reset_dsp() in sb16_attach() with sb_lock() and sb_unlock() calls. Tested by: Bartek Marcinkiewicz <junior AT p233.if.pwr.wroc.pl>
* The newpcm headers currently #define away INTR_MPSAFE and INTR_TYPE_AVgreen2004-04-146-7/+7
| | | | | | | | | | | | | | | | | | 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>
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-1710-54/+72
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
OpenPOWER on IntegriCloud