Sound & Audio
History
Sound support for FreeBSD began in 1993, when Jordan K. Hubbard imported version 1.0c of the generic Linux sound driver into FreeBSD, later known as the VoxWare sound drivers, written by Hannu Savolainen. This code was made available by Hannu under two different licenses: GPL for Linux and BSD for FreeBSD/Unix variants.
Several new versions of the VoxWare drivers were imported (and modified) into the FreeBSD base system between 1993 and 1997. At this time Amancio Hasty and Jim Lowe did most of the work on sound support in FreeBSD. The VoxWare drivers eventually became what we know today as OSS, the Open Sound System, maintained by Hannu and his team at 4Front Technologies. OSS has been considered a standard in the Linux world for many years (even if the ALSA project has become the number one choice nowadays, or ALSA has been defacto-replaced with other solutions like PulseAudio and/or pipewire). The last version to be imported was VoxWare 3.5-alpha6. By following the history it is evident that the sound API in FreeBSD has gradually evolved from the VoxWare standard, which later become the OSS standard.
However, things changed in 1997 as more of the foundation for the sound system we have today was laid out. Luigi Rizzo was maintaining his own set of patches for FreeBSD and in 1997 his sound code was imported by John-Mark Gurney as an alternate sound driver. This driver was a complete rewrite (with the exception of soundcard.h) of the existing code (VoxWare code + modifications from Amancio). One of the most important features was support for PnP and FreeBSD 2.2.6 was the first release where it was part of the FreeBSD kernel source tree. So, for a period of time we had two sound drivers available in the FreeBSD kernel source tree:
new code in sys/i386/isa/snd/ by Luigi Rizzo called "pcm" driver
old code in sys/i386/isa/sound/ obtained from VoxWare and modified for FreeBSD.
From 1997 to 1998, Luigi's code was maintained outside of the FreeBSD repository and was imported into FreeBSD whenever he cut a new release of his code.
In 1999, Cameron Grant rewrote the sound system for FreeBSD 4.0 (his new driver was referred to as "newpcm" at the time) and later on imported his work to sys/dev/pcm and announced the change on the FreeBSD current mailing list. This superceded Luigi's pcm driver and it was removed from the tree a month later. Cameron's newpcm code used the newbus interface and supported a great deal of hardware. Not long after the import of newpcm, the sound code was moved again. This time it ended up in sys/dev/sound, which also is the current location of all code belonging to the FreeBSD sound system. In the following years many things changed in the sound area. The amount of drivers for different hardware chips increased dramatically (especially for PCI and USB devices) and many improvements were made to the sound infrastructure, much thanks to Cameron Grant and Orion Hodson. Cameron passed away in 2005, a major loss for the FreeBSD community.
Ariff Abdullah took over the maintainership of the pcm code in FreeBSD in 2005 and other individuals are taking care of the sound device drivers. Since then we've seen some dramatic changes in sound support including the volume per-channel adjustments, low-latency audio, multi-channel, locking removal, virtual channels, a high-quality resampler, a sync of the API to be compatible with OSSv4, as well as several rounds of device driver restructuring.
Features
- Multi-channel audio
- Mixing
- Equalization
- Volume per-channel
- Bit-perfect modes
- Low latency I/O, as well as latency profiles
- Virtual channels, for recording from multiple sources with mixing
- High-quality resampling, featuring either linear interpolation, a couple of different kinds of bandlimited SINC interpolation, or zero order hold
- OSSv4 compatibility
- Statistics
- Runtime setting via sysctl
Documentation
FreeBSD Handbook
The Multimedia chatper includes Setting Up the Sound Card. This section includes advice on configuring audio devices, including Bluetooth.
Manual Pages
sound(4) should be updated whenever a new feature is added – a first stop for information. The page describes all sysctl audio parameters.
pcm(4) and snd(4) redirect to sound(4).
sysctl(8) can help to learn about runtime configuration of sound:
The subtree of hw.snd represents the sound system.
Each subtree of dev.pcm represents a device.
For USB audio devices, there is also the hw.usb.uaudio subtree.
Individual drivers:
snd_als4000(4) – Avance Logic ALS4000 PCI bridge device driver
snd_atiixp(4) – ATI IXP bridge device driver
snd_cmi(4) – CMedia CMI8338/CMI8738 PCI bridge device driver
snd_cs4281(4) – Crystal Semiconductor CS4281 PCI bridge device driver
snd_csa(4) – Crystal Semiconductor CS461x/462x/4280 PCI bridge device driver
snd_emu10k1(4) – SoundBlaster Live! and Audigy PCI bridge device driver
snd_emu10kx(4) – Creative SoundBlaster Live! and Audigy sound cards device driver
snd_envy24(4) – VIA Envy24 and compatible bridge device driver
snd_envy24ht(4) – VIA Envy24HT and compatible bridge device driver
snd_es137x(4) – Ensoniq AudioPCI ES137x bridge device driver
snd_fm801(4) – Forte Media FM801 bridge device driver
snd_hda(4) – Intel High Definition Audio bridge device driver
snd_hdspe(4) – RME HDSPe bridge device driver
snd_ich(4) – Intel ICH AC'97 and compatible bridge device driver
snd_maestro3(4) – ESS Maestro3/Allegro-1 bridge device driver
snd_neomagic(4) – NeoMagic 256AV/ZX bridge device driver
snd_solo(4) – ESS Solo-1/1E PCI bridge device driver
snd_spicds(4) – I2S SPI audio codec driver
snd_t4dwave(4) – Trident 4DWave bridge device driver
snd_uaudio(4) – USB audio and MIDI device driver
snd_via8233(4) – VIA Technologies VT8233 bridge device driver
snd_via82c686(4) – VIA Technologies 82C686A bridge device driver
snd_vibes(4) – S3 SonicVibes bridge device driver
Not documented: snd_ai2s(4) and snd_davbus(4).
Use Cases
Mixer
FreeBSD 14.0 includes a mixer(3) library and a rewritten mixer(8) utility. See Improvements on FreeBSD's sound mixer (Christos Margiolis, 2022-02-25).
Utilities to set/display sound card mixer values built on the FreeBSD Sound System:
CLI (built-in): mixer(8)
TUI (ncurses): audio/mixertui
GUI (QT): audio/dsbmixer
The ports collection also includes utilities such as GTK-Mixer, which can set the default device.
The default device can be set at the command line. For example, prior to FreeBSD 14.0:
% cat /dev/sndstat Installed devices: pcm0: <Realtek ALC257 (Analog 2.0+HP/2.0)> (play/rec) default pcm1: <Realtek ALC257 (Right Analog Mic)> (rec) pcm2: <Intel Kaby Lake (HDMI/DP 8ch)> (play) No devices installed from userspace. % sysctl hw.snd.default_unit=1 hw.snd.default_unit: 0 -> 1
– and with FreeBSD 14.0:
$ mixer -a | grep ^pcm pcm0:mixer: <Realtek ALC257 (Analog 2.0+HP/2.0)> on hdaa0 (play/rec) (default) pcm1:mixer: <Realtek ALC257 (Right Analog Mic)> on hdaa0 (rec) pcm2:mixer: <Intel Kaby Lake (HDMI/DP 8ch)> on hdaa1 (play) % mixer -d pcm1 default_unit: 0 -> 1 pcm1:mixer: <Realtek ALC257 (Right Analog Mic)> on hdaa0 (rec) (default) mic = 0.67:0.67 rec src rec = 0.37:0.37 pbk
Video conferencing (via browser)
OSS (simple)
Firefox 81 and greater support OSS. Audio devices can be selected at runtime.
To explicitly set OSS as the backend, add a new media.cubeb.backend line to about:config and set it to oss.
sndio (intermediate)
The sndio audio framework was originally developed for OpenBSD.
www/chromium uses sndio by default.
www/firefox does not require sndio. cubeb, Mozilla's cross-platform audio library, is patched on FreeBSD to make native use of OSS.
sndio integration for userspace programs.
By default, the PCM sound system in FreeBSD will create OSS(v4) compatible devices in /dev/dspN. The default audio device (hw.snd.default_unit) can also be accessed via /dev/dsp if hw.snd.basename_clone is set. This works well for OSS-compatible userspace programs. By default sndio doesn't require a daemon, and just maps OSS /dev/dspN devices to sndio rsnd/N devices that can be chosen at start-time via the environment variable AUDIODEVICE.
sndio 1.7.0 and greater allow different playback and recording devices through the environment variables AUDIOPLAYDEVICE and AUDIORECDEVICE.
sndio (using daemon)
In more complex cases you might use the sndio daemon:
$ sndiod
To make this permanent:
# sysrc -f /etc/rc.conf sndiod_enable="YES" # service sndiod start
If "Audio device got stuck" occurs, it may help to set a flag then restart sndiod. See sndiod(8) to understand the -a flag before doing this:
# sysrc -f /etc/rc.conf sndiod_flags="-a on"
This assumes that you have your soundcard(s) or snd_uaudio in your kernel configuration, like it is included in the GENERIC kernel configuration file.
virtual_oss (advanced)
It is not uncommon to need one device for loudspeakers and a different device for a microphone. More complicated setups include mixing three–five sources into a single audio stream that features effects, microphone, game/video audio, and/or music.
FreeBSDs in-kernel mixing allows audio/virtual_oss to tell the kernel which devices to mix, to create a sndio-compatible composite device.
The following example assumes output of /dev/sndstat that is similar to this:
Installed devices: pcm0: <Conexant CX20590 (Analog 2.0+HP/2.0)> (play/rec) pcm1: <Conexant CX20590 (Ext-Rear Analog)> (play/rec) default pcm2: <Focusrite Scarlett Solo USB> (play/rec)
For reference, this lists the primary audio card as pcm1 and the secondary audio card as pcm2. These can optionally be configured via nids as is the case with the ThinkPad T420 dock.
First, we install virtual_oss:
# pkg install audio/virtual_oss
Then edit the file which can start virtual_oss with the system:
less /usr/local/etc/rc.d/virtual_oss
This file can be a little complex, so to ease understanding, here is a key scheme:
-T /dev/sndstat \ # Register this device in /dev/sndstat -C 2 -c 2 \ # Make sure we're only working with two channels -S \ # Automatically resample using Project Z -r 48000 \ # Use a supported sample rate -b 24 \ # Use a supported sample depth -s 1024 \ # Set the size of the buffer -O /dev/dsp1 \ # Set pcm1 as the master device and playback device (default device for output) -R /dev/dsp2 \ # Set pcm2 as the recording device (device for input) -d dsp \ # Ensure that access via sndiod and the sndio library works -t vdsp.ctl # Optional control device for this virtual OSS instance
You may also need to adjust the sample rate and depth of the various devices, if your devices don't support the values used in the above example. This can be done by checking /var/run/dmesg.boot or /var/log/messages, or by looking through sysctl OIDs in the dev.pcm namespace.
Resampling using Project Z uses the high-quality resampler mentioned elsewhere on this page.
After this, run the following commands to enable and start virtual_oss:
# service virtual_oss enable # service virtual_oss start
The audio device can also be changed run-time without having to restart virtual_oss, give that the virtual_oss instance installed a control device:
# virtual_oss_cmd /dev/vdsp.ctl -f /dev/dsp0 # virtual_oss_cmd /dev/vdsp.ctl -f /dev/dsp3
Optionally we also need to enable sndiod and start it (this step is only necessary if sndiod is used):
# service sndiod enable # service sndiod start
With this, these settings will persist across reboots.
Finally, to check that the device is installed correctly, check /dev/sndstat again:
$ cat /dev/sndstat Installed devices: pcm0: <Conexant CX20590 (Analog 2.0+HP/2.0)> (play/rec) pcm1: <Conexant CX20590 (Ext-Rear Analog)> (play/rec) default pcm2: <Focusrite Scarlett Solo USB> (play/rec) Installed devices from userspace: dsp: <Virtual OSS> (play/rec)
With the dsp device registered as installed from userspace, Firefox and Chromium should correctly identify the audio source(s) that are mixed in the kernel, both output and input, if available) and work with video conferencing.
It should be noted that this is, at present, somewhat incompatible with the simple sndiod setup noted above, as this involves removing and adding various devices - so the two setups should not be used in conjunction.
Your browser may need to have some setting(s) adjusted to pick up on sndio, rather than preferring pulse if that's installed. In Firefox this can be done by adding/changing the media.cubeb.backend OID in the Firefox about:config. Alternatively, PulseAudio can be removed if it's not needed.
Note: To use virtual_oss you could also edit /etc/rc.conf.d/virtual_oss, an example
virtual_oss_enable="YES" virtual_oss_dsp="-T /dev/sndstat -S -i 8 -C 18 -c 18 -r 48000 -b 32 -s 512 -f /dev/dsp0 -c 2 -d dsp -c 18 -d vdsp -t vdsp.ctl"
Redirecting full duplex audio from a remote machine (advanced)
You need to install virtual_oss and HpsJam. Then use virtual_oss(8) to create a fake /dev/dsp audio device, like shown below.
echo virtual_oss -i 8 -B -S -Q 0 \ -T /dev/sndstat \ -c 4 -r 48000 -b 32 -s 4ms -f /dev/null \ -b 32 -c 2 -m 0,0,1,1 -d dsp \ -b 32 -c 2 -m 2,2,3,3 -d dsp.jack \ -M x,0,2,0,0,0 \ -M x,1,3,0,0,0 \ -M x,2,0,0,0,0 \ -M x,3,1,0,0,0 \ -t vdsp.ctl | su
Then start a HpsJAM server instance, like shown below.
echo HpsJam --server --peers 44 --ncpu 4 --cli-port 222 --port 700 --daemon --rtprio 8 | su
Then start jackd as a regular user, like shown below.
rtprio 8 jackd -d oss -d /dev/dsp.jack -r 48000 -p 256 &
Then start HpsJam as a regular user, either via the terminal or X.org:
HpsJam --mute-peer-audio --connect <your_server_ip:700>
On another machine use the HpsJam software to connect to the same HpsJam server instance. Multiple devices may connect to your server instance of HpsJam. This allows you to easily move from one device to another. Then you can basically use any audio application on the remote machine at very low latency. Also remember to add your regular user to the "realtime" group and load the mac_priority.ko .
Chrome linux-binary
[Linuxulator] How to run Google Chrome (linux-binary) on FreeBSD: sound, webcam, microphone, hardware acceleration all properly work.
FreeBSD in Audio Studio
Fosdem 2019 talk and slides: FreeBSD in Audio Studio, "FreeBSD is usually not the first choice for music art, but it has quite a lot to offer".
Audio profile
Audio profiles can be handled in userspace by:
<audio/mixertui> via -P/-p options and P/p keys, example
Bridge Device Drivers
How it works
TODO A few words on what the bridge device driver are and what they do.
Driver Matrix
Driver |
License |
Type |
Arch |
Maintainer |
snd_ai2s(4) |
BSD |
macio |
powerpc |
Marco Trillo <marcotrillo AT gmail DOT com>, Nathan Whitehorn <nwhitehorn AT FreeBSD DOT org> |
BSD |
pci |
|
|
|
BSD |
pci |
|
Ariff Abdullah <ariff AT FreeBSD DOT org> |
|
BSD |
pci |
|
|
|
BSD |
pci |
|
|
|
BSD |
pci |
|
|
|
snd_davbus(4) |
BSD |
macio |
powerpc |
Marco Trillo <marcotrillo AT gmail DOT com>, Nathan Whitehorn <nwhitehorn AT FreeBSD DOT org> |
BSD? |
pci |
|
|
|
BSD |
pci |
|
|
|
BSD |
pci |
|
Yuriy Tsibizov <yuriy.tsibizov AT gfk DOT ru> |
|
BSD |
pci |
|
Konstantin Dimitrov <kosio.dimitrov AT gmail DOT com> |
|
BSD |
pci |
|
Konstantin Dimitrov <kosio.dimitrov AT gmail DOT com> |
|
BSD |
pci |
|
|
|
BSD |
pci |
|
|
|
BSD |
pci |
|
Alexander Motin <mav AT FreeBSD DOT org> |
|
BSD |
pci |
|
Ruslan Bukin <br AT bsdpad DOT com> |
|
BSD |
pci |
|
|
|
BSD |
pci |
|
Untested |
|
BSD |
pci |
|
|
|
BSD |
pci |
|
|
|
BSD |
pci |
|
Konstantin Dimitrov <kosio.dimitrov AT gmail DOT com> |
|
BSD |
pci |
|
|
|
BSD |
pci |
|
|
|
BSD |
pci |
|
|
|
BSD |
usb |
|
Christos Margiolis <christos AT FreeBSD DOT org> |
snd_emu10kx
This driver now has the possibility to do multichannel recording. This is not for official use, it is only to be able to play around and develop this further until the generic parts of the soundsystem gain the possibility to handle multichannel streams.
Optional multichannel recording
(32 channels on Live!, 64 channels on Audigy)
All channels are 16bit/48000Hz/mono, format is fixed. Half of them are copied from sound output, another half can be used to record any data from DSP. What should be recorded is hardcoded in DSP code. In this version it records dummy data, but can be used to record all DSP inputs, for example.
Because there are no support of more-than-stereo sound streams multichannell stream is presented as one 32(64)*48000 Hz 16bit mono stream.
Channel map
SB Live! (4.0/5.1):
offset (words) |
substream |
0x00 |
Front L |
0x01 |
Front R |
0x02 |
Digital Front L |
0x03 |
Digital Front R |
0x04 |
Digital Center |
0x05 |
Digital Sub |
0x06 |
Headphones L |
0x07 |
Headphones R |
0x08 |
Rear L |
0x09 |
Rear R |
0x0A |
ADC (multi-rate recording) L |
0x0B |
ADC (multi-rate recording) R |
0x0C |
unused |
0x0D |
unused |
0x0E |
unused |
0x0F |
unused |
0x10 |
Analog Center (Live! 5.1) / dummy (Live! 4.0) |
0x11 |
Analog Sub (Live! 5.1) / dummy (Live! 4.0) |
0x12..-0x1F |
dummy |
Audigy / Audigy 2 / Audigy 2 Value / Audigy 4:
offset (words) |
substream |
0x00 |
Digital Front L |
0x01 |
Digital Front R |
0x02 |
Digital Center |
0x03 |
Digital Sub |
0x04 |
Digital Side L (7.1 cards) / Headphones L (5.1 cards) |
0x05 |
Digital Side R (7.1 cards) / Headphones R (5.1 cards) |
0x06 |
Digital Rear L |
0x07 |
Digital Rear R |
0x08 |
Front L |
0x09 |
Front R |
0x0A |
Center |
0x0B |
Sub |
0x0C |
Side L |
0x0D |
Side R |
0x0E |
Rear L |
0x0F |
Rear R |
0x10 |
output to AC97 input L (muted) |
0x11 |
output to AC97 input R (muted) |
0x12 |
unused |
0x13 |
unused |
0x14 |
unused |
0x15 |
unused |
0x16 |
ADC (multi-rate recording) L |
0x17 |
ADC (multi-rate recording) R |
0x18 |
unused |
0x19 |
unused |
0x1A |
unused |
0x1B |
unused |
0x1C |
unused |
0x1D |
unused |
0x1E |
unused |
0x1F |
unused |
0x20..0x3F |
dummy |
snd_envy24*
Envy24-based cards are the only consumer soundcards to far, that can offer true quality. They are 'bit-perfect' (no resampling) and use high-quality I2S codecs. That is why most of them -- even not professional grade ones -- have quality and features of professional boards.
Konstantin Dimitrov <kosio DOT dimitrov AT gmail DOT com> is the only person that is working on the Envy24 support under FreeBSD and his free time for that is very limited, so it will be extremely slow and when you look at envy24.svobodno.com, in the table, you will see how much work should be done (and the table is far from being full). For example there is no code at all for DITs (Digital Interface Transceivers) and if someone write module for DITs, like 'spicds' module, it can be reused by many audio drivers, for example Creative. At least on their new boards they use the same DIT ICs like the ones on Envy24-based boards, so the work exceeds far beyond dealing with Envy24 chips. Any help by owners of Envy24 based cards is more than welcome.
From an user point of view the behavior of snd_envy24(4) and snd_envy24ht(4) (and snd_spicds(4)) is stable enough, however they are highly experimental drivers and need a serious clean-up.
Currently Konstantin is working on adding support for all chips from the VT172x family and more hardware designs. Compared to extending the existing features, this is a huge amount of work. Every Envy24-based card has an unique hardware design. For this reason adding support for an Envy24-based card requires as a first step to reverse engineer the card hardware design. This step takes a huge part of the time to support a card.
The Envy24HT (VT1724) code initially intended for use with the Envy24HT-based card "Terratec Aureon 7.1 Space" actually proved itself to work with all other VT172x chips -- Envy24PT (VT1720), Envy24MT (VT1720T), Envy24HT-S (VT1721), Envy24GT (VT1722) and Envy24DT (VT1723 aka Tremor) -- with minor or no Envy24-related changes at all. This will affect the future of snd_envy24ht(4) and it may be renamed to "snd_vt172x(4)".
Support for cards that use I2C-to-GPIO expanders wired between the control line of the codec and the Envy24 chip is upcomming. This will affect snd_envy24(4). At the moment snd_envy24(4) supports only 3 cards. The work Konstantin is doing ATM may result in support for all VT1712-based cards made by Terratec and M-Audio. Probably then snd_envy24(4) will support about 10 cards then.
snd_envy24ht(4) already has support for more than 10 cards, including all cards made by Terratec and M-Audio that are based on VT172x. Support for cards that are made by the third major manufacturer of Envy24-based cards -- ESI and their consumer division Audiotrak -- is lacking because their cards are hard to find outside Korea and Japan. Konstantin thinks they made the best Envy24-based cards out there. So if you are willing to spend such a card, feel free to him/us.
The next update to snd_envy24ht(4) will maybe support the "Philips PSC724 Ultimate Edge", "Hercules Fortissimo4" and the very new "Audiotrak Prodigy 7.1 HiFi". They all are VT172x-based cards which use the WM8766+WM8776 chips and share the same hardware design.
All of this work to support all chips from the VT172x family and all possible hardware designs takes a huge amount of work and only covers the analog playback. Other features like recording, support for all hardware mixers, MIDI and all other features the envy24 chips provide are not implemented. Adding one of those features after each other -- at least for those chips where Konstantin collected the datasheets -- should be easy. It is not that time consuming, but Konstantin can not spend time for them. Anyone interested in some of those features is encouraged to have a look at the datasheets envy24.svobodno.com and to send some patches.
Development
Implementation
Header: https://cgit.freebsd.org/src/tree/sys/sys/soundcard.h
Mirror: https://github.com/freebsd/freebsd/tree/master/sys/dev/sound
Getting started your projects
The sound system is OSSv4 compatible so you can use its API to interface to the kernel and hardware:
- FreeBSD implementation:
IOCTL Reference, from RyanBeasley
Locking in the Sound System, from RyanBeasley
Write new Driver
New driver resources:
The FreeBSD Architecture Handbook: Sound Subsystem
FreeBSD Kernel Sound Device Code Reference Manual: Doxygen PDF, from AlexanderLeidinger
Sound Driver Template, from Cameron Grant
The device(9) manual page
The driver(9) manual page
The devclass(9) manual page
Audio Subsystem on Single Board Computers, from OleksandrTymoshenko
Problems
Troubleshooting
Mailing list for multimedia and audio support.
FreeBSD has a web based forum, the Multimedia subforum is a good place to discuss sound issues.
Open Problem Reports
Everyone is encouraged to look at the following reports and fix things, if possible. If a report appears odd, or if you think that the problem has been fixed, add a comment to the report.
Critical problems
- No problems at the moment
Serious problems
kern/107516 - [sound] [snd_emu10k1] - skips, clicks and lag after a day of heavy usage
kern/114760 - [sound] [snd_cmi] snd_cmi driver causing sporadic system hangs
kern/132848 - [sound] [snd_emu10kx] driver problem with card init, snd_emu10k1 inits card correctly
Non-critical problems
kern/23546 - [sound] [snd_csa] [patch] csa DMA-interrupt problem
kern/72995 - [sound] Intel ICH2 (82801BA) - sound nearly inaudible
kern/87782 - [sound] snd_t4dwave and pcm0:record:0: record interrupt timeout, channel dead
kern/98496 - [sound] [snd_ich] some functions don't work in my sound kernel module
kern/100859 - [sound] [snd_ich] snd_ich broken on GIGABYTE 915 system
kern/120780 - [sound] [snd_hda] snd_hda doesn't work on Dell Latitutude D530
kern/120857 - [sound] [snd_emu10k1] snd_emu10k1 driver issues a warning on unload
kern/121962 - [sound] [snd_emu10k1] [panic] Kernel panics with device polling and snd_emu10k1.ko enabled and network load
kern/125756 - [sound] [patch] cannot detect soft-modem on HDA bus
kern/129604 - [sound] Sound stops with error: pcm0:virtual:dsp0.vp0: play interrupt timeout, channel dead
kern/132511 - [sound] [snd_hda] Probing ALC888 codec on ASRock K10N78-1394 fails
kern/134767 - [sound] [snd_hda] [regression] Sigmatel STAC9205X no sound under RELENG_7_2_0_RELEASE
Reporting Bugs
If you have found a bug, make sure that you report it. There are two preferred ways to report bugs and problems concerning the FreeBSD sound system:
Use the web interface to send bug report, it gets archived in the FreeBSD bug database.
Send it directly to the FreeBSD multimedia mailing list.
The FreeBSD sound system can spit out quite a lot of debug information if you know how to access it. This is a list of things that you probably should include in a good bug report.
What version of FreeBSD are we running:
$ uname -a FreeBSD foo.bar.com 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r360723: Thu May 7 04:33:35 UTC 2020 root@foo.bar.com:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
Status of the sound module:
# sysctl hw.snd.verbose=2 $ cat /dev/sndstat [...]
Mixer values:
$ mixer pcm0:mixer: <Realtek ALC257 (Analog 2.0+HP/2.0)> on hdaa0 (play/rec) (default) vol = 0.85:0.85 pbk pcm = 1.00:1.00 pbk speaker = 1.00:1.00 pbk rec = 0.37:0.37 pbk ogain = 1.00:1.00 pbk monitor = 0.67:0.67 rec src
The hw.snd sysctl tree:
$ sysctl hw.snd hw.snd.maxautovchans: 16 hw.snd.default_unit: 0 hw.snd.version: 2009061500/amd64 hw.snd.default_auto: 1 hw.snd.verbose: 0 hw.snd.vpc_mixer_bypass: 1 hw.snd.feeder_rate_quality: 1 hw.snd.feeder_rate_round: 25 hw.snd.feeder_rate_max: 2016000 hw.snd.feeder_rate_min: 1 hw.snd.feeder_rate_polyphase_max: 183040 hw.snd.feeder_rate_presets: 100:8:0.85 100:36:0.92 100:164:0.97 hw.snd.feeder_eq_exact_rate: 0 hw.snd.feeder_eq_presets: PEQ:16000,0.2500,62,0.2500:-9,9,1.0:44100,48000,88200,96000,176400,192000 hw.snd.basename_clone: 1 hw.snd.compat_linux_mmap: 0 hw.snd.syncdelay: -1 hw.snd.usefrags: 0 hw.snd.vpc_reset: 0 hw.snd.vpc_0db: 45 hw.snd.vpc_autoreset: 1 hw.snd.timeout: 5 hw.snd.latency_profile: 1 hw.snd.latency: 2 hw.snd.report_soft_matrix: 1 hw.snd.report_soft_formats: 1
The dev.pcm sysctl tree:
$ sysctl dev.pcm dev.pcm.2.mode: 3 dev.pcm.2.bitperfect: 0 dev.pcm.2.buffersize: 65536 dev.pcm.2.play.vchanformat: s16le:2.0 dev.pcm.2.play.vchanrate: 48000 dev.pcm.2.play.vchanmode: passthrough dev.pcm.2.play.vchans: 1 dev.pcm.2.play.32bit: 24 dev.pcm.2.%parent: hdaa1 dev.pcm.2.%pnpinfo: dev.pcm.2.%location: nid=3 dev.pcm.2.%driver: pcm dev.pcm.2.%desc: Intel Kaby Lake (HDMI/DP 8ch) dev.pcm.1.mode: 5 dev.pcm.1.bitperfect: 0 dev.pcm.1.buffersize: 65536 dev.pcm.1.rec.vchanformat: s16le:2.0 dev.pcm.1.rec.vchanrate: 48000 dev.pcm.1.rec.vchanmode: fixed dev.pcm.1.rec.vchans: 1 dev.pcm.1.rec.autosrc: 2 dev.pcm.1.rec.32bit: 24 dev.pcm.1.%parent: hdaa0 dev.pcm.1.%pnpinfo: dev.pcm.1.%location: nid=25 dev.pcm.1.%driver: pcm dev.pcm.1.%desc: Realtek ALC257 (Right Analog Mic) dev.pcm.0.mode: 7 dev.pcm.0.bitperfect: 0 dev.pcm.0.buffersize: 65536 dev.pcm.0.rec.vchanformat: s16le:2.0 dev.pcm.0.rec.vchanrate: 48000 dev.pcm.0.rec.vchanmode: fixed dev.pcm.0.rec.vchans: 1 dev.pcm.0.rec.autosrc: 2 dev.pcm.0.rec.32bit: 24 dev.pcm.0.play.vchanformat: s16le:2.0 dev.pcm.0.play.vchanrate: 48000 dev.pcm.0.play.vchanmode: fixed dev.pcm.0.play.vchans: 2 dev.pcm.0.play.32bit: 24 dev.pcm.0.%parent: hdaa0 dev.pcm.0.%pnpinfo: dev.pcm.0.%location: nid=20,33,18 dev.pcm.0.%driver: pcm dev.pcm.0.%desc: Realtek ALC257 (Analog 2.0+HP/2.0) dev.pcm.%parent:
Verbose boot. First, reboot your machine. When the startup menu appear, choose option number 5 to boot with verbose messages turned on. When the machine has booted, use the grep utility to find startup messages related to the sound system:
% dmesg | grep 'pcm[0-9]' pcm0: <AudioPCI ES1371-A> port 0x2040-0x207f irq 16 at device 2.0 on pci2 pcm0: Reserved 0x40 bytes for rid 0x10 type 4 at 0x2040 pcm0: <Cirrus Logic CS4297A AC97 Codec (id = 0x43525913)> pcm0: Codec features 6 bit master volume, no 3D Stereo Enhancement pcm0: ac97 codec dac ready count: 0 pcm0: Mixer "vol": pcm0: Mixer "pcm": pcm0: Mixer "line": pcm0: Mixer "mic": pcm0: Mixer "cd": pcm0: Mixer "rec": pcm0: Mixer "igain": pcm0: Mixer "line1": pcm0: Mixer "phin": pcm0: Mixer "video": pcm0: [MPSAFE] pcm0: [ITHREAD] pcm0: clone manager: deadline=750ms flags=0x8000001e pcm0: sndbuf_setmap 1f3c000, 1000; 0xc473c000 -> 1f3c000 pcm0: sndbuf_setmap 1f3e000, 1000; 0xc473e000 -> 1f3e000 pcm0: sndbuf_setmap 1f40000, 1000; 0xc4740000 -> 1f40000 pcm0: <Playback: DAC1,DAC2 / Record: ADC>