summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound
Commit message (Collapse)AuthorAgeFilesLines
* Add the KLD to the sndstat info.netchild2005-09-181-1/+1
|
* Merge NetBSD fixes (except for 1.97 there should be no functional change):netchild2005-09-181-185/+237
| | | | | | | | | 1.94: ansify and KNF (NetBSD KNF). 1.95: Fix DPRINTF (bug from change in 1.94). 1.96: NetBSD specific. 1.97: Fix memory leak reported by Ted Unangst as bug #3 on tech-kern. Obtained from: NetBSD
* Fix module unload panic which was caused by missing sx lock release.yongari2005-09-141-1/+5
| | | | | | | While I'm here add KASSERT(9) to notify failure of SYSUNINIT handler. Reported by: Ben Kaduk < minimarmot AT gmail DOT com > Tested by: Ben Kaduk < minimarmot AT gmail DOT com >
* Unlock driver lock before calling resource_int_value(9).yongari2005-09-131-0/+3
| | | | This should fix LOR(in fact it's not LOR) in device attach.
* - Fix the locking in dsp.c to prevent a LOR (AFAIK not on the LOR page).netchild2005-09-122-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | - Remove an assertion in sound.c, it's not needed (and causes a panic now). From the conversation via mail between glebius and Ariff: ---snip--- > Well, but which mutex protects now? Do we own anything else > in pcm_chnalloc()? I see some queue(4) macros in pcm_chnalloc(), > they should be protected, shouldn't they? Queue insertion/removal occur during 1) driver loading (which is pretty much single thread / sequential) or unloading (mutex protected, bail out if there is any channel with refcount > 0 or busy). 2) vchan_create()/destroy(), (which is *sigh* quite complicated), but somehow protected by 'master'/parent channel mutex. Other thread cannot add/remove vchan (or even continue traversing that queue) unless it can acquire parent channel mutex. ---snip--- Fix the locking in dsp.c to prevent a LOR (AFAIK not on the LOR page). Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my> Tested with: INVARIANTS[1] and DIAGNOSTICS[2] Tested by: netchild [1,2], David Reid <david@jetnet.co.uk> [1]
* 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.
* Fix hang at init for MagicMedia 256A[VX] chips. [1]netchild2005-09-111-0/+9
| | | | | | | | | In case this causes trouble for some other chipsets add a comment how to proceed. If we don't get bugreports, this should be removed after a while (some releases?). PR: 56617 [1], 29465, 39260, 40574, 68225 Submitted by: Matthew E. Gove <mgove@comcast.net> [1]
* Power up the external amplifiers additionally to powering up the DAC and ADC.netchild2005-09-111-0/+8
| | | | | | PR: 47029 Submitted by: Anish Mistry <mistry.7@osu.edu> Tested by: David Murphy <dm@dmz.ie>
* 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 a bug in volume calculation, this sometimes gives a USB audio device annetchild2005-09-111-2/+2
| | | | | | unexpected value (when the volume is high). Submitted by: Kazuhito HONDA <kazuhito@ph.noda.tus.ac.jp>
* - channel.hnetchild2005-09-104-231/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * New definition CHN_F_HAS_VCHAN. - channel.c * Use CHN_F_HAS_VCHAN to mark channel with vchan capability instead of relying on SLIST_EMPTY(&channel->children) == true for better clarification and future possible usages of children (like 'slave' channel). * Various fixes, including blocksize / format bps allignment, better 24bit seeking (mplayer, others). * Improve format chain building, it's now possible to record something to a format non-native to the soundcard through various feeder format converters or to higher sampling rate. This also gains another feature, like doing vchan mixing on non s16le soundcard such as sb8. - sound.c * Increase robustness within various function that handle vchan creation / termination (these function need a total rewrite, but that would cause other major rewrite within various places too!). As far as its robustness can be guaranteed, leave it as is. * Optimize channel ordering, prefer *real* hardware playback channels over virtual channels. cat /dev/sndstat should look better. * Increase sndstat verbosity to include bufsoft/bufhard allocation. - vchan.c * Fix LOR 119. - http://sources.zabbadoz.net/freebsd/lor.html#119 * Reorder / increase robustness of vchan_create() / destroy(). Enforce destroy_dev() during destroy operation, fix possible panic / dangling character device. - http://lists.freebsd.org/pipermail/freebsd-current/2005-May/050308.html * Tolerate a little bit more during mixing process, this should help non s16le soundcards. Note: Recoring in a non-native rate/format may result in overruns. A friendly application is wavrec from audio/wavplay. The problem is under investigation. Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>
* Release lock for a while during chn_reset() / pcm_chnalloc() operationnetchild2005-09-101-2/+6
| | | | | | | | | | | while malloc()ing, this fixes LOR 129. See - http://lists.freebsd.org/pipermail/freebsd-current/2005-June/051157.html - http://lists.freebsd.org/pipermail/freebsd-current/2005-August/054620.html - http://sources.zabbadoz.net/freebsd/lor.html#129 Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>
* - fake.cnetchild2005-09-104-37/+233
| | | | | | | | | | | | | | | * Add missing A_LAW / MU_LAW format. - feeder.c * Fix format chain building. Traverse backward instead of forward during format chainning. - feeder_fmt.c * Add missing alaw/mulaw converter. * Add 16 -> 24/32bit converter. * whitespace cleanup. - sound.h * alaw / mulaw are member of AFMT_8BIT. Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>
* - Few buggy codecs (STAC9704, probably others) return inconsistentnetchild2005-09-102-24/+84
| | | | | | | | | ac97_rdcd() value. Enable aggresive workaround. - Fix mixer resolution detection for 5/6 bit register, carefully not to overflow others. PR: 84728 Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>
* 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>
* Merge the dev_clone and dev_clone_cred event handlers into a singlerwatson2005-08-082-2/+4
| | | | | | | | | | | | | event handler, dev_clone, which accepts a credential argument. Implementors of the event can ignore it if they're not interested, and most do. This avoids having multiple event handler types and fall-back/precedence logic in devfs. This changes the kernel API for /dev cloning, and may affect third party packages containg cloning kernel modules. Requested by: phk MFC after: 3 days
* Style fix.netchild2005-07-311-1/+1
| | | | Noticed by: njl
* Whats New:netchild2005-07-318-740/+1496
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Support wide range sampling rate, as low as 1hz up to int32 max (which is, insane) through new feeder_rate, multiple precisions choice (32/64 bit converter). This is indeed, quite insane, but it does give us more room and flexibility. Plenty sysctl options to adjust resampling characteristics. 2. Support 24/32 bit pcm format conversion through new, much improved, simplified and optimized feeder_fmt. Changes: 1. buffer.c / dsp.c / sound.h * Support for 24/32 AFMT. 2. feeder_rate.c * New implementation of sampling rate conversion with 32/64 bit precision, 1 - int32max hz (which is, ridiculous, yet very addictive). Much improved / smarter buffer management to not cause any missing samples at the end of conversion process * Tunable sysctls for various aspect: hw.snd.feeder_rate_ratemin - minimum allowable sampling rate (default to 4000) hw.snd.feeder_rate_ratemax - maximum allowable sampling rate (default to 1102500) hw.snd.feeder_rate_buffersize - conversion buffer size (default to 8192) hw.snd.feeder_rate_scaling - scaling / conversion method (please refer to the source for explaination). Default to previous implementation type. 3. feeder_fmt.c / sound.h * New implementation, support for 24/32bit conversion, optimized, and simplified. Few routines has been removed (8 to xlaw, 16 to 8). It just doesn't make sense. 4. channel.c * Support for 24/32 AFMT * Fix wrong xruns increment, causing incorrect underruns statistic while using vchans. 5. vchan.c * Support for 24/32 AFMT * Proper speed / rate detection especially for fixed rate ac97. User can override it using kernel hint: hint.pcm.<unit>.vchanrate="xxxx". Notes / Issues: * Virtual Channels (vchans) Enabling vchans can really, really help to solve overrun issues. This is quite understandable, because it operates entirely within its own buffering system without relying on hardware interrupt / state. Even if you don't need vchan, just enable single channel can help much. Few soundcards (notably via8233x, sblive, possibly others) have their own hardware multi channel, and this is unfortunately beyond vchan reachability. * The arrival of 24/32 also come with a price. Applications that can do 24/32bit playback need to be recompiled (notably mplayer). Use (recompiled) mplayer to experiment / test / debug this various format using -af format=fmt. Note that 24bit seeking in mplayer is a little bit broken, sometimes can cause silence or loud static noise. Pausing / seeking few times can solve this problem. You don't have to rebuild world entirely for this. Simply copy /usr/src/sys/sys/soundcard.h to /usr/include/sys/soundcard.h would suffice. Few drivers also need recompilation, and this can be done via /usr/src/sys/modules/sound/. Support for 24bit hardware playback is beyond the scope of this changes. That would require spessific hardware driver changes. * Don't expect playing 9999999999hz is a wise decision. Be reasonable. The new feeder_rate implemention provide flexibility, not insanity. You can easily chew up your CPU with this kind of mind instability. Please use proper mosquito repellent device for this obvious cracked brain attempt. As for testing purposes, you can use (again) mplayer to generate / play with different sampling rate. Use something like "mplayer -af resample=192000:0:0 <files>". Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my> Tested by: multimedia@
* * Slightly new method to detect mixer capabilities and resolution.netchild2005-07-311-9/+41
| | | | | | | | | | | | This mostly to help CT4730, but apparently it does help other cards too (especially via8233x). This probably need further test and confirmation from other people with ac97 cards other than via / es137x. * Aggresive dac power wake up call, again, to help CT4730 (and probably others). Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my> Tested by: multimedia@
* - 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>
* * Add locking / MPSAFEnetchild2005-07-311-82/+206
| | | | | | | | | | | | | | | | | | | | * Add kernel hint option to disable DXS channels entirely. Report from several skype users / Pav Lucistnik indicate that disabling DXS may fix lots of pop / crackling noise. To disable DXS add hint.pcm.<unit>.via_dxs_disabled="1" to /boot/device.hints. Further investigation of the issues regarding DXS showed, that the problem is in another (more generic) place, but until the right fix is tested/reviewed this may help a little bit. Added sysctl's to aid testing/debugging: hint.pcm.<unit>.via_dxs_disabled=X - Disable / Enable DXS channels entirely hint.pcm.<unit>.via_dxs_channels=X - Limit DXS channels up to X hint.pcm.<unit>.via_sgd_channels=X - Limit SGD channels up to X hint.pcm.<unit>.via_dxs_src=X - Enable / Disable DXS sample rate converter. Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my> Tested by: multimedia@
* Fix a LOR introduced with the last commit (some hours ago), I had thenetchild2005-07-311-14/+2
| | | | | | | wrong version of the patch. Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my> Pointy hat to: netchild
* Fix a LOR introduced in the last commit (some hours ago), I had the wrongnetchild2005-07-311-25/+4
| | | | | | | version of the patch... Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my> Pointy hat to: netchild
* * Register programming error during device initializationnetchild2005-07-312-127/+278
| | | | | | | | | | | | | | | | | | | | | | | | | | especially for CT4730 / EV1938 chip, causing misconfigured mixer (David Xu), crippled after power cycle (Kevin Oberman). Fixed. * Incorporate locking/spdif patches from Jon Noack / matk. Not all es137x can really do spdif, clean it up a bit to only let few capable chip. This adds a "hw.snd.pcm<unit>.spdif_enabled" sysctl until a more generic way of handling this from userland (by an ordinary user) is designed/implemented. * Convert all bus_space_(read|write) to use es_rd/es_wr, simmilar with other drivers. * Add tunable hw.snd.pcm<unit>.latency_timer sysctl to toggle pci latency timer value on the fly. Much noise / pop / crackling issues can be solved by increasing its value. Other people have pointed out to use pciconf instead, but this is just an added value specific for CT4730/EV1938. * Remove es137x specific debug sysctl/code. Several PRs can now be closed. Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my> Submitted by: Jon Noack <noackjr@alumni.rice.edu> (implicit) Submitted by: matk (implicit) PR: 59349, 68594, 73498 Tested by: multimedia@
* This driver is already MPSAFE, remove busdma_lock_mutex and Giant fromnetchild2005-07-311-2/+2
| | | | | | bus_dma_tag_create. Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>
* * Add locking / MPSAFE.netchild2005-07-311-11/+33
| | | | | Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my> Tested by: netchild
* * als4000 can't do 48k properly (perhaps it really can't at all!).netchild2005-07-311-9/+70
| | | | | | | | Set maxspeed to 44.1k instead. * Add locking / MPSAFE * Fix recording Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>
* * Fix panic during driver unload on second attempt after failure onnetchild2005-07-312-11/+18
| | | | | | | | first (device busy). * Fix module unloading for sound.ko itself. Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my> Tested by: multimedia@
* 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
* Implement suspend/resume operation for snd_csa(4)glebius2005-06-274-17/+220
| | | | | | | PR: kern/82243 Submitted by: Serge Semenenko Approved by: re (scottl) MFC after: 1 month
* Wrap the calls to the ISA DMA specific sndbuf_dma*() functions ofmarius2005-06-101-0/+10
| | | | | | | sys/dev/sound/isa/sndbuf_dma.c (compilation depending on device isa) in #ifdef DEV_ISA so sound(4) can be compiled without isa(4). MFC after: 1 month
* s/-1000/BUS_PROBE_LOW_PRIORITY/tanimura2005-05-291-1/+1
| | | | Pointed out by: nyan
* Add 6300ESB, which should be treated as ICH4.tanimura2005-05-281-1/+9
| | | | | | PR: kern/81573 Submitted by: OOTOMO Hiroyuki <ootomo@za.wakwak.com> MFC after: 1 week
* Make snd_maestro3(4) mpsafeyongari2005-05-231-84/+211
| | | | | | | | | - Let m3_pchan_trigger()/m3_rchan_trigger() acquire lock and call m3_pchan_trigger_locked()/m3_rchan_trigger_locked() respectivly. - Mark interrupt handler INTR_MPSAFE. - Add locks in sound/channel interface. Tested by: nork
* Take advantage of ebus(4) having switched to SYS_RES_MEMORY for themarius2005-05-191-5/+2
| | | | | | | memory resources in ebus.c rev. 1.22 and treat both the EBus and SBus variants alike in this regard. Ok'ed by: yongari
* Add code from Kazuhito HONDA that allows the user to seejulian2005-04-273-0/+157
| | | | | | | | | | the available modes in /dev/sndstat. e.g. pcm1: <USB Audio> at addr ? (0p/1r/0v channels duplex) mode 1:(input) 1ch, 16/16bit, pcm, 44100Hz mode 2:(input) 1ch, 16/16bit, pcm, 22050Hz mode 3:(input) 1ch, 16/16bit, pcm, 11025Hz mode 4:(input) 1ch, 16/16bit, pcm, 8000Hz
* Fix a bug where we call pcm_getbuffersize twice.matk2005-04-171-1/+0
| | | | Pointed out by: Kazuhito HONDA <kazuhito at ph dot noda dot tus dot ac dot jp>
* De-dma the uaudio <-> pcm bridge. We were not capable of doing DMA frommatk2005-04-171-41/+35
| | | | | | | | this buffer anyway so the constraint that it had to be DMA capable only caused pain when devices failed to aquire the memory. Use a regular malloc instead with sndbuf_setup. Approved by: tanimura (mentor)
* On record only devices, don't fail if we don't have a play channel.julian2005-04-171-3/+11
| | | | MFC after: 3 days
* The maximum allowable alloc is 16K not (16K-1).julian2005-04-131-1/+1
| | | | | This whole section is actually overly restrictive and another patch is in the works.
* Make it clear that the statement following the conditional is a NOP.mdodd2005-04-131-1/+2
|
* Fix the output ports on the AD1988 codec. From the submitter:scottl2005-04-101-0/+1
| | | | | | | | | | | | | | | | | | | | | Affects to people WITH an AD1888 codec, the system will output to the port labeled "speaker" instead of microphone. System will work the same in multiple operating systems. If people are currently using their systems with this codec they will need to swap their output ports. I have _not_ checked audio input or line input (basically, I have checked nothing other than line-out). I believe this is an appropriate change, it makes us consistent with documentation, and other operating systems. Furthermore, this feature (playing) is the vast majority of sound activities, so if this makes is right for playback and wrong for recording... playback is more important, and we can fix recoding in the future without worries of screwing people again in the future (since we'll be "right" on the playback). Submitted by: David Cross
* Explicitly hold a reference to the cdev we have just cloned. Thisphk2005-03-312-1/+4
| | | | | closes the race where the cdev was reclaimed before it ever made it back to devfs lookup.
* Return BUS_PROBE_DEFAULT in preference to 0.murray2005-03-201-1/+1
| | | | Pointed out by: Nate Lawson <nate@root.org>
* Add device id for nForce 4 audio controller.murray2005-03-191-0/+4
| | | | | | PR: kern/78482 Submitted by: Markus Niemistö <markus.niemisto@iki.fi> MFC after: 1 week
OpenPOWER on IntegriCloud