FreeBSD supports a wide variety of sound cards, allowing users to enjoy high fidelity output from a FreeBSD system.
-This includes the ability to record and play back audio in the MPEG Audio Layer 3 (`MP3`), Waveform Audio File (`WAV`), Ogg Vorbis, and other formats.
-The FreeBSD Ports Collection contains many applications for editing recorded audio, adding sound effects, and controlling attached MIDI devices.
-FreeBSD also supports the playback of video files and ``DVD``s.
-The FreeBSD Ports Collection contains applications to encode, convert, and playback various video media.
+Before reading this chapter, you should:
-This chapter describes how to configure sound cards, video playback, TV tuner cards, and scanners on FreeBSD.
-It also describes some of the applications which are available for using these devices.
+* Know how to install applications as described in crossref:ports[ports,Installing Applications: Packages and Ports].
After reading this chapter, you will know how to:
@@ -75,109 +71,47 @@
* Configure an image scanner.
* Configure a Bluetooth headset.
-Before reading this chapter, you should:
-
-* Know how to install applications as described in crossref:ports[ports,Installing Applications: Packages and Ports].
-
[[sound-setup]]
== Setting Up the Sound Card
-Before beginning the configuration, determine the model of the sound card and the chip it uses.
-FreeBSD supports a wide variety of sound cards.
-Check the supported audio devices list of the link:{u-rel120-hardware}[Hardware Notes] to see if the card is supported and which FreeBSD driver it uses.
-
-In order to use the sound device, its device driver must be loaded.
-The easiest way is to load a kernel module for the sound card with man:kldload[8].
-This example loads the driver for a built-in audio chipset based on the Intel specification:
-
-[source,shell]
-....
-# kldload snd_hda
-....
-
-To automate the loading of this driver at boot time, add the driver to [.filename]#/boot/loader.conf#.
-The line for this driver is:
+By default, FreeBSD will automatically detect the sound card used by the system.
+FreeBSD supports a wide variety of sound cards, the list of supported sound cards can be consulted in man:sound[4].
-[.programlisting]
-....
-snd_hda_load="YES"
-....
+[NOTE]
+====
+It is only necessary to load the sound card module in case FreeBSD has not detected it correctly.
+====
-Other available sound modules are listed in [.filename]#/boot/defaults/loader.conf#.
-When unsure which driver to use, load the [.filename]#snd_driver# module:
+In case of not knowing which sound card the system has or which module to use the `snd_driver` metadriver can be loaded executing the following command:
[source,shell]
....
# kldload snd_driver
....
-This is a metadriver which loads all of the most common sound drivers and can be used to speed up the search for the correct driver.
-It is also possible to load all sound drivers by adding the metadriver to [.filename]#/boot/loader.conf#.
-
-To determine which driver was selected for the sound card after loading the [.filename]#snd_driver# metadriver, type `cat /dev/sndstat`.
-
-=== Configuring a Custom Kernel with Sound Support
-
-This section is for users who prefer to statically compile in support for the sound card in a custom kernel.
-For more information about recompiling a kernel, refer to crossref:kernelconfig[kernelconfig,Configuring the FreeBSD Kernel].
-
-When using a custom kernel to provide sound support, make sure that the audio framework driver exists in the custom kernel configuration file:
-
-[.programlisting]
-....
-device sound
-....
-
-Next, add support for the sound card.
-To continue the example of the built-in audio chipset based on the Intel specification from the previous section, use the following line in the custom kernel configuration file:
+Alternatively, to load the driver as a module at boot time, place the following line in [.filename]#/boot/loader.conf#:
[.programlisting]
....
-device snd_hda
+snd_hda_load="YES"
....
-Be sure to read the manual page of the driver for the device name to use for the driver.
+[[sound-testing]]
+=== Testing Sound
-Non-PnP ISA sound cards may require the IRQ and I/O port settings of the card to be added to [.filename]#/boot/device.hints#.
-During the boot process, man:loader[8] reads this file and passes the settings to the kernel.
-For example, an old Creative SoundBlaster(R) 16 ISA non-PnP card will use the man:snd_sbc[4] driver in conjunction with `snd_sb16`.
-For this card, the following lines must be added to the kernel configuration file:
+To confirm the sound card is detected the following command can be executed:
-[.programlisting]
+[source,shell]
....
-device snd_sbc
-device snd_sb16
+% dmesg | grep pcm
....
-If the card uses the `0x220` I/O port and IRQ `5`, these lines must also be added to [.filename]#/boot/device.hints#:
+The output should be similar to the following:
[.programlisting]
....
-hint.sbc.0.at="isa"
-hint.sbc.0.port="0x220"
-hint.sbc.0.irq="5"
-hint.sbc.0.drq="1"
-hint.sbc.0.flags="0x15"
-....
-
-The syntax used in [.filename]#/boot/device.hints# is described in man:sound[4] and the manual page for the driver of the sound card.
-
-The settings shown above are the defaults.
-In some cases, the IRQ or other settings may need to be changed to match the card.
-Refer to man:snd_sbc[4] for more information about this card.
-
-[[sound-testing]]
-=== Testing Sound
-
-After loading the required module or rebooting into the custom kernel, the sound card should be detected.
-To confirm, run `dmesg | grep pcm`.
-This example is from a system with a built-in Conexant CX20590 chipset:
-
-[source,shell]
-....
-pcm0: <NVIDIA (0x001c) (HDMI/DP 8ch)> at nid 5 on hdaa0
-pcm1: <NVIDIA (0x001c) (HDMI/DP 8ch)> at nid 6 on hdaa0
-pcm2: <Conexant CX20590 (Analog 2.0+HP/2.0)> at nid 31,25 and 35,27 on hdaa1
+pcm0: <Conexant CX20561 (Hermosa) (Analog 2.0+HP/2.0)> at nid 26,22 and 24 on hdaa0
+pcm1: <Conexant CX20561 (Hermosa) (Internal Analog Mic)> at nid 29 on hdaa0
....
The status of the sound card may also be checked using this command:
+pcm1: <Conexant CX20561 (Hermosa) (Internal Analog Mic)> (rec)
....
-[WARNING]
-====
-Audio ``CD``s have specialized encodings which means that they should not be mounted using man:mount[8].
-====
-
-Various applications, such as package:audio/workman[], provide a friendlier interface.
-The package:audio/mpg123[] port can be installed to listen to MP3 audio files.
+If no `pcm` devices are listed, double-check that the correct device driver was loadedl.
+If all goes well, the sound card should now work in FreeBSD.
-Another quick way to test the card is to send data to [.filename]#/dev/dsp#:
+A quick way to test the card is to send data to [.filename]#/dev/dsp# executint the following command, where [.filename]#filename# can be any type of file:
[source,shell]
....
% cat filename > /dev/dsp
....
-where [.filename]#filename# can be any type of file.
This command should produce some noise, confirming that the sound card is working.
[NOTE]
@@ -228,6 +148,38 @@
When not in use, they do not exist and will not appear in the output of man:ls[1].
====
+[[sound-mixer]]
+=== Mixer
+
+FreeBSD has different utilities to set/display sound card mixer values built on the FreeBSD Sound System: