sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - error
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.
show more ...
Consistently use `device_t`Several files use the internal name of `struct device` instead of`device_t` which is part of the public API. This patch changes all`struct device *` to `device_t`.The
Consistently use `device_t`Several files use the internal name of `struct device` instead of`device_t` which is part of the public API. This patch changes all`struct device *` to `device_t`.The remaining occurrences of `struct device` are those referring to theLinux or OpenBSD version of the structure, or the code is not built onFreeBSD and it's unclear what to do.Submitted by: Matthew Macy <[email protected]> (previous version)Approved by: emaste, jhibbits, sbrunoMFC after: 3 daysDifferential Revision: https://reviews.freebsd.org/D7447
Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on device_method_t arraysReviewed by: cognetApproved by: cognet
Fix typos.PR: bin/148894Submitted by: olgeni
Fix compile time warning on sparc64, thanks to strict kobj signatures checking.Noticed by: bz
Fix build on sparc64.Pointy hat: ariff@
Sound Mega-commit. Expect further cleanup until code freeze.For a slightly thorough explaination, please refer to [1] http://people.freebsd.org/~ariff/SOUND_4.TXT.html .Summary of changes includ
Sound Mega-commit. Expect further cleanup until code freeze.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 <[email protected]> * 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_OLDSTEREOManual 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.12 of cs4231reg.h in NetBSD.
Spelling fix for interupt -> interrupt
Flush remaining malloc() cleanups (M_NOWAIT -> M_WAITOK).
sndbuf_alloc() now accept dmaflags argument which will be forwarded tointernal bus_dmammem_alloc() for greater flexibility on setting up DMA /page attributes.
Fix severe out-of-bound mtx "type" pointer, causing WITNESS refcountconfusions and panic provided that the following conditions are met: 1) WITNESS is enabled (watch/trace). 2) Using modules, i
Fix severe out-of-bound mtx "type" pointer, causing WITNESS refcountconfusions 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.
Change the remainder of the drivers for DMA'ing devices enabled in thesparc64 GENERIC and the sound device drivers known working on sparc64to use bus_get_dma_tag() to obtain the parent DMA tag so w
Change the remainder of the drivers for DMA'ing devices enabled in thesparc64 GENERIC and the sound device drivers known working on sparc64to use bus_get_dma_tag() to obtain the parent DMA tag so we can get ridof the sparc64_root_dma_tag kludge eventually. Except for ath(4), sk(4),stge(4) and ti(4) these changes are runtime tested (unless I booted upthe wrong kernels again...).
- Probe the CS4231 in USIII machines.- Remove unused variables. [1]Reported by: Coverity Prevent (CID 700, 701) [1]
Take advantage of ebus(4) having switched to SYS_RES_MEMORY for thememory resources in ebus.c rev. 1.22 and treat both the EBus and SBusvariants alike in this regard.Ok'ed by: yongari
Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY inpreference to some random negative number to allow other drivers abite at the apple.
Start each of the license/copyright comments with /*-, minor shuffle of lines
Device driver for onboard CS4231 audio controller which is foundon UltraSPARC workstations. The driver is based on OpenBSD's SBuscs4231 driver and heavily modified to incorporate into sound(4)infr
Device driver for onboard CS4231 audio controller which is foundon UltraSPARC workstations. The driver is based on OpenBSD's SBuscs4231 driver and heavily modified to incorporate into sound(4)infrastructure. Due to the lack of APCDMA documentation, the DMAcode of SBus cs4231 came from OpenBSD's driver.The driver runs without Giant lock and supports both SBus and EBusbased CS4231 audio controller. Special thanks to marius for providingfeedbacks during the driver writing. His feedback made it possibleto write hiccup free playback code under high system loads.Approved by: jake (mentor)Reviewed by: marius (initial version)Tested by: marius, kwm, Julian C. Dunn(jdunn AT opentrend DOT net)