pcm on 5.1

David Kelly dkelly at HiWAAY.net
Thu Jul 3 19:15:07 PDT 2003

On Thursday 03 July 2003 07:01 pm, Kenneth Culver wrote:
> On Thursday, July 3, 2003, at 07:58  PM, Laszlo Vagner wrote:
> > I just updated to 5.1-r and was wondering how to add soundcard
> > support to the
> > kernel.?
> >
> > in 4.8 i just added 'device pcm' in my kernel config and recompiled
> > but 5.1 is different
> > and i dont want to do something to mess things up.
> >
> > dmesg follows.
> Just do what you've always done. Add device pcm to your kernel.

I don't think its quite that easy, but its even easier now.

% cd /usr/src/sys/i386/conf
% grep -i pcm *
GENERIC:# Pcmcia and cardbus bridge support
GRUMPY:# Pcmcia and cardbus bridge support
NOTES:# pca: PCM audio through your PC speaker
NOTES:# gp:  National Instruments AT-GPIB and AT-GPIB/TNT board, PCMCIA-GPIB
OLDCARD:device          pcic            # PCMCIA bridge

Does not appear to be a pcm device available for statically compiling 
into the kernel. But never mind as its available as a kld in

So go look in /boot/kernel/snd_* for the device which matches your 
sound hardware and use kldload to give it a try something like this:

% su
# kldload snd_es137x

I have it loading at boot time now, so kldstat looks like this:

# kldstat
Id Refs Address    Size     Name
 1   12 0xc0100000 37aa68   kernel
 2    1 0xc047b000 6190     snd_es137x.ko
 3    2 0xc0482000 1d320    snd_pcm.ko
 4    1 0xc04a0000 4a30c    acpi.ko
 5    1 0xc346d000 7000     ipfw.ko
 6    1 0xc34bc000 2000     blank_saver.ko
 7    1 0xc3592000 18000    linux.ko

Notice snd_es137x needed snd_pcm and pulled it in too.

snd_driver is a mega-module including all the other snd modules. If 
you are not sure about what sound hardware you have, then 
"kldload snd_driver" and go look at the tail of dmesg to see what 

Then when you know what is needed edit /boot/loader.conf. Add a line
like this as I have done for snd_es137x to load the module at boot:


Now the head of my dmesg looks like this after boot:

Copyright (c) 1992-2003 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD 5.1-RELEASE #0: Thu Jul  3 16:27:56 CDT 2003
    dkelly at grumpy.dyndns.org:/usr/obj/usr/src/sys/GRUMPY
Preloaded elf kernel "/boot/kernel/kernel" at 0xc04ec000.
Preloaded elf module "/boot/kernel/snd_es137x.ko" at 0xc04ec21c.
Preloaded elf module "/boot/kernel/snd_pcm.ko" at 0xc04ec2cc.
Preloaded elf module "/boot/kernel/acpi.ko" at 0xc04ec378.

So all you have to do is add the right line to /boot/loader.conf. No
recompiling the kernel or anything else complex.

David Kelly N4HHE, dkelly at hiwaay.net
The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.

More information about the freebsd-questions mailing list