summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/midi
Commit message (Collapse)AuthorAgeFilesLines
* Change the type of uio_resid member of struct uio from int to ssize_t.kib2009-06-252-6/+6
| | | | | | | | Note that this does not actually enable full-range i/o requests for 64 architectures, and is done now to update KBI only. Tested by: pho Reviewed by: jhb, bde (as part of the review of the bigger patch)
* Remove custom KOBJMETHOD(), CHANNEL_DECLARE() and MIXER_DECLARE()ariff2009-06-112-22/+7
| | | | | (enabled with SND_DEBUG) that was intended to provoke build failure due to inconsistencies.
* Sound Mega-commit. Expect further cleanup until code freeze.ariff2009-06-074-22/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove license clauses 3 and 4 as per rev. 1.65 of midi.c in NetBSD.joel2009-05-201-7/+0
| | | | Approved by: matk
* Replace all calls to minor() with dev2unit().ed2008-09-271-2/+2
| | | | | | | | | | | | | | | After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib
* Don't include <sys/tty.h> in our sound layer. It is not needed.ed2008-08-191-1/+0
| | | | | | | | | | The PCM's sound.h file only seems to include <sys/tty.h>, because channel_if seems to require selinfo. Just replace it with <sys/selinfo.h>. There's no real problem with including <sys/tty.h> here, even with MPSAFE TTY, but <sys/tty.h> is something that should be used by the TTY layer, its driver and code that integrated it with the process tree.
* Giant is no longer required and can not be held over kproc_exit().thompsa2008-05-211-1/+0
|
* Replace callout_init(..., 1) with callout_init(..., CALLOUT_MPSAFE) forkris2008-04-161-1/+1
| | | | | | | better grep-compliance and to standardize with the rest of the kernel. Reviewed by: jhb MFC after: 1 week
* Rename the kthread_xxx (e.g. kthread_create()) callsjulian2007-10-201-2/+2
| | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls.
* Disable seq_modevent(). The implementation is incomplete, and causingariff2007-04-021-0/+4
| | | | memory leak during unload.
* NULL instead of 0 in mtx_init() .ariff2007-03-152-5/+5
|
* semi-automatic style(9)netchild2007-02-2510-1328/+1377
|
* Clean up the BSD license to match the preferred license injoel2007-01-2810-138/+160
| | | | | | | | /usr/share/examples/etc/bsd-style-copyright. I've fixed a few minor wording and formatting differences. Approved by: matk, Hannu Savolainen <hannu@opensound.com> Reviewed by: imp
* Rearrange locking order to avoid LOR (cat /dev/midistat).ariff2007-01-271-3/+9
| | | | Reported by: rodrigc
* Wrap debug printfs into SEQ_DEBUG() to avoid kernel messages clutterariff2006-10-151-19/+19
| | | | during module unload.
* SNDCTL_TMR_{START,STOP,CONTINUE} don't take an argument.ru2006-09-291-4/+8
|
* Move debug printfs under the proper macro.njl2006-07-121-3/+3
|
* - Rename hw.snd.unit to hw.snd.default_unit to make the purpose more obvious.netchild2006-06-182-0/+2
| | | | | | | - Enable 4 automatic vchan's by default. - Add some comments which provide ides/questions for improvement. - Prefix some temporary sysctl's with an underscore to denote that it is not an official API but a workaround until the real solution is implemented.
* Fix build with -Wundef.ru2006-05-292-4/+4
|
* Use a more appropriate printf format for size_t.netchild2006-05-281-1/+1
| | | | This should unbreak the tinderbox build (64bit architectures).
* Commit the new (old) midi framework. It's based in parts on the NetBSD code,netchild2006-05-2710-0/+4547
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | but large parts are rewritten by matk and tanimura. This is old code, it's not maintained since 2003. We also don't have a maintainer for this! Yuriy Tsibizov took it and uses it in his emu10kx driver. Since the emu10kx driver will enter the tree "soon" (some bugs have to be fixed after Yuriy return from his holidays), I add it here already. This also contains some changes to emu10k1 and cmi, so if you're lucky, you can now make some kind of use of midi with those soundcards. To all those poor souls which don't have such a card: feel free to send patches, we don't have a maintainer for this. To those which miss a specific feature in the midi code: feel free to submit patches, we don't have a maintainer for this. Oh, did I already told that it would be nice if someone would take care of it? Maintainer with midi equipment wanted! :-) If you get LOR's, submit a PR and notify multimedia@ please. If you get panics, submit a PR with a backtrace (compile the sound system into your kernel instead of using modules in this case) and notify multimedia@ please. Written by: matk, tanimura Submitted by: "Yuriy Tsibizov" <Yuriy.Tsibizov@gfk.ru> Based upon: code from NetBSD
* Axe the old midi drivers and framework. matk has developed a newtanimura2004-06-0111-6051/+0
| | | | module-friendly midi subsystem to be merged soon.
* Device megapatch 5/6:phk2004-02-211-1/+1
| | | | | | | | | | | | Remove the unused second argument from udev2dev(). Convert all remaining users of makedev() to use udev2dev(). The semantic difference is that udev2dev() will only locate a pre-existing dev_t, it will not line makedev() create a new one. Apart from the tiny well controlled windown in D_PSEUDO drivers, there should no longer be any "anonymous" dev_t's in the system now, only dev_t's created with make_dev() and make_dev_alias()
* Device megapatch 4/6:phk2004-02-212-0/+4
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* - Implement selwakeuppri() which allows raising the priority of atanimura2003-11-091-2/+2
| | | | | | | | | | | | | thread being waken up. The thread waken up can run at a priority as high as after tsleep(). - Replace selwakeup()s with selwakeuppri()s and pass appropriate priorities. - Add cv_broadcastpri() which raises the priority of the broadcast threads. Used by selwakeuppri() if collision occurs. Not objected in: -arch, -current
* Deprecate machine/limits.h in favor of new sys/limits.h.kan2003-04-291-1/+1
| | | | | | | Change all in-tree consumers to include <sys/limits.h> Discussed on: standards@ Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-032-26/+16
| | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl)
* Back out M_* changes, per decision of the TRB.imp2003-02-194-9/+9
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-214-9/+9
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-043-13/+13
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Include <machine/limits.h> for definition of ULONG_MAX. Remove amike2002-03-251-1/+1
| | | | duplicate include.
* Fixes to make select/poll mpsafe.alfred2002-03-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: selwakeup required calling pfind which would cause lock order reversals with the allproc_lock and the per-process filedesc lock. Solution: Instead of recording the pid of the select()'ing process into the selinfo structure, actually record a pointer to the thread. To avoid dereferencing a bad address all the selinfo structures that are in use by a thread are kept in a list hung off the thread (protected by sellock). When a selwakeup occurs the selinfo is removed from that threads list, it is also removed on the way out of select or poll where the thread will traverse its list removing all the selinfos from its own list. Problem: Previously the PROC_LOCK was used to provide the mutual exclusion needed to ensure proper locking, this couldn't work because there was a single condvar used for select and poll and condvars can only be used with a single mutex. Solution: Introduce a global mutex 'sellock' which is used to provide mutual exclusion when recording events to wait on as well as performing notification when an event occurs. Interesting note: schedlock is required to manipulate the per-thread TDF_SELECT flag, however if given its own field it would not need schedlock, also because TDF_SELECT is only manipulated under sellock one doesn't actually use schedlock for syncronization, only to protect against corruption. Proc locks are no longer used in select/poll. Portions contributed by: davidc
* Do not call a synthesizer with a sequencer lock held.tanimura2002-03-101-2/+12
|
* Add the system default timer engine.tanimura2002-01-042-0/+644
|
* - Provide toggles to show debug messages. Set new sysctl variablestanimura2002-01-046-309/+806
| | | | | | | | | | | | | | hw.midi.debug and hw.midi.seq.debug to 1 to enable debug log. - Make debug messages human-frendly. - Implement /dev/music. - Add a timer engine required by /dev/music. - Fix nonblocking I/O. - Fix the numbering of midi and synth devices.
* - Do not uiomove with a mutex locked.tanimura2002-01-019-388/+296
| | | | | | | | | - Move from msleep/wakeup to condvar. - Return either zero or a positive errno value from a function. Return additional result via references. - Unify the typedef of callback functions.
* Avoid crash of minor numbers between /dev/midistat and /dev/dspr*.tanimura2001-11-031-1/+1
|
* KSE Milestone 2julian2001-09-122-54/+54
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-0/+1
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Send the remains (such as I have located) of "block major numbers" tophk2001-03-262-2/+0
| | | | the bit-bucket.
* - Do not touch the Giant.tanimura2001-03-143-173/+2
| | | | | | | | Requested by: jhb - Initialize a mutex prior to locking it. Spotted by: dcs
* - Mutexify midi(4). The driver runs under the giant lock by default.tanimura2001-02-268-756/+1385
| | | | | | | | | | | | | | If you ever want to run midi(4) out of the giant lock, uncomment MIDI_OUTOFGIANT in midi.h. Confirmed to work for csamidi with WITNESS and INVARIANTS. - midi_info, midi_open and seq_info are now tailqs, allowing arbitrary numbers of devices to be configured. - Do not send an active sensing message to reset midi modules. - Clone /dev/sequencer*. /dev/sequencer0 and /dev/sequencer are generated upon initialization.
* Encapselate midi_info, nmidi and nsynth into midi.c.tanimura2001-02-184-75/+104
|
* Tag unused functions with __unused.jhb2001-01-231-2/+2
|
* Convert all users of fldoff() to offsetof(). fldoff() is badphk2000-10-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | because it only takes a struct tag which makes it impossible to use unions, typedefs etc. Define __offsetof() in <machine/ansi.h> Define offsetof() in terms of __offsetof() in <stddef.h> and <sys/types.h> Remove myriad of local offsetof() definitions. Remove includes of <stddef.h> in kernel code. NB: Kernelcode should *never* include from /usr/include ! Make <sys/queue.h> include <machine/ansi.h> to avoid polluting the API. Deprecate <struct.h> with a warning. The warning turns into an error on 01-12-2000 and the file gets removed entirely on 01-01-2001. Paritials reviews by: various. Significant brucifications by: bde
* Since the unit number of a midi/sequencer device is expressed in 4tanimura2000-09-182-2/+2
| | | | bits, we can configure only up to 16 units.
* Avoid the modules madness I inadvertently introduced by making thephk2000-09-024-8/+0
| | | | | | | | | | | | | | | | | | cloning infrastructure standard in kern_conf. Modules are now the same with or without devfs support. If you need to detect if devfs is present, in modules or elsewhere, check the integer variable "devfs_present". This happily removes an ugly hack from kern/vfs_conf.c. This forces a rename of the eventhandler and the standard clone helper function. Include <sys/eventhandler.h> in <sys/conf.h>: it's a helper #include like <sys/queue.h> Remove all #includes of opt_devfs.h they no longer matter.
* Finally merge newmidi.tanimura2000-07-119-0/+4521
(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
OpenPOWER on IntegriCloud