pavement

Sound card

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
m (Compiling the Sound Card into Kernel)
(FreeBSD 7+ Sound)
 
(3 intermediate revisions by one user not shown)
Line 3: Line 3:
 
== Loading the Kernel Driver Module ==
 
== Loading the Kernel Driver Module ==
  
=== FreeBSD 4+ Sound ===
+
=== FreeBSD 7+ Sound ===
  
For this you need to use [[kldload]] to load your sound driver. If you don't know which sound card you have -- and therefore don't know which driver to use -- you can load the generic [[snd_driver]] module (in 5.x systems -- in 4.x you need to load the [[snd]] module), which works for most cards, like so:
+
At this point in FreeBSD's development, it's even a little simpler to determine which snd_ module to load in some cases.
  
   samizdata# kldload snd_driver  
+
   > kldload snd_driver
 +
  > cat /dev/sndstat
 +
  FreeBSD Audio Driver (newpcm: 32bit 2007061600/i386)
 +
  Installed devices:
 +
  pcm0: <Intel ICH6 (82801FB)> at io 0x90040800, 0x90040400 irq 22 bufsz 16384 kld snd_ich [MPSAFE] (1p:1v/1r:1v channels duplex default)
  
If that works, you'll probably want it to load automatically at boot timeTo do so, you'll want to append a line about snd_driver to your loader.conf:
+
In this case it's really obvious from the "kld snd_ich" that the module for this card is snd_ichSometimes it won't be so obvious, but the name shown for the card should also be a big hint.  So I add to my /boot/loader.conf:
  
samizdata# echo snd_driver_load="YES" >> /boot/loader.conf
+
  snd_ich_load="YES"
  
And presto, when booting, your system will always try to load snd_driver.
+
If it's not directly displayed there, check dmesg for the name of the default sound output. For instance:
  
If you don't know your sound card type the following:
+
  > dmesg | grep ICH6
# man sound
+
Now look at the SEE ALSO section and start loading each of these until your sound works.
+
  
For instance for an ASUS A8V board it's a running a VIA sound card so I would run:
+
====Compiling the Sound Card into Kernel====
  # kldload snd_via8233
+
Instead of loading the sound card into ''loader.conf'', it can be compiled into the kernel. To do this, using the sound card identified in the above example, check that the following lines are in the kernel configuration file ''/usr/src/sys/*/conf/CUSTOM'' :
 +
device    sound
 +
device    snd_ich
 +
  # other unused "snd_" items can be commented out
  
If this works I put this line into my /boot/loader.conf
+
Then rebuild the kernel:
  snd_via8233_load="YES"
+
% cd /usr/src/
 
+
  % make buildkernel KERNCONF=CUSTOM
That way it's loaded at boot time without having to recompile the kernel.
+
% make installkernel KERNCONF=CUSTOM
  
 +
That's it for the sound driver configuration.
  
 
=== FreeBSD5.4 and above Sound ===
 
=== FreeBSD5.4 and above Sound ===
Line 55: Line 61:
 
Of course remember to replace snd_ich_load with whatever your individual device is.
 
Of course remember to replace snd_ich_load with whatever your individual device is.
  
=== FreeBSD 7+ Sound ===
+
=== FreeBSD 4+ Sound ===
  
At this point in FreeBSD's development, it's even a little simpler to determine which snd_ module to load in some cases.
+
For this you need to use [[kldload]] to load your sound driver. If you don't know which sound card you have -- and therefore don't know which driver to use -- you can load the generic [[snd_driver]] module (in 5.x systems -- in 4.x you need to load the [[snd]] module), which works for most cards, like so:
  
   > kldload snd_driver
+
   samizdata# kldload snd_driver  
  > cat /dev/sndstat
+
  FreeBSD Audio Driver (newpcm: 32bit 2007061600/i386)
+
  Installed devices:
+
  pcm0: <Intel ICH6 (82801FB)> at io 0x90040800, 0x90040400 irq 22 bufsz 16384 kld snd_ich [MPSAFE] (1p:1v/1r:1v channels duplex default)
+
  
In this case it's really obvious from the "kld snd_ich" that the module for this card is snd_ichSometimes it won't be so obvious, but the name shown for the card should also be a big hint.  So I add to my /boot/loader.conf:
+
If that works, you'll probably want it to load automatically at boot timeTo do so, you'll want to append a line about snd_driver to your loader.conf:
  
  snd_ich_load="YES"
+
samizdata# echo snd_driver_load="YES" >> /boot/loader.conf
  
====Compiling the Sound Card into Kernel====
+
And presto, when booting, your system will always try to load snd_driver.
Instead of loading the sound card into ''loader.conf'', it can be compiled into the kernel. To compile the sound card into the kernel using the sound card in the above example, check that the following lines are in the configuration file ''/usr/src/sys/*/conf/CUSTOM'':
+
device    sound
+
device    snd_ich
+
# other unused "snd_" items can be commented out
+
  
Then rebuild the kernel:
+
If you don't know your sound card type the following:
  % cd /usr/src/
+
  # man sound
% make buildkernel KERNCONF=CUSTOM
+
Now look at the SEE ALSO section and start loading each of these until your sound works.
% make installkernel KERNCONF=CUSTOM
+
  
That's it for the sound driver configuration on a 7.x system.
+
For instance for an ASUS A8V board it's a running a VIA sound card so I would run:
 +
# kldload snd_via8233
 +
 
 +
If this works I put this line into my /boot/loader.conf
 +
snd_via8233_load="YES"
 +
 
 +
That way it's loaded at boot time without having to recompile the kernel.
  
 
== External Links ==
 
== External Links ==

Latest revision as of 00:37, 7 February 2021

In order to get sound out of your FreeBSD box, you'll need to either load your sound driver module or compile sound support in your kernel -- it's not installed by default.

Contents

[edit] Loading the Kernel Driver Module

[edit] FreeBSD 7+ Sound

At this point in FreeBSD's development, it's even a little simpler to determine which snd_ module to load in some cases.

  > kldload snd_driver
  > cat /dev/sndstat
  FreeBSD Audio Driver (newpcm: 32bit 2007061600/i386)
  Installed devices:
  pcm0: <Intel ICH6 (82801FB)> at io 0x90040800, 0x90040400 irq 22 bufsz 16384 kld snd_ich [MPSAFE] (1p:1v/1r:1v channels duplex default)

In this case it's really obvious from the "kld snd_ich" that the module for this card is snd_ich. Sometimes it won't be so obvious, but the name shown for the card should also be a big hint. So I add to my /boot/loader.conf:

  snd_ich_load="YES"

If it's not directly displayed there, check dmesg for the name of the default sound output. For instance:

  > dmesg | grep ICH6

[edit] Compiling the Sound Card into Kernel

Instead of loading the sound card into loader.conf, it can be compiled into the kernel. To do this, using the sound card identified in the above example, check that the following lines are in the kernel configuration file /usr/src/sys/*/conf/CUSTOM :

device     sound
device     snd_ich
# other unused "snd_" items can be commented out

Then rebuild the kernel:

% cd /usr/src/
% make buildkernel KERNCONF=CUSTOM
% make installkernel KERNCONF=CUSTOM

That's it for the sound driver configuration.

[edit] FreeBSD5.4 and above Sound

Since 27/07/04 the sound system has changed a lot and now to install sound under FreeBSD you have to do the following:

 freebsd# kldload sound

Then find out your sound card. I'm using an ASUS A7N8X motherboard with Nvidia onboard sound so I typed

 freebsd# kldload snd_ich

To find out what driver will work with your sound board/chip have a look at the NOTES file in /usr/src/sys/conf/NOTES - search for 'snd' and you will find descriptions of all the different sound drivers. (The impatient may want to try running this shell script instead, which will automatically check each sound driver installed on the system to see if it works, and let you know what it found out.)

Then when I had tested this and it worked I entered the following into my kernel:


# Base sound driver - required for all cards
device sound

# Device-specific driver - may be different on other systems besides mine!
device snd_ich

and recompiled. However, recompiling the kernel is absolutely NOT necessary for sound support, as you can just dynamically load the modules for sound support at boot time, by adding lines to /boot/loader.conf:

sound_load="YES"
snd_ich_load="YES"

Of course remember to replace snd_ich_load with whatever your individual device is.

[edit] FreeBSD 4+ Sound

For this you need to use kldload to load your sound driver. If you don't know which sound card you have -- and therefore don't know which driver to use -- you can load the generic snd_driver module (in 5.x systems -- in 4.x you need to load the snd module), which works for most cards, like so:

  samizdata# kldload snd_driver 

If that works, you'll probably want it to load automatically at boot time. To do so, you'll want to append a line about snd_driver to your loader.conf:

samizdata# echo snd_driver_load="YES" >> /boot/loader.conf

And presto, when booting, your system will always try to load snd_driver.

If you don't know your sound card type the following:

# man sound

Now look at the SEE ALSO section and start loading each of these until your sound works.

For instance for an ASUS A8V board it's a running a VIA sound card so I would run:

# kldload snd_via8233

If this works I put this line into my /boot/loader.conf

snd_via8233_load="YES"

That way it's loaded at boot time without having to recompile the kernel.

[edit] External Links

FreeBSD Handbook

Personal tools