I am new to BSD and I am experimenting with getting an old(ish) Packard Bell desktop machine out of mothballs. The basic installation of FreeBSD 10.1-RELEASE for amd64 seems to have gone fine, but I am stuck trying to get the sound card working.The hardware is based on a Gigabyte motherboard hosting an Intel P4 processor, with integrated audio that uses the Intel High Definition Audio chipset. Under Linux the audio driver selected is snd_hda_intel, and the expectation under FreeBSD was that the snd_hda module would drive the audio.After installing FreeBSD the sound was not working, but I followed the instructions available online in a number of places, using kldload to experiment with different drivers. I found that the amd64 GENERIC kernel already has sound and many sound drivers pre-loaded, so efforts to use kldload were misplaced. However, there is no record of any driver installed in the /dev/sndstat file, and attempts to make noise by typing cat /random > /dev/dsp return error messages saying the operation is not allowed. What I want to know is, am I wasting my effort to get an ageing sound card working, or is there some trick I have missed?Further Information:This section was added at the suggestion of contributors to answers.The output of pciconf -lv has the following entry for the audio controller:hdac0@pci0:0:27:0:  class=0x040300 card=0xe0111631 chip=0x26688086 rev=0x03 hdr=0x00    vendor     = 'Intel Corporation'    device     = '82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller'    class      = multimedia    subclass   = HDAThe output of dmesg is as follows:Copyright (c) 1992-2014 The FreeBSD Project.Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994The Regents of the University of California. All rights reserved.FreeBSD is a registered trademark of The FreeBSD Foundation.FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 21:02:49 UTC 2014    root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512VT: running with driver vga.module_register: module at91_mci/mmc already exists!Module at91_mci/mmc failed to register: 17module_register: module sdhci_bcm/mmc already exists!Module sdhci_bcm/mmc failed to register: 17module_register: module sdhci_fdt/mmc already exists!Module sdhci_fdt/mmc failed to register: 17module_register: module sdhci_imx/mmc already exists!Module sdhci_imx/mmc failed to register: 17module_register: module sdhci_pci/mmc already exists!Module sdhci_pci/mmc failed to register: 17module_register: module sdhci_ti/mmc already exists!Module sdhci_ti/mmc failed to register: 17module_register: module ti_mmchs/mmc already exists!Module ti_mmchs/mmc failed to register: 17module_register: module mmc/mmcsd already exists!Module mmc/mmcsd failed to register: 17CPU: Intel(R) Pentium(R) 4 CPU 3.06GHz (3059.06-MHz K8-class CPU)  Origin = GenuineIntel  Id = 0xf41  Family = 0xf  Model = 0x4  Stepping = 1  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>  Features2=0x651d<SSE3,DTES64,MON,DS_CPL,TM2,CNXT-ID,CX16,xTPR>  AMD Features=0x20100800<SYSCALL,NX,LM>  TSC: P-state invariantreal memory  = 3221225472 (3072 MB)avail memory = 3090366464 (2947 MB)Event timer LAPIC quality 400ACPI APIC Table: <GBT    AWRDACPI>ioapic0 <Version 2.0> irqs 0-23 on motherboardrandom: <Software, Yarrow> initializedmodule_register_init: MOD_LOAD (vesa, 0xffffffff80d942e0, 0) error 19kbd1 at kbdmux0acpi0: <GBT AWRDACPI> on motherboardacpi0: Power Button (fixed)acpi0: reservation of 0, a0000 (3) failedacpi0: reservation of 100000, bfef0000 (3) failedcpu0: <ACPI CPU> on acpi0attimer0: <AT timer> port 0x40-0x43 irq 0 on acpi0Timecounter i8254 frequency 1193182 Hz quality 0Event timer i8254 frequency 1193182 Hz quality 100atrtc0: <AT realtime clock> port 0x70-0x73 irq 8 on acpi0Event timer RTC frequency 32768 Hz quality 0acpi_button0: <Power Button> on acpi0pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0pci0: <ACPI PCI bus> on pcib0pcib1: <PCI-PCI bridge> irq 16 at device 1.0 on pci0pci1: <PCI bus> on pcib1vgapci0: <VGA-compatible display> port 0x9000-0x90ff mem 0xe0000000-0xe3ffffff,0xe5000000-0xe500ffff irq 16 at device 0.0 on pci1vgapci0: Boot video devicevgapci1: <VGA-compatible display> mem 0xe5010000-0xe501ffff at device 0.1 on pci1hdac0: <Intel 82801F HDA Controller> mem 0xe6100000-0xe6103fff irq 16 at device 27.0 on pci0uhci0: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-A> port 0xbc00-0xbc1f irq 23 at device 29.0 on pci0usbus0 on uhci0uhci1: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-B> port 0xb000-0xb01f irq 19 at device 29.1 on pci0usbus1 on uhci1uhci2: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-C> port 0xb400-0xb41f irq 18 at device 29.2 on pci0usbus2 on uhci2uhci3: <Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-D> port 0xb800-0xb81f irq 16 at device 29.3 on pci0usbus3 on uhci3ehci0: <Intel 82801FB (ICH6) USB 2.0 controller> mem 0xe6104000-0xe61043ff irq 23 at device 29.7 on pci0usbus4: EHCI version 1.0usbus4 on ehci0pcib2: <ACPI PCI-PCI bridge> at device 30.0 on pci0pci2: <ACPI PCI bus> on pcib2ath0: <Atheros 9220> mem 0xe6000000-0xe600ffff irq 20 at device 0.0 on pci2ath0: [HT] enabling HT modesath0: [HT] 1 stream STBC receive enabledath0: [HT] 1 stream STBC transmit enabledath0: [HT] 2 RX streams; 2 TX streamsath0: AR9220 mac 128.2 RF5133 phy 13.0ath0: 2GHz radio: 0x0000; 5GHz radio: 0x00c0pci2: <simple comms, generic modem> at device 1.0 (no driver attached)rl0: <RealTek 8139 10/100BaseTX> port 0xa400-0xa4ff mem 0xe6014000-0xe60140ff irq 21 at device 5.0 on pci2miibus0: <MII bus> on rl0rlphy0: <RealTek internal media interface> PHY 0 on miibus0rlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, autorl0: Ethernet address: 00:14:85:40:4d:00pci2: <serial bus, FireWire> at device 7.0 (no driver attached)isab0: <PCI-ISA bridge> at device 31.0 on pci0isa0: <ISA bus> on isab0atapci0: <Intel ICH6 SATA150 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xf000-0xf00f at device 31.2 on pci0ata0: <ATA channel> at channel 0 on atapci0ata1: <ATA channel> at channel 1 on atapci0uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0uart1: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0ppc0: <Parallel port> port 0x378-0x37f,0x778-0x77b irq 7 drq 3 on acpi0ppc0: Generic chipset (ECP/PS2/NIBBLE) in COMPATIBLE modeppc0: FIFO with 16/16/16 bytes thresholdppbus0: <Parallel port bus> on ppc0lpt0: <Printer> on ppbus0lpt0: Interrupt-driven portppi0: <Parallel I/O> on ppbus0atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0atkbd0: <AT Keyboard> irq 1 on atkbdc0kbd0 at atkbd0atkbd0: [GIANT-LOCKED]orm0: <ISA Option ROMs> at iomem 0xc0000-0xcbfff,0xcc000-0xd3fff,0xd4000-0xd4fff on isa0p4tcc0: <CPU Frequency Thermal Control> on cpu0random: unblocking device.usbus0: 12Mbps Full Speed USB v1.0fuse-freebsd: version 0.4.4, FUSE ABI 7.8Timecounters tick every 1.000 msechdacc0: <Realtek ALC880 HDA CODEC> at cad 2 on hdac0hdaa0: <Realtek ALC880 Audio Function Group> at nid 1 on hdacc0usbus1: 12Mbps Full Speed USB v1.0usbus2: 12Mbps Full Speed USB v1.0usbus3: 12Mbps Full Speed USB v1.0ugen0.1: <Intel> at usbus0uhub0: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0ugen1.1: <Intel> at usbus1uhub1: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1ugen2.1: <Intel> at usbus2uhub2: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus2ugen3.1: <Intel> at usbus3uhub3: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus3usbus4: 480Mbps High Speed USB v2.0ugen4.1: <Intel> at usbus4uhub4: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus4uhub0: 2 ports with 2 removable, self powereduhub1: 2 ports with 2 removable, self powereduhub2: 2 ports with 2 removable, self powereduhub3: 2 ports with 2 removable, self poweredada0 at ata0 bus 0 scbus0 target 0 lun 0ada0: <ST3200826AS 3.03> ATA-7 SATA 1.x deviceada0: Serial Number 5ND1T70Sada0: 150.000MB/s transfers (SATA, UDMA5, PIO 8192bytes)ada0: 190782MB (390721968 512 byte sectors: 16H 63S/T 16383C)ada0: Previously was known as ad0cd0 at ata1 bus 0 scbus1 target 0 lun 0cd0: <HL-DT-ST DVD-ROM GDR8163B 0N21> Removable CD-ROM SCSI-0 device cd0: 66.700MB/s transfers (UDMA4, ATAPI 12bytes, PIO 65534bytes)cd0: Attempt to query device size failed: NOT READY, Medium not presentcd1 at ata1 bus 0 scbus1 target 1 lun 0cd1: <PHILIPS DVDR1628P1 Q2.4> Removable CD-ROM SCSI-0 device cd1: Serial Number V7121S52961724cd1: 33.300MB/s transfers (UDMA2, ATAPI 12bytes, PIO 65534bytes)cd1: Attempt to query device size failed: NOT READY, Medium not presentTimecounter TSC-low frequency 1529530837 Hz quality 1000Root mount waiting for: usbus4Root mount waiting for: usbus4Root mount waiting for: usbus4uhub4: 8 ports with 8 removable, self poweredRoot mount waiting for: usbus4Trying to mount root from ufs:/dev/ada0p2 [rw]...ugen0.2: <vendor 0x058f> at usbus0umass0: <vendor 0x058f USB Reader, class 0/0, rev 1.10/1.00, addr 2> on usbus0umass0:  SCSI over Bulk-Only; quirks = 0x4001umass0:2:0:-1: Attached to scbus2da0 at umass-sim0 bus 0 scbus2 target 0 lun 0da0: <Generic USB SD Reader 1.00> Removable Direct Access SCSI-0 device da0: Serial Number 2004888da0: 1.000MB/s transfersda0: Attempt to query device size failed: NOT READY, Medium not presentda0: quirks=0x2<NO_6_BYTE>da1 at umass-sim0 bus 0 scbus2 target 0 lun 1da1: <Generic USB CF Reader 1.01> Removable Direct Access SCSI-0 device da1: Serial Number 2004888da1: 1.000MB/s transfersda1: Attempt to query device size failed: NOT READY, Medium not presentda1: quirks=0x2<NO_6_BYTE>da2 at umass-sim0 bus 0 scbus2 target 0 lun 2da2: <Generic USB SM Reader 1.02> Removable Direct Access SCSI-0 device da2: Serial Number 2004888da2: 1.000MB/s transfersda2: Attempt to query device size failed: NOT READY, Medium not presentda2: quirks=0x2<NO_6_BYTE>da3 at umass-sim0 bus 0 scbus2 target 0 lun 3da3: <Generic USB MS Reader 1.03> Removable Direct Access SCSI-0 device da3: Serial Number 2004888da3: 1.000MB/s transfersda3: Attempt to query device size failed: NOT READY, Medium not presentda3: quirks=0x2<NO_6_BYTE>ugen3.2: <Logitech> at usbus3wlan0: Ethernet address: 00:24:01:ee:97:eaums0: <Logitech USB-PS2 Optical Mouse, class 0/0, rev 2.00/11.10, addr 2> on usbus3ums0: 3 buttons and [XYZ] coordinates ID=0WARNING: attempt to domain_add(bluetooth) after domainfinalize()As far as I can tell from the hieroglyphics on the motherboard, the board is a Gigabyte GA-81915PM. I hope that means more to someone than it does to me!
FreeBSD 10.1 sound not working
drivers;freebsd;audio;intel
Assuming the snd_hda driver was being loaded (it was), the lack of working sound indicates either a driver conflict or a bad default configuration. To bottom this out I added the following line to /boot/loader.conf to turn on verbose messages in dmesg:boot_verbose=YESDoing this makes dmesg output much more useful, with all kinds of additional information (see this link which turns out to be essential reading).Extracting the useful stuff from dmesg gives me something like this:hdac0: <Intel 82801F HDA Controller> mem 0xe6100000-0xe6103fff irq 16 at device 27.0 on pci0hdac0: PCI card vendor: 0x1631, device: 0xe011hdac0: HDA Driver Revision: 20120126_0002hdac0: Config options: on=0x00000000 off=0x00000000hdac0: attempting to allocate 1 MSI vectors (1 supported)hdac0: using IRQ 256 for MSIhdac0: Caps: OSS 4, ISS 4, BSS 0, NSDO 1, 64bit, CORB 256, RIRB 256hdacc0: <Realtek ALC880 HDA CODEC> at cad 2 on hdac0hdaa0: <Realtek ALC880 Audio Function Group> at nid 1 on hdacc0hdaa0: Subsystem ID: 0x08800000hdaa0: NumGPIO=2 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1hdaa0:  GPIO0: disabledhdaa0:  GPIO1: disabledhdaa0: Original pins configuration:hdaa0: nid   0x    as seq device       conn  jack    loc        color   mischdaa0: 20 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 21 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 22 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 23 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 24 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 25 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 26 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 27 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 28 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 29 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 30 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 31 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: Patching widget caps nid=29 0x00400000 -> 0x00700000hdaa0: Patched pins configuration:hdaa0: nid   0x    as seq device       conn  jack    loc        color   mischdaa0: 20 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 21 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 22 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 23 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 24 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 25 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 26 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 27 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 28 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 30 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 31 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: Tracing input monitorhdaa0: Tracing other input monitorshdaa0: Tracing beeperhdaa0: FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivrefAll the pins of the audio device have been assigned default values that render them disabled, so no device was configured.To change the defaults to something sensible, modifications are needed to the boot-time configuration, which is done by adding some lines to /boot/device.hints. There seems to be a lot of flexibility here, but I tried the following, which was enough to get audio output working straight away:hint.hdaa.0.nid20.config=as=1 seq=0 device=Speaker conn=Fixed loc=Onboard color=Unknownhint.hdaa.0.nid21.config=as=2 seq=0 device=Line-out conn=Jack loc=Rear color=Greenhint.hdaa.0.nid27.config=as=2 seq=15 device=Headphones conn=Jack loc=Front color=GreenChecking dmesg now yields:hdac0: <Intel 82801F HDA Controller> mem 0xe6100000-0xe6103fff irq 16 at device 27.0 on pci0hdac0: PCI card vendor: 0x1631, device: 0xe011hdac0: HDA Driver Revision: 20120126_0002hdac0: Config options: on=0x00000000 off=0x00000000hdac0: attempting to allocate 1 MSI vectors (1 supported)hdac0: using IRQ 256 for MSIhdac0: Caps: OSS 4, ISS 4, BSS 0, NSDO 1, 64bit, CORB 256, RIRB 256hdacc0: <Realtek ALC880 HDA CODEC> at cad 2 on hdac0hdaa0: <Realtek ALC880 Audio Function Group> at nid 1 on hdacc0hdaa0: Subsystem ID: 0x08800000hdaa0: NumGPIO=2 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1hdaa0:  GPIO0: disabledhdaa0:  GPIO1: disabledhdaa0: Original pins configuration:hdaa0: nid   0x    as seq device       conn  jack    loc        color   mischdaa0: 20 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 21 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 22 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 23 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 24 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 25 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 26 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 27 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 28 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 29 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 30 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: 31 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0hdaa0: Patching widget caps nid=29 0x00400000 -> 0x00700000hdaa0: Patching pin config nid=20 0x00000000 -> 0x99100010hdaa0: Patching pin config nid=21 0x00000000 -> 0x01004020hdaa0: Patching pin config nid=27 0x00000000 -> 0x0220402fhdaa0: Patched pins configuration:hdaa0: nid   0x    as seq device       conn  jack    loc        color   mischdaa0: 20 99100010 1  0  Speaker       Fixed Unknown Onboard    Unknown 0hdaa0: 21 01004020 2  0  Line-out      Jack  Unknown Rear       Green   0hdaa0: 22 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 23 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 24 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 25 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 26 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 27 0220402f 2  15 Headphones    Jack  Unknown Front      Green   0hdaa0: 28 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 30 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 31 00000000 0  0  Line-out      Jack  Unknown 0x00       Unknown 0 DISAhdaa0: 2 associations found:hdaa0: Association 0 (1) out:hdaa0:  Pin nid=20 seq=0hdaa0: Association 1 (2) out:hdaa0:  Pin nid=21 seq=0hdaa0:  Pin nid=27 seq=15hdaa0: Tracing association 0 (1)hdaa0:  Pin 20 traced to DAC 2hdaa0: Association 0 (1) trace succeededhdaa0: Tracing association 1 (2)hdaa0:  Pin 21 traced to DAC 3hdaa0:  Pin 27 traced to DAC 3 and hpredir 0hdaa0: Association 1 (2) trace succeededhdaa0: Looking for additional DAC for association 0 (1)hdaa0: Looking for additional DAC for association 1 (2)hdaa0: Tracing input monitorhdaa0: Tracing other input monitorshdaa0: Tracing beeperhdaa0:  nid 29 traced to outhdaa0: Pin sense: nid=20 sense=0xffffffff (connected)hdaa0: Headphones redirection for association 1 nid=27 using unsolicited responses.hdaa0: Redirect output to: mainhdaa0: FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivrefpcm0: <Realtek ALC880 (Onboard Analog Speaker)> at nid 20 on hdaa0pcm1: <Realtek ALC880 (Analog 2.0+HP)> at nid 21,27 on hdaa0showing that the re-configured pins have allowed the creation of two audio output devices, pcm0 and pcm1. The contents of /dev/sndstat confirm this:Installed devices:pcm0: <Realtek ALC880 (Onboard Analog Speaker)> (play) defaultpcm1: <Realtek ALC880 (Analog 2.0+HP)> (play)Making the microphone work is left as an exercise for the reader!