|
Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0, release/13.4.0, release/14.1.0 |
|
| #
ea2275e7 |
| 29-Mar-2024 |
Christos Margiolis <[email protected]> |
sound: Drain buffer selinfo in sndbuf_free()
Prevent a use-after-free in kern_poll() by making sure the buffer's selinfo is drained. This is required for a subsequent patch that implements asynchron
sound: Drain buffer selinfo in sndbuf_free()
Prevent a use-after-free in kern_poll() by making sure the buffer's selinfo is drained. This is required for a subsequent patch that implements asynchronous audio device detach.
Reported by: KASAN Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44544
(cherry picked from commit fba54d0179aabb3d94211ca80f94fe5b98ac6d3b)
show more ...
|
|
Revision tags: release/13.3.0, release/14.0.0 |
|
| #
5aacf339 |
| 18-Aug-2023 |
John Baldwin <[email protected]> |
sys: Remove SND_DECLARE_FILE
Reviewed by: kbowling, imp, emaste Differential Revision: https://reviews.freebsd.org/D41499
|
| #
82a265ad |
| 16-Aug-2023 |
Warner Losh <[email protected]> |
sys: Remove $FreeBSD$: sound driver version
Remove /SND_DECLARE_FILE\("\$FreeBSD\$"\);/
|
| #
4d846d26 |
| 10-May-2023 |
Warner Losh <[email protected]> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
|
Revision tags: release/13.2.0, release/12.4.0, release/13.1.0, release/12.3.0 |
|
| #
1f7a6325 |
| 04-Sep-2021 |
Alexander Motin <[email protected]> |
sound(4): Remove pointless Giant from bus_dma_tag_create().
None of the drivers really implement asynchronous buffer loading, so they don't need lock there. The only question is which of them have
sound(4): Remove pointless Giant from bus_dma_tag_create().
None of the drivers really implement asynchronous buffer loading, so they don't need lock there. The only question is which of them have BUS_DMA_NOWAIT flag there already, and to which it should be added.
show more ...
|
|
Revision tags: release/13.0.0, release/12.2.0, release/11.4.0, release/12.1.0, release/11.3.0, release/12.0.0, release/11.2.0 |
|
| #
718cf2cc |
| 27-Nov-2017 |
Pedro F. Giffuni <[email protected]> |
sys/dev: further adoption of SPDX licensing ID tags.
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
sys/dev: further adoption of SPDX licensing ID tags.
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.
show more ...
|
|
Revision tags: release/10.4.0, release/11.1.0 |
|
| #
3f9dcc58 |
| 25-May-2017 |
Hans Petter Selasky <[email protected]> |
Declare the "snd_fxdiv_table" once. This shaves around 24Kbytes of binary data from sound.ko and the kernel.
MFC after: 3 days
|
|
Revision tags: release/11.0.1, release/11.0.0, release/10.3.0, release/10.2.0, release/10.1.0, release/9.3.0 |
|
| #
8cf27a33 |
| 23-Jun-2014 |
Alexander Kabaev <[email protected]> |
Restore the check for non-NULL dmatag in sndbuf_free.
The sound drivers that use own buffer management can use sndbuf_setup and not do any busdma allocation, so the driver will end up with the manag
Restore the check for non-NULL dmatag in sndbuf_free.
The sound drivers that use own buffer management can use sndbuf_setup and not do any busdma allocation, so the driver will end up with the managed buffer but no valid dma map and tag for it. Avoid calling bus_dmamem_free in such cases.
Reported by: ache Missed in review by: kan
show more ...
|
| #
86843ea8 |
| 17-Jun-2014 |
John Baldwin <[email protected]> |
Fix various bugs with freeing static DMA allocations in sound drivers: - Don't compare the DMA map to NULL to determine if bus_dmamap_unload() should be called when releasing a static allocation.
Fix various bugs with freeing static DMA allocations in sound drivers: - Don't compare the DMA map to NULL to determine if bus_dmamap_unload() should be called when releasing a static allocation. Instead, compare the bus address against 0. - Don't assume that the DMA map for static allocations is NULL. Instead, save the value set by bus_dmamem_alloc() so it can later be passed to bus_dmamem_free(). Also, add missing calls to bus_dmamap_unload() in these cases before freeing the buffer. - Use the bus address from the bus_dma callback instead of calling vtophys() on the address allocated by bus_dmamem_alloc().
Reviewed by: kan
show more ...
|
|
Revision tags: release/10.0.0, release/9.2.0, release/8.4.0, release/9.1.0 |
|
| #
4754395c |
| 23-Nov-2012 |
Alexander Motin <[email protected]> |
Move sndbuf_setmap() output about buffer addresses from the general verbose output to sound verbose output, where all other sndbuf messages live.
|
|
Revision tags: release/8.3.0_cvs, release/8.3.0 |
|
| #
fd578f65 |
| 31-Jan-2012 |
Alexander Motin <[email protected]> |
Make sound(4) more flexible in setting soft buffer and block sizes when hardware imposes strict limitations on hard buffer and block sizes.
Previous code set soft buffer to be no smaller then hard b
Make sound(4) more flexible in setting soft buffer and block sizes when hardware imposes strict limitations on hard buffer and block sizes.
Previous code set soft buffer to be no smaller then hard buffer. On some cards with fixed 64K physical buffer that caused up to 800ms play latency. New code allows to set soft buffer size down to just two blocks of the hard buffer and to not write more then that size ahead to the hardware buffer. As result of that change I was able to reduce full practically measured record-playback loop delay in those conditions down to only about 115ms with theoretical playback latency of only about 50ms.
New code works fine for both vchans and direct cases. In both cases sound(4) tries to follow hw.snd.latency_profile and hw.snd.latency values and application-requested buffer and block sizes as much as limitation of two hardware blocks allows.
Reviewed by: silence on multimedia@
show more ...
|
|
Revision tags: release/9.0.0 |
|
| #
496a7fca |
| 11-Mar-2011 |
Marius Strobl <[email protected]> |
Allocate the sound buffer DMA memory coherent. While NetBSD typically also does this for sound drivers it's probably not necessary for all combinations of controllers and drivers. However, given that
Allocate the sound buffer DMA memory coherent. While NetBSD typically also does this for sound drivers it's probably not necessary for all combinations of controllers and drivers. However, given that our sound drivers completely lack bus_dmamap_sync(9) calls this at least serves as a workaround when enabling use of the IOMMU streaming buffers on sparc64 and generally for arm and mips.
MFC after: 2 weeks
show more ...
|
|
Revision tags: release/7.4.0_cvs, release/8.2.0_cvs, release/7.4.0, release/8.2.0 |
|
| #
240577c2 |
| 13-Jan-2011 |
Matthew D Fleming <[email protected]> |
Fix up a few more sysctl(9) mis-typing found in various LINT builds.
|
|
Revision tags: release/8.1.0_cvs, release/8.1.0 |
|
| #
c4879659 |
| 10-May-2010 |
Jung-uk Kim <[email protected]> |
MFC: r207330, r207620
- Remove dead code. Calculated greatest common divisor was not used at all. - Prefer u_int32_t over unsigned int to make its intention more clearer. - Move the function to a h
MFC: r207330, r207620
- Remove dead code. Calculated greatest common divisor was not used at all. - Prefer u_int32_t over unsigned int to make its intention more clearer. - Move the function to a header file and make it a static inline function.
show more ...
|
| #
c909aebc |
| 04-May-2010 |
Jung-uk Kim <[email protected]> |
- Remove more dead code[1]. Since r207330, we only need to check division by zero of the second argument 'from'. - Prefer u_int32_t over unsigned int to make its intention more clearer. - Move the f
- Remove more dead code[1]. Since r207330, we only need to check division by zero of the second argument 'from'. - Prefer u_int32_t over unsigned int to make its intention more clearer. - Move the function to a header file and make it a static inline function.
Pointed out by: Andrew Reilly (areilly at bigpond dot net dot au)[1] MFC after: 3 days
show more ...
|
| #
8c975e70 |
| 28-Apr-2010 |
Jung-uk Kim <[email protected]> |
Remove dead code. Calculated greatest common divisor was not used at all. On top of that, LLVM+Clang mis-compiles this code because of its register allocator bug.
Analyzed by: Andrew Reilly (areill
Remove dead code. Calculated greatest common divisor was not used at all. On top of that, LLVM+Clang mis-compiles this code because of its register allocator bug.
Analyzed by: Andrew Reilly (areilly at bigpond dot net dot au) Reviewed by: ariff, rdivacky MFC after: 3 days
show more ...
|
|
Revision tags: release/7.3.0_cvs, release/7.3.0, release/8.0.0_cvs, release/8.0.0 |
|
| #
90da2b28 |
| 07-Jun-2009 |
Ariff Abdullah <[email protected]> |
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_OLDSTEREO
Manual page updates are on the way.
Tested by: joel, Olivier SMEDTS <olivier at gid0 d org>, too many unsung / unnamed heroes.
show more ...
|
|
Revision tags: release/7.2.0_cvs, release/7.2.0, release/7.1.0_cvs, release/7.1.0, release/6.4.0_cvs, release/6.4.0, release/7.0.0_cvs, release/7.0.0, release/6.3.0_cvs, release/6.3.0 |
|
| #
e4e61333 |
| 16-Jun-2007 |
Ariff Abdullah <[email protected]> |
Last (again ?!?) major commit for RELENG_7, featuring total Giant eradication in/from userland path, countless locking fixes, etc.
- General sleep call through msleep(9) has been converted to condva
Last (again ?!?) major commit for RELENG_7, featuring total Giant eradication in/from userland path, countless locking fixes, etc.
- General sleep call through msleep(9) has been converted to condvar(9) with better consistencies. - Heavily guard every possible "slow path" entries (open(), close(), few ioctl()s, sysctls), but once it entering "fast path" (io, interrupt started), they are free to fly on their own. - Rearrange locking sequences, resulting better concurrency and serialization. Large part doesn't even need locking at all, and will be removed in future. Less clutter, except in few places due to lock ordering. - Anonymous mixer object creation/deletion to simplify mixer handling beyond typical mixer ioctls. Submitted by: chibis (with modifications) - Add few mix_[get|set|..] functions to avoid calling mixer_ioctl() directly using cryptic arguments. - Locking fixes to avoid possible deadlock with (still under Giant) USB. - Better simplex/duplex device handling. - Recover mmap() functionality for recording, which has been lost since 2.2.x - 3.x (the introduction of newpcm). Full-duplex mmap still doesn't work (due to VM/page design), but people still can mmap both by opening each direction separately. mmaped playback is guarantee to work either way. - New sysctl: "hw.snd.compat_linux_mmap" to allow PROT_EXEC page mapping, due to recent changes in linux compatibility layer which require it. All linux applications that using sound + mmap() (mostly games) require this to be enabled. Disabled by default. - Other goodies.. too many, that will increase releng7 shareholder value and make users of releng6 (and below) cry ;)
* This commit should be atomic. If anything goes wrong (not counting problem originated from elsewhere), I will not hesitate to revert everything back within 12 hours. This substantial changes itself not a rocket science and the process has begun for almost 2 years, and lots of incremental changes are already in place during that period of time. * Some issues does occur in snd_emu10kx (note the 'x') due to various internal locking issues and it is currently being worked on by chibis.
Tested by: chibis (Yuriy Tsibizov), joel, Alexandre Vieira, many innocent souls...
show more ...
|
| #
504e00af |
| 14-Jun-2007 |
Ariff Abdullah <[email protected]> |
Buffer optimization and locking cleanup. Don't resize/malloc unless it is really necessary to ease down unlock/lock sequence.
|
| #
bba4862c |
| 31-May-2007 |
Ariff Abdullah <[email protected]> |
Last major commit and updates for RELENG_7:
- Rework the entire pcm_channel structure: * Remove rarely used link placeholder, instead, make each pcm_channel as head/link of each own/each other
Last major commit and updates for RELENG_7:
- Rework the entire pcm_channel structure: * Remove rarely used link placeholder, instead, make each pcm_channel as head/link of each own/each other. Unlock - Lock sequence due to sleep malloc has been reduced. * Implement "busy" queue which will contain list of busy/active channels. This greatly reduce locking contention for example while servicing interrupt for hardware with many channels or when virtual channels reach its 256 peak channels.
- So I heard you like v chan ... O RLY? Welcome to Virtual **Record** Channels (vrec, rec vchans, vchans for recording, Rec-Chan, you decide), the ultimate solutions for your nagging O_RDWR full-duplex wannabe (note: flash plugins) monopolizing single record channel causing EBUSY. Vrec works exactly like Vchans (or, should I rename it to "Vplay" :) , except that it operates on the opposite direction (recording). Up to 256 vrecs (like vchans) are possible.
Notes: * Relocate dev.pcm.%d.{vchans,vchanformat,vchanrate} to each of its respective node/direction: dev.pcm.%d.play.* for "play" (cdev = dsp%d.vp%d) dev.pcm.%d.rec.* for "record" (cdev = dsp%d.vr%d) * Don't expect that it will magically give you ability to split "recording source" (eg: 1 channel for cdrom, 1 channel for mic, etc). Just admit that you only have a *single* recording source / channel. Please bug your hardware vendor instead :)
- Bump maxautovchans from 4 to 16. For a full-fledged multimedia desktop/workstation with too many soundservers installed (esound, artsd, jackd, pulse/polypaudio, ding-dong pling plong mudkip fuh fuh, etc), 4 seems inadequate. There will be no memory penalty here, since virtual channels are allocate only by demand.
- Nuke/Rework the entire statically created cdev entries. Everything is clonable through snd own clone manager which designed to withstand many kind of abusive devfs droids such as: * while : ; do /bin/test -e /dev/dsp ; done * jot 16777216 0 | while read x ; do ls /dev/dsp0.$x ; done * hundreds (could be thousands) concurrent threads/process opening "/dev/dsp" (previously, this might result EBUSY even with just 3 contesting threads/procs). o Reusable clone objects (instead of creating new one like there's no tomorrow) after certain expiration deadline. The clone allocator will decide whether to reuse, share, or creating new clone. o Automatic garbage collector.
- Dynamic unit magic allocator. Maximum attached soundcards can be tuned using tunable "hw.snd.maxunit" (Default to 512). Minimum is 16, and maximum is 2048.
- ..other fixes, mostly related to concurrency issues.
joel@ will do the manpage updates on sound(4).
Have fun.
show more ...
|
| #
2e334adf |
| 18-Apr-2007 |
Ariff Abdullah <[email protected]> |
sndbuf_alloc() now accept dmaflags argument which will be forwarded to internal bus_dmammem_alloc() for greater flexibility on setting up DMA / page attributes.
|
| #
703c934a |
| 21-Mar-2007 |
Ariff Abdullah <[email protected]> |
Memory leak killing spree, mostly bus_dma(9) related.
|
| #
4dfcb057 |
| 16-Mar-2007 |
Ariff Abdullah <[email protected]> |
[stage: 2/9]
Use inlined min() rather than MIN() macross.
|
| #
4beb77e6 |
| 15-Mar-2007 |
Ariff Abdullah <[email protected]> |
Spring cleanup on irrelevant NULL checking over M_WAITOK allocations.
|
| #
9e4c8259 |
| 01-Feb-2007 |
Ariff Abdullah <[email protected]> |
Fix huge memory leak within sound buffer (during channel destruction, buffer resizing, etc.) that was here since eon. Free all (unmanaged) allocated buffer through sndbuf_destroy() in case we forgot
Fix huge memory leak within sound buffer (during channel destruction, buffer resizing, etc.) that was here since eon. Free all (unmanaged) allocated buffer through sndbuf_destroy() in case we forgot to call sndbuf_free(). For a managed buffer (mostly hw specific managed buffer), either provide CHANNEL_FREE() method with appropriate return value to invoke semi-automatic sndbuf_free() or simply do it on their own. If everything is failed, sndbuf_destroy() will come to the rescue as a final measure.
MFC after: 3 days
show more ...
|