#
516a9c02 |
| 03-Nov-2024 |
Christos Margiolis <christos@FreeBSD.org> |
sound: Make device registration more intuitive
The way a sound driver currently registers to sound(4) is using the following sequence of function calls:
1. pcm_register() to initialize snddev_info.
sound: Make device registration more intuitive
The way a sound driver currently registers to sound(4) is using the following sequence of function calls:
1. pcm_register() to initialize snddev_info. 2. pcm_addchan() calls to create the device's primary channels. 3. pcm_setstatus() to do the final setup.
While using 3 different functions in a specific order might not be very elegant, this pattern cannot be easily avoided. However, pcm_register() and pcm_setstatus() are especially confusing, since one would intuitively expect:
1. pcm_register() to actually do the registration, as opposed to a basic initialization. 2. pcm_setstatus() to, as the name suggests, set some kind of status, as opposed to finalizing the registration.
This patch renames pcm_register() to pcm_init(), and pcm_setstatus() to pcm_register(). Drivers are modified accordingly.
Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D47325
show more ...
|
Revision tags: release/13.4.0, release/14.1.0 |
|
#
c597c557 |
| 06-May-2024 |
Christos Margiolis <christos@FreeBSD.org> |
sound: Use nitems() where possible
No functional change intended.
Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.or
sound: Use nitems() where possible
No functional change intended.
Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D45014
show more ...
|
Revision tags: release/13.3.0 |
|
#
837cd192 |
| 16-Jan-2024 |
Christos Margiolis <christos@FreeBSD.org> |
sound: remove PCM_KLDSTRING() and fix status strings
PCM_KLDSTRING() prints the kernel module associated with a given audio device only when that module is not compiled in. Get rid of PCM_KLDSTRING(
sound: remove PCM_KLDSTRING() and fix status strings
PCM_KLDSTRING() prints the kernel module associated with a given audio device only when that module is not compiled in. Get rid of PCM_KLDSTRING() altogether and print the driver name (even for modules that are compiled in) instead, as it implies the module as well.
While here, convert all status strings to the following dmesg-like format:
[<port|mem> <irq>] on <driver>
Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj, imp Differential Revision: https://reviews.freebsd.org/D43349
show more ...
|
Revision tags: release/14.0.0 |
|
#
5aacf339 |
| 18-Aug-2023 |
John Baldwin <jhb@FreeBSD.org> |
sys: Remove SND_DECLARE_FILE
Reviewed by: kbowling, imp, emaste Differential Revision: https://reviews.freebsd.org/D41499
|
#
82a265ad |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: sound driver version
Remove /SND_DECLARE_FILE\("\$FreeBSD\$"\);/
|
#
4d846d26 |
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
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 |
|
#
2287364e |
| 07-May-2022 |
John Baldwin <jhb@FreeBSD.org> |
Remove pcm_devclass from DRIVER_MODULE invocations.
|
Revision tags: release/12.3.0, release/13.0.0, release/12.2.0 |
|
#
378503af |
| 01-Sep-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
sound: clean up empty lines in .c and .h files
|
#
e2515283 |
| 27-Aug-2020 |
Glen Barber <gjb@FreeBSD.org> |
MFH
Sponsored by: Rubicon Communications, LLC (netgate.com)
|
#
555e9989 |
| 27-Aug-2020 |
Mark Johnston <markj@FreeBSD.org> |
snd_ich(4): Handle errors from ich_init() properly during resume.
ich_init() returns an errno value or 0, but ich_pci_resume() was comparing the return value with -1 to determine whether an error ha
snd_ich(4): Handle errors from ich_init() properly during resume.
ich_init() returns an errno value or 0, but ich_pci_resume() was comparing the return value with -1 to determine whether an error had occurred.
PR: 248941 Submitted by: Tong Zhang <ztong0001@gmail.com> MFC after: 1 week
show more ...
|
Revision tags: 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 <pfg@FreeBSD.org> |
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, release/11.0.1, release/11.0.0 |
|
#
d6084013 |
| 05-Apr-2016 |
Glen Barber <gjb@FreeBSD.org> |
MFH
Sponsored by: The FreeBSD Foundation
|
Revision tags: release/10.3.0 |
|
#
da1b038a |
| 18-Mar-2016 |
Justin Hibbits <jhibbits@FreeBSD.org> |
Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.
On some architectures, u_long isn't large enough for resource definitions. Particularly, powerpc and arm allow 36-bit (or larger) physic
Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.
On some architectures, u_long isn't large enough for resource definitions. Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, but type `long' is only 32-bit. This extends rman's resources to uintmax_t. With this change, any resource can feasibly be placed anywhere in physical memory (within the constraints of the driver).
Why uintmax_t and not something machine dependent, or uint64_t? Though it's possible for uintmax_t to grow, it's highly unlikely it will become 128-bit on 32-bit architectures. 64-bit architectures should have plenty of RAM to absorb the increase on resource sizes if and when this occurs, and the number of resources on memory-constrained systems should be sufficiently small as to not pose a drastic overhead. That being said, uintmax_t was chosen for source clarity. If it's specified as uint64_t, all printf()-like calls would either need casts to uintmax_t, or be littered with PRI*64 macros. Casts to uintmax_t aren't horrible, but it would also bake into the API for resource_list_print_type() either a hidden assumption that entries get cast to uintmax_t for printing, or these calls would need the PRI*64 macros. Since source code is meant to be read more often than written, I chose the clearest path of simply using uintmax_t.
Tested on a PowerPC p5020-based board, which places all device resources in 0xfxxxxxxxx, and has 8GB RAM. Regression tested on qemu-system-i386 Regression tested on qemu-system-mips (malta profile)
Tested PAE and devinfo on virtualbox (live CD)
Special thanks to bz for his testing on ARM.
Reviewed By: bz, jhb (previous) Relnotes: Yes Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D4544
show more ...
|
Revision tags: release/10.2.0, release/10.1.0, release/9.3.0, release/10.0.0, release/9.2.0, release/8.4.0, release/9.1.0, release/8.3.0_cvs, release/8.3.0, release/9.0.0 |
|
#
9b4fcf85 |
| 18-Feb-2011 |
Marcel Moolenaar <marcel@FreeBSD.org> |
Merge svn+ssh://svn.freebsd.org/base/head@218816
|
Revision tags: release/7.4.0_cvs, release/8.2.0_cvs, release/7.4.0, release/8.2.0 |
|
#
0e4e9e17 |
| 18-Dec-2010 |
Tijl Coosemans <tijl@FreeBSD.org> |
Use convenience functions where possible instead of accessing the PCI configuration registers directly.
Remove pci_enable_io calls where they are redundant. The PCI bus driver will set the right bit
Use convenience functions where possible instead of accessing the PCI configuration registers directly.
Remove pci_enable_io calls where they are redundant. The PCI bus driver will set the right bits when the corresponding bus resource is activated.
Remove redundant pci_* function calls from suspend/resume methods. The bus driver already saves and restores the PCI configuration.
Reviewed by: jhb Approved by: kib (mentor)
show more ...
|
Revision tags: release/8.1.0_cvs, release/8.1.0, release/7.3.0_cvs, release/7.3.0, release/8.0.0_cvs, release/8.0.0 |
|
#
10b3b545 |
| 17-Sep-2009 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
Merge from head
|
#
7e857dd1 |
| 12-Jun-2009 |
Oleksandr Tymoshenko <gonzo@FreeBSD.org> |
- Merge from HEAD
|
#
90da2b28 |
| 07-Jun-2009 |
Ariff Abdullah <ariff@FreeBSD.org> |
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 <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.
show more ...
|
#
2e370a5c |
| 26-May-2009 |
Oleksandr Tymoshenko <gonzo@FreeBSD.org> |
Merge from HEAD
|
#
6e8e2779 |
| 08-May-2009 |
Alexander Motin <mav@FreeBSD.org> |
Add one more board ID with inverted external amplifier control.
PR: kern/121156
|
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 |
|
#
909f7f7f |
| 12-Dec-2007 |
Ariff Abdullah <ariff@FreeBSD.org> |
Disable AC97 microphone channel. Due to the channel allocation priority that favours true hardware channel, the first instance of recording request will grab this channel (the first channel is being
Disable AC97 microphone channel. Due to the channel allocation priority that favours true hardware channel, the first instance of recording request will grab this channel (the first channel is being used as vchan master). In many cases, it is not really work as intended and give false impression of broken recording.
PR: kern/118546 MFC after: 3 days
show more ...
|
#
05cba740 |
| 11-Jul-2007 |
Ariff Abdullah <ariff@FreeBSD.org> |
Protect against divide by zero while calculating bus speed due to possible broken kernel timecounter.
Reported/Tested by: silby Approved by: re (hrs) MFC after: 1 day
|
#
082f6383 |
| 17-Jun-2007 |
Ariff Abdullah <ariff@FreeBSD.org> |
Flush remaining malloc() cleanups (M_NOWAIT -> M_WAITOK).
|
#
bdfbdcec |
| 11-Jun-2007 |
Ariff Abdullah <ariff@FreeBSD.org> |
Filter/compress the amount of channel trigger. This should reduce much of lock/unlock contentions within the interrupt handler. Most of these drivers only need PCMTRIG_START or STOP (ABORT).
Discuss
Filter/compress the amount of channel trigger. This should reduce much of lock/unlock contentions within the interrupt handler. Most of these drivers only need PCMTRIG_START or STOP (ABORT).
Discussed with: scottl
show more ...
|
#
3419bf5a |
| 05-May-2007 |
Ariff Abdullah <ariff@FreeBSD.org> |
Fix (or rather workaround) Intel 440MX Errata #36 - http://www.intel.com/design/chipsets/specupdt/245051.htm
AC97 Soft Audio and Soft Modem Master Abort Errata
Issue: Use of either soft audio or
Fix (or rather workaround) Intel 440MX Errata #36 - http://www.intel.com/design/chipsets/specupdt/245051.htm
AC97 Soft Audio and Soft Modem Master Abort Errata
Issue: Use of either soft audio or soft modem on an Intel® 82443MX PCISet based platform running a 100 MHz Processor System Bus and an AC97 codec may result in failures. The system continues to function normally while the AC97 hardware may not resume and may require a cold-boot to recover. As a result of the failure, the Master Abort Status bit will be set in the audio or modem function PCI header space.
Workaround: Force uncacheable DMA on both BDL and pcm buffers.
Tested by: Emil Holmstr|m <emil@linux.se>
show more ...
|