No sound on laptop with FreeBSD 10.1

Hi there, I realize there seem to be about a million threads on people not able to get sound working on their rigs already, but after days of trying everything in said threads and following the handbook returning no results, I figure it's probably best to ask for some help on this one in case anyone can spare some.

I have a Toshiba Qosmio X505-Q894 laptop with a Conexant CX20583 sound card.

My /boot/loader.conf looks like:
Code:
sem_load="YES"
linux_load="YES"
nvidia_load="YES"
if_urtw_load="YES"
vboxdrv_load="YES"

sound_load="YES"
snd_hda_load="YES"

usb_load="YES"
udbp_load="YES"
ugen_load="YES"
umass_load="YES"
My /etc/sysctl.conf looks like:
Code:
hw.snd.default_unit=5
hw.snd.default_auto=0
Output from cat /dev/sndstat shows:
Code:
Installed devices:
pcm0: <NVIDIA GTS450 (HDMI/DP 8ch)> (play)
pcm1: <NVIDIA GTS450 (HDMI/DP 8ch)> (play)
pcm2: <NVIDIA GTS450 (HDMI/DP 8ch)> (play)
pcm3: <NVIDIA GTS450 (HDMI/DP 8ch)> (play)
pcm4: <Conexant CX20583 (Pebble HSF) (Right Analog)> (play/rec)
pcm5: <Conexant CX20583 (Pebble HSF) (Analog)> (play/rec) default
pcm6: <Conexant CX20583 (Pebble HSF) (Right Digital)> (play)
Output from mixer shows:
Code:
Mixer vol  is currently set to  86:86
Mixer pcm  is currently set to 100:100
Mixer rec  is currently set to  1:1
Mixer monitor  is currently set to  50:50
Recording source: monitor
When I try cat /dev/random > /dev/dsp I get an error message cat: stdout: Invalid argument. If I create a small file with some random text in it in my current directory called tempfile and execute cat tempfile > /dev/dsp, the command has no error messages but no sound plays. I tried playing an audio cd using cdcontrol play, which appears to be successfully playing the disc, but no sound is happening. I've tried a game with WINE that I know has sound but nothing comes out of the speakers. I've also been testing with Youtube running in Firefox and no videos have sound.

I switched the default unit to 4 and 6 as well but it neither have ever worked. I think 1 through 3 are for the graphics card's HDMI output so I don't test with those as frequently but I have tried them and they do not produce sound. Although in my /boot/loader.conf I'm only loading snd_hda right now, I have tried using kldload snd_driver but it still produces no sound. I have tried each variation with and without headphones plugged in with no success. My laptop has external buttons for turning the volume up, down, and muting, and I have pushed them all in reasonable combinations with each test to no avail. I've set all 4 mixer values to 100 to no avail. I tried creating a custom kernel configuration following the guidelines in OSS and installing OSS to no avail.

If it is something simple like my sound card not being supported that'll be fine by me, I don't mind getting a new one, but I don't think it's that or a driver issue based on the fact that cat /dev/sndstat can report the device information. I don't think it's the external buttons because I had trouble getting those things working when I did a fresh install of Windows 8 a while back and haven't even tried finding FreeBSD drivers for them, so I don't imagine those buttons can do anything at all. If any users more advanced than I could offer assistance or ideas, it would be most appreciated.
 
Code:
sound_load="YES"
snd_hda_load="YES"
You should not need this in FreeBSD 10.1 if you are using the default Kernel.
The driver is now in the kernel rather than being a module.

If your output is the default analog then it looks that your default unit is 5
See the FreeBSD handbook section 8.2.3 here.

If setting your default unit to 5 still does not work then start looking at the gpio pin assignments.
A common problem is the pin assignments and how they are grouped. You can obtain the pin assignments by placing
Code:
dev.hdac.5.pindump=1
in /etc/sysctl.conf and rebooting. The pin assignments will be in the latest dmesg after reboot.
Post the pin assignments here. You can learn more by reading the snd_hda(4) manual page.
 
Code:
sound_load="YES"
snd_hda_load="YES"

You should not need this in FreeBSD 10.1 if you are using the default Kernel.
The driver is now in the kernel rather than being a module.

If your output is the default analog then it looks that your default unit is 5
See the FreeBSD handbook section 8.2.3 here.

If setting your default unit to 5 still does not work then start looking at the gpio pin assignments.
A common problem is the pin assignments and how they are grouped. You can obtain the pin assignments by placing
Code:
dev.hdac.5.pindump=1
in /etc/sysctl.conf and rebooting. The pin assignments will be in the latest dmesg after reboot.
Post the pin assignments here. You can learn more by reading the snd_hda(4) manual page.
Thanks for the assistance.
deleted the two module loading lines from /boot/loader.conf, but then the sound drivers don't appear to load at all, as cat /dev/sndstat says it cannot find /dev/sndstat and ls /dev shows that indeed /dev/sndstat isn't there, nor is /dev/dsp. Performing kldload snd_hda loads them in and puts me where I was before. I think I'm rolling with the default kernel, though I may have added 2 lines for the VESAKERN setup to add the SC_PIXEL_MODE and VESA modules, as detailed here:
http://www.freebsdwiki.net/index.php/High_Resolution_Console

With both the GENERIC and VESAKERN configurations, I left the sound support untouched though. The lines:
Code:
device        sound
device        snd_hda
...are definitely in both as well, along with the usual other drivers. Not sure why the drivers aren't loading without those two lines in /boot/loader.conf.

Here's the output from dmesg after adding that line to /etc/sysctl.conf, I'll cut out some seemingly irrelevant sections (denoted by '...') so it's not too much info presuming that'd be preferred:
Code:
Copyright (c) 1992-2014 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 is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.1-RC3 #0: Sun Jan 18 12:29:55 PST 2015
    root@Orion:/usr/src/sys/amd64/compile/GENERIC amd64
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
CPU: Intel(R) Core(TM) i7 CPU       Q 740  @ 1.73GHz (1729.04-MHz K8-class CPU)
  Origin = "GenuineIntel"  Id = 0x106e5  Family = 0x6  Model = 0x1e  Stepping = 5
  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=0x98e3fd<SSE3,DTES64,MON,DS_CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT>
  AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM>
  AMD Features2=0x1<LAHF>
  VT-x: PAT,HLT,MTF,PAUSE,EPT,VPID
  TSC: P-state invariant, performance statistics
real memory  = 4294967296 (4096 MB)
avail memory = 4076498944 (3887 MB)
Event timer "LAPIC" quality 400
ACPI APIC Table: <PTLTD     APIC  >
FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs
FreeBSD/SMP: 1 package(s) x 4 core(s) x 2 SMT threads
 cpu0 (BSP): APIC ID:  0
...
acpi_ec0: <Embedded Controller: GPE 0x1e> port 0x62,0x66 on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> irq 16 at device 3.0 on pci0
pci1: <ACPI PCI bus> on pcib1
vgapci0: <VGA-compatible display> port 0x2000-0x207f mem 0xc8000000-0xc8ffffff,0xd0000000-0xdfffffff,0xcc000000-0xcdffffff irq 16 at device 0.0 on pci1
nvidia0: <GeForce GTX 460M> on vgapci0
vgapci0: child nvidia0 requested pci_enable_io
vgapci0: child nvidia0 requested pci_enable_io
vgapci0: Boot video device
pci1: <multimedia, HDA> at device 0.1 (no driver attached)
ehci0: <Intel PCH USB 2.0 controller USB-B> mem 0xf0906000-0xf09063ff irq 16 at device 26.0 on pci0
usbus0: EHCI version 1.0
usbus0 on ehci0
pci0: <multimedia, HDA> at device 27.0 (no driver attached)
pcib2: <ACPI PCI-PCI bridge> irq 16 at device 28.0 on pci0
pci2: <ACPI PCI bus> on pcib2
pcib3: <ACPI PCI-PCI bridge> irq 19 at device 28.3 on pci0
pcib3: failed to allocate initial memory window: 0xf0500000-0xf05fffff
pci7: <ACPI PCI bus> on pcib3
pci7: <serial bus, FireWire> at device 0.0 (no driver attached)
sdhci_pci0: <Generic SD HCI> irq 17 at device 0.1 on pci7
sdhci_pci0: 1 slot(s) allocated
pci7: <mass storage> at device 0.2 (no driver attached)
pcib4: <ACPI PCI-PCI bridge> irq 16 at device 28.4 on pci0
pci10: <ACPI PCI bus> on pcib4
pci10: <network> at device 0.0 (no driver attached)
pcib5: <ACPI PCI-PCI bridge> irq 18 at device 28.6 on pci0
pci11: <ACPI PCI bus> on pcib5
alc0: <Atheros AR8131 PCIe Gigabit Ethernet> port 0x5000-0x507f mem 0xf0400000-0xf043ffff irq 18 at device 0.0 on pci11
alc0: 15872 Tx FIFO, 15360 Rx FIFO
alc0: Using 1 MSI message(s).
miibus0: <MII bus> on alc0
atphy0: <Atheros F1 10/100/1000 PHY> PHY 0 on miibus0
atphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow
alc0: Ethernet address: 60:eb:69:50:24:8d
ehci1: <Intel PCH USB 2.0 controller USB-A> mem 0xf0907000-0xf09073ff irq 23 at device 29.0 on pci0
usbus1: EHCI version 1.0
usbus1 on ehci1
pcib6: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci12: <ACPI PCI bus> on pcib6
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
...
uhid0: <Microsoft Microsoft 2.4GHz Transceiver v9.0, class 0/0, rev 2.00/7.67, addr 7> on usbus0
WARNING: attempt to domain_add(bluetooth) after domainfinalize()
WARNING: attempt to domain_add(netgraph) after domainfinalize()
hdac0: <Intel 5 Series/3400 Series HDA Controller> mem 0xf0900000-0xf0903fff irq 22 at device 27.0 on pci0
hdac1: <NVIDIA GT106 HDA Controller> mem 0xcbefc000-0xcbefffff irq 17 at device 0.1 on pci1
hdacc0: <Conexant CX20583 (Pebble HSF) HDA CODEC> at cad 0 on hdac0
hdaa0: <Conexant CX20583 (Pebble HSF) Audio Function Group> at nid 1 on hdacc0
pcm0: <Conexant CX20583 (Pebble HSF) (Right Analog)> at nid 25 and 26 on hdaa0
pcm1: <Conexant CX20583 (Pebble HSF) (Analog)> at nid 31 and 30 on hdaa0
pcm2: <Conexant CX20583 (Pebble HSF) (Right Digital)> at nid 32 on hdaa0
hdacc1: <NVIDIA GTS450 HDA CODEC> at cad 0 on hdac1
hdaa1: <NVIDIA GTS450 Audio Function Group> at nid 1 on hdacc1
pcm3: <NVIDIA GTS450 (HDMI/DP 8ch)> at nid 5 on hdaa1
hdacc2: <NVIDIA GTS450 HDA CODEC> at cad 1 on hdac1
hdaa2: <NVIDIA GTS450 Audio Function Group> at nid 1 on hdacc2
pcm4: <NVIDIA GTS450 (HDMI/DP 8ch)> at nid 5 on hdaa2
hdacc3: <NVIDIA GTS450 HDA CODEC> at cad 2 on hdac1
hdaa3: <NVIDIA GTS450 Audio Function Group> at nid 1 on hdacc3
pcm5: <NVIDIA GTS450 (HDMI/DP 8ch)> at nid 5 on hdaa3
hdacc4: <NVIDIA GTS450 HDA CODEC> at cad 3 on hdac1
hdaa4: <NVIDIA GTS450 Audio Function Group> at nid 1 on hdacc4
pcm6: <NVIDIA GTS450 (HDMI/DP 8ch)> at nid 5 on hdaa4
 
pcm5: <Conexant CX20583 (Pebble HSF) (Analog)> (play/rec) default
pcm1: <Conexant CX20583 (Pebble HSF) (Analog)> at nid 31 and 30 on hdaa0

From what I understand, you need to generate the gpio pin assignments for the <Conexant CX20583 (Pebble HSF) (Analog)> device. I am not sure why it would be assigned pcm5 in the first instance and pcm1 in the second posting. What I would probably try next is to change the default audio unit to match the assignment in the dmesg and also generate a pin dump, ie if the <Conexant CX20583 (Pebble HSF) (Analog)> is consistently assigned pcm1; generate a pin dump for pcm1. Also, just to clarify, is your goal sound from the onboard laptop speakers and from the green headphone jack?
 
Last edited by a moderator:
From what I understand, you need to generate the gpio pin assignments for the <Conexant CX20583 (Pebble HSF) (Analog)> device. I am not sure why it would be assigned pcm5 in the first instance and pcm1 in the second posting. What I would probably try next is to change the default audio unit to match the assignment in the dmesg and also generate a pin dump, ie if the <Conexant CX20583 (Pebble HSF) (Analog)> is consistently assigned pcm1; generate a pin dump for pcm1. Also, just to clarify, is your goal sound from the onboard laptop speakers and from the green headphone jack?
It assigns pcm5 when the sound driver modules are loaded in my /boot/loader.conf and pcm1 if I load in the snd_hda module manually with kldload. That log was with the latter method, sorry didn't realize that was going on. Just added the lines back to /boot/loader.conf, and the new dmesg shows:
Code:
hdacc0: <NVIDIA GTS450 HDA CODEC> at cad 0 on hdac0
hdaa0: <NVIDIA GTS450 Audio Function Group> at nid 1 on hdacc0
pcm0: <NVIDIA GTS450 (HDMI/DP 8ch)> at nid 5 on hdaa0
hdacc1: <NVIDIA GTS450 HDA CODEC> at cad 1 on hdac0
hdaa1: <NVIDIA GTS450 Audio Function Group> at nid 1 on hdacc1
pcm1: <NVIDIA GTS450 (HDMI/DP 8ch)> at nid 5 on hdaa1
hdacc2: <NVIDIA GTS450 HDA CODEC> at cad 2 on hdac0
hdaa2: <NVIDIA GTS450 Audio Function Group> at nid 1 on hdacc2
pcm2: <NVIDIA GTS450 (HDMI/DP 8ch)> at nid 5 on hdaa2
hdacc3: <NVIDIA GTS450 HDA CODEC> at cad 3 on hdac0
hdaa3: <NVIDIA GTS450 Audio Function Group> at nid 1 on hdacc3
pcm3: <NVIDIA GTS450 (HDMI/DP 8ch)> at nid 5 on hdaa3
hdacc4: <Conexant CX20583 (Pebble HSF) HDA CODEC> at cad 0 on hdac1
hdaa4: <Conexant CX20583 (Pebble HSF) Audio Function Group> at nid 1 on hdacc4
pcm4: <Conexant CX20583 (Pebble HSF) (Right Analog)> at nid 25 and 26 on hdaa4
pcm5: <Conexant CX20583 (Pebble HSF) (Analog)> at nid 31 and 30 on hdaa4
pcm6: <Conexant CX20583 (Pebble HSF) (Right Digital)> at nid 32 on hdaa4
pcm5 is indeed still the default, just double-checked, no sound. And yes sir, my goal is for sound to come from both the onboard laptop speakers and the green headphone jack. May I ask how I might go about generating the gpio pin assignments for the device?
 
May I ask how I might go about generating the gpio pin assignments for the device?

The process is described in the man page for snd_hda(4). It took me several readings of the man page and some Googling to figure it out.
This link describes it fairly well and from what I understand you can also use sysctl and then dmesg > mypindump.txt.

The key is to pindump the pcm device that is assigned to <Conexant CX20583 (Pebble HSF) (Analog)>.
 
The process is described in the man page for snd_hda(4). It took me several readings of the man page and some Googling to figure it out.
This link describes it fairly well and from what I understand you can also use sysctl and then dmesg > mypindump.txt.

The key is to pindump the pcm device that is assigned to <Conexant CX20583 (Pebble HSF) (Analog)>.
Went through the man page and tried some similar things to the examples unsuccessfully. The only reference to pindumping would be:
Code:
dev.hdac.%d.pindump Setting this to a non-zero value dumps
the current pin configuration, main
capabilities and jack sense status of
all audio functions on the controller
to console and syslog.
The device that it belongs to is hdaa4 though, and sysctl dev.hdaa.4.pindump says 'no such file or directory', understandable since the man page only specifies hdac pindumps. So I tried setting both hdac 0 and 1, the only replacements for %d that don't return 'no such file or directory', to nonzero values. This resulted in the output dev.hdac.0.pindump: 0 -> 0 and dev.hdac.1.pindump: 0 -> 0, respectively. Attempting sysctl dev.hdac.0.pindump and sysctl dev.hdac.1.pindump just outputs '0'. So, I'm not sure how to pindump, and that's the only reference to it on the manpage, and Google shows me a whole lotta Pinterest junk when I search for things close to 'pindump'. That being said, there is some relevant info I think I was able to glean from sysctl -a:
Code:
dev.pcm.5.%desc: Conexant CX20583 (Pebble HSF) (Analog)
dev.pcm.5.%driver: pcm
dev.pcm.5.%location: nid=31,30
dev.pcm.5.%pnpinfo:
dev.pcm.5.%parent: hdaa4
dev.pcm.5.play.vchans: 1
dev.pcm.5.play.vchanmode: fixed
dev.pcm.5.play.vchanrate: 48000
dev.pcm.5.play.vchanformat: s16le:2.0
dev.pcm.5.play.32bit: 24
dev.pcm.5.rec.vchans: 1
dev.pcm.5.rec.vchanmode: fixed
dev.pcm.5.rec.vchanrate: 48000
dev.pcm.5.rec.vchanformat: s16le:2.0
dev.pcm.5.rec.32bit: 24
dev.pcm.5.rec.autosrc: 2
dev.pcm.5.buffersize: 65536
dev.pcm.5.bitperfect: 0

Code:
dev.hdaa.4.nid30: pin: Mic (Fixed)
     Widget cap: 0x00400481 PWR UNSOL STEREO
    Association: 2 (0x0001)
            OSS: monitor (monitor)
        Pin cap: 0x00000024 PDC IN
     Pin config: 0x95a701f0 as=15 seq=0 device=Mic conn=Fixed ctype=Analog loc=0x15 color=Unknown misc=1
    Pin control: 0x00000020 IN

dev.hdaa.4.nid30_config: 0x95a701f0 as=15 seq=0 device=Mic conn=Fixed ctype=Analog loc=0x15 color=Unknown misc=1
dev.hdaa.4.nid30_original: 0x95a701f0 as=15 seq=0 device=Mic conn=Fixed ctype=Analog loc=0x15 color=Unknown misc=1
dev.hdaa.4.nid31: pin: Speaker (Fixed)
     Widget cap: 0x00400501 PWR STEREO
    Association: 3 (0x0001)
        Pin cap: 0x00000010 OUT
     Pin config: 0x921701f0 as=15 seq=0 device=Speaker conn=Fixed ctype=Analog loc=0x12 color=Unknown misc=1
    Pin control: 0x00000040 OUT
    Connections: 2
          + [DISABLED] <- nid=16 [audio output]
          + <- nid=17 [audio output] (selected)

dev.hdaa.4.nid31_config: 0x921701f0 as=15 seq=0 device=Speaker conn=Fixed ctype=Analog loc=0x12 color=Unknown misc=1
dev.hdaa.4.nid31_original: 0x921701f0 as=15 seq=0 device=Speaker conn=Fixed ctype=Analog loc=0x12 color=Unknown misc=1
dev.hdaa.4.nid32: pin: SPDIF-out (Black Jack)
     Widget cap: 0x00400781 PWR DIGITAL UNSOL STEREO
    Association: 4 (0x0001)
        Pin cap: 0x00000010 OUT
     Pin config: 0x044511f0 as=15 seq=0 device=SPDIF-out conn=Jack ctype=Optical loc=Right color=Black misc=1
    Pin control: 0x00000040 OUT
    Connections: 1
          + <- nid=18 [audio output]

I'm not sure how to configure the GPIO with this information though. As far as I understand from the manpage, they manage to pull up a table of associations that exist, and just reassociate the nodes to different ones to achieve different configurations, but they don't state how to get either that list of associations or the default pin configurations, it just says "The driver reports such default pin configuration when verbose messages enabled:" then shows an example output without explaining how to produce this output, or enable verbose messages in the driver. Any ideas how to pindump this bad boy?
 
Although it may not seem like it, progress has occurred.

First off, sysctl needs to assign a non-zero value to pindump to generate a pindump.
dev.hdac.0.pindump: 0 -> 0
means the pindump value for hdac.0 is still zero.
# sysctl dev.hdac.0.pindump=1 should generate this output
Code:
 dev.hdac.0.pindump: 0 -> 1
.
The pindump section in the manual page
dev.hdac.%d.pindump Setting this to a non-zero value dumps
the current pin configuration, main
capabilities and jack sense status of
all audio functions on the controller
to console and syslog.
"%d" should be your device number.
You can redirect your next dmesg into a text file for editing/posting here
$ dmesg > pindump.txt

Just out of curiosity, if you remove the
Code:
sound_load="YES"
snd_hda_load="YES"
from boot/loader.conf does the dmesg still find the Conexant sound card?

The next thing is that node id's 30 and 31 are likely your mic and speakers respectively.

dev.hdaa.4.nid31_config: 0x921701f0 as=15 seq=0 device=Speaker conn=Fixed ctype=Analog loc=0x12 color=Unknown misc=1
It looks like nid32 (spdif black jack) is your sound output while nid31 is disabled
dev.hdaa.4.nid31: pin: Speaker (Fixed)
Widget cap: 0x00400501 PWR STEREO
Association: 3 (0x0001)
Pin cap: 0x00000010 OUT
Pin config: 0x921701f0 as=15 seq=0 device=Speaker conn=Fixed ctype=Analog loc=0x12 color=Unknown misc=1
Pin control: 0x00000040 OUT
Connections: 2
+ [DISABLED] <- nid=16 [audio output]
+ <- nid=17 [audio output] (selected)

as=15 means the pin is unassociated and ideally it should be associated with the headphone jack so that plugging in the jack will automatically mute the speakers
as Association number. Associations are used to group indi-
vidual pins to form a complex multi-pin device. For exam-
ple, to group 4 connectors for 7.1 input/output, or to
treat several input connectors as sources for the same
input device. Association numbers can be specified as
numeric values from 0 to 15. A value of 0 means disabled
pin. A value of 15 is a set of independent unassociated
pins. Each association includes only pins of the same
direction (in/out) and is detected atomically (all pins or
none). A separate PCM audio device is created for every
pair of input and output associations.

seq Sequence number. A unique, per-association number used to
order pins inside the particular association. Sequence
numbers can be specified as numeric values from 0 to 15.

The sequence number 15 has a special meaning for output
associations. Output pins with this number and device
type ``Headphones'' will duplicate (with automatic mute if
jack detection is supported) the first pin in that associ-
ation.

The sequence numbers 14 and 15 has a special meaning for
input associations. Their presence in association defines
it as multiplexed or mixed respectively. If none of them
are present and there are more than one pin in associa-
tion, the association will provide multichannel input.

For multichannel input/output associations sequence num-
bers encode channel pairs positions: 0 - Front, 1 - Cen-
ter/LFE, 2 - Back, 3 - Front Wide Center, 4 - Side. Stan-
dard combinations are: (0) - Stereo; (0, 2), (0, 4) -
Quadro; (0, 1, 2), (0, 1, 4) - 5.1; (0, 1, 2, 4) - 7.1.
[/QUOTE}

After generating a pindump, look at the examples on the man page for snd_hda
that I linked in my prior post or run $ man snd_hda.
 
I'm not sure how to configure the GPIO with this information though. As far as I understand from the manpage, they manage to pull up a table of associations that exist, and just reassociate the nodes to different ones to achieve different configurations, but they don't state how to get either that list of associations or the default pin configurations, it just says "The driver reports such default pin configuration when verbose messages enabled:" then shows an example output without explaining how to produce this output, or enable verbose messages in the driver. Any ideas how to pindump this bad boy?
"Verbose messages enabled" means doing a verbose boot. Here are instructions with screenshots of the boot screen, and I highly recommend doing a verbose boot instead of wrestling with pindump sysctrls:

https://www.freebsd.org/doc/handbook/bsdinstall-start.html#bsdinstall-view-probe

Then save the messages:

dmesg > verbose_boot.txt
 
"Verbose messages enabled" means doing a verbose boot. Here are instructions with screenshots of the boot screen, and I highly recommend doing a verbose boot instead of wrestling with pindump sysctrls:

I have to address this. There are a number of ways to generate detailed information on hardware. The snd_hda(4) manual page describes doing a pindump to diagnose and correct problems with sound. Additionally the man page gives 4 examples of using the pindump output to diagnose and correct errors. The OP did not appear to be familiar with using sysctl(8) as his posted syntax was incorrect. Changing pin assignments in /boot/device.hints uses the same syntax. Generating a pindump is consistent with the manual documentation and gives the OP familiarity with the syntax he will need to correct the problem.

I am also not sure how the kernel will allocate pins/device names when the device is both in the kernel and loaded as a module. Device numbers changed depending on how the OP loaded the module.

Ideally, it would be best to simplify pin/device allocation as it would provide a stable device number. Again, it would be good to view a dmesg without the /boot/loader.conf entries.

If the Conexant hardware ID is not being detected it is a simple fix and would be of interest to the FreeBSD developers.
 
Sorry for the late response, got really busy recently. I would like to clarify, sysctl dev.hdac.0.pindump=1 generates this output:
Code:
dev.hdac.0.pindump: 0 -> 0
Not this output:
Code:
dev.hdac.0.pindump: 0 -> 1
...though indeed the documentation does indicate that it should be outputting the latter. An interesting circumstance did occur though. I use Terminator with Enlightenment Window Manager, generally, but I did try sysctl dev.hdac.0.pindump=1 in the standard FreeBSD terminal emulator and got a different output, as seen in this picture:
http://1drv.ms/16tuSQw

Grabbing dmesg with verbose boot enabled seemed to produce more helpful data too:
Code:
hdacc4: <Conexant CX20583 (Pebble HSF) HDA CODEC> at cad 0 on hdac1
hdaa4: <Conexant CX20583 (Pebble HSF) Audio Function Group> at nid 1 on hdacc4
hdaa4: Subsystem ID: 0x1179ffd5
hdaa4: NumGPIO=4 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
hdaa4:  GPIO0: disabled
hdaa4:  GPIO1: disabled
hdaa4:  GPIO2: disabled
hdaa4:  GPIO3: disabled
hdaa4: Original pins configuration:
hdaa4: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa4: 25 042140f0 15 0  Headphones    Jack  1/8     Right      Green   0
hdaa4: 26 04a190f0 15 0  Mic           Jack  1/8     Right      Pink    0
hdaa4: 27 400001f0 15 0  Line-out      None  Unknown 0x00       Unknown 1
hdaa4: 28 400001f0 15 0  Line-out      None  Unknown 0x00       Unknown 1
hdaa4: 29 400001f0 15 0  Line-out      None  Unknown 0x00       Unknown 1
hdaa4: 30 95a701f0 15 0  Mic           Fixed Analog  0x15       Unknown 1
hdaa4: 31 921701f0 15 0  Speaker       Fixed Analog  0x12       Unknown 1
hdaa4: 32 044511f0 15 0  SPDIF-out     Jack  Optical Right      Black   1
hdaa4: 34 400001f0 15 0  Line-out      None  Unknown 0x00       Unknown 1
hdaa4: 35 400001f0 15 0  Line-out      None  Unknown 0x00       Unknown 1
hdaa4: Patching pin config nid=30 0x95a701f0 -> 0x9527011f
hdaa4: Patching pin config nid=31 0x921701f0 -> 0x92170110
hdaa4: Patching pin config nid=32 0x044511f0 -> 0x0445111f
hdaa4: Patched pins configuration:
hdaa4: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa4: 25 042140f0 15 0  Headphones    Jack  1/8     Right      Green   0
hdaa4: 26 04a190f0 15 0  Mic           Jack  1/8     Right      Pink    0
hdaa4: 27 400001f0 15 0  Line-out      None  Unknown 0x00       Unknown 1 DISA
hdaa4: 28 400001f0 15 0  Line-out      None  Unknown 0x00       Unknown 1 DISA
hdaa4: 29 400001f0 15 0  Line-out      None  Unknown 0x00       Unknown 1 DISA
hdaa4: 30 9527011f 1  15 Headphones    Fixed Analog  0x15       Unknown 1
hdaa4: 31 92170110 1  0  Speaker       Fixed Analog  0x12       Unknown 1
hdaa4: 32 0445111f 1  15 SPDIF-out     Jack  Optical Right      Black   1
hdaa4: 34 400001f0 15 0  Line-out      None  Unknown 0x00       Unknown 1 DISA
hdaa4: 35 400001f0 15 0  Line-out      None  Unknown 0x00       Unknown 1 DISA
hdaa4: hdaa_audio_as_parse: Duplicate pin 15 (32) in association 1! Disabling association.
hdaa4: 3 associations found:
hdaa4: Association 0 (1) out (disabled):
hdaa4:  Pin nid=31 seq=0
hdaa4:  Pin nid=32 seq=15
hdaa4: Association 1 (15) out:
hdaa4:  Pin nid=25 seq=0
hdaa4: Association 2 (15) in:
hdaa4:  Pin nid=26 seq=0
hdaa4: Tracing association 1 (15)
hdaa4:  Pin 25 traced to DAC 16
hdaa4: Association 1 (15) trace succeeded
hdaa4: Tracing association 2 (15)
hdaa4:  Pin 26 traced to ADC 20
hdaa4: Association 2 (15) trace succeeded
hdaa4: Looking for additional DAC for association 1 (15)
hdaa4: Looking for additional ADC for association 2 (15)
hdaa4: Tracing input monitor
hdaa4: Tracing other input monitors
hdaa4:  Tracing nid 26 to out
hdaa4: Tracing beeper
hdaa4: FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivref
pcm4: <Conexant CX20583 (Pebble HSF) (Right Analog)> at nid 25 and 26 on hdaa4
pcm4: Playback:
pcm4:      Stream cap: 0x00000001 PCM
pcm4:         PCM cap: 0x000e0560 16 20 24 bits, 44 48 96 192 KHz
pcm4:             DAC: 16
pcm4:
pcm4:     nid=25 [pin: Headphones (Green Jack)]
pcm4:       + <- nid=16 [audio output] [src: pcm]
pcm4:
pcm4: Record:
pcm4:      Stream cap: 0x00000001 PCM
pcm4:         PCM cap: 0x000e0160 16 20 24 bits, 44 48 96 KHz
pcm4:             ADC: 20
pcm4:
pcm4:     nid=20 [audio input]
pcm4:       + <- nid=23 [audio selector] [src: mic]
pcm4:              + <- nid=26 [pin: Mic (Pink Jack)] [src: mic]
pcm4:
pcm4: Master Volume (OSS: vol): -74/0dB
pcm4:    +- ctl  1 (nid  16 out):    -74/0dB (75 steps) + mute
pcm4:
pcm4: PCM Volume (OSS: pcm): -74/0dB
pcm4:    +- ctl  1 (nid  16 out):    -74/0dB (75 steps) + mute
pcm4:
pcm4: Microphone Volume (OSS: mic): 0/40dB
pcm4:    +- ctl  4 (nid  20 in   0): -74/6dB (81 steps) + mute
pcm4:    +- ctl  7 (nid  23 out):    0/40dB (5 steps)
pcm4:
pcm4: Speaker/Beep Volume (OSS: speaker): -28/0dB
pcm4:    +- ctl  3 (nid  19 out):    -28/0dB (8 steps)
pcm4:
pcm4: Recording Level (OSS: rec): -74/6dB
pcm4:    +- ctl  4 (nid  20 in   0): -74/6dB (81 steps) + mute
pcm4:    +- ctl  7 (nid  23 out):    0/40dB (5 steps)
pcm4:
pcm4: Mixer "vol":
pcm4: Mixer "pcm":
pcm4: Mixer "speaker":
pcm4: Mixer "mic":
pcm4: Mixer "rec":
pcm4: Playback channel set is: Front Left, Front Right,
pcm4: Playback channel matrix is: 2.0 (disconnected)
pcm4: Recording channel set is: Front Left, Front Right,
pcm4: Recording channel matrix is: 2.0 (disconnected)

In particular the associations are printed out in there. I tried a couple different combinations in my /boot/device.hints file, and the one I've had the most success with so far is:
Code:
hint.hdac.1.cad0.nid31.config="as=15 seq=0 device=Speaker"
hint.hdac.1.cad0.nid32.config="as=15 seq=15 device=Headphones"

When I say 'most success', I'm referring to a beeping sound my computer can make. See, my laptop has physical volume up and volume down buttons that are touch-sensitive. With these lines in the file, touching these buttons will result in beeping sounds playing out of the onboard speakers when nothing is plugged into the headphone jack, and it will also play out of both the onboard speakers and a set of external speakers I have when I plug them into the headphone jack. Of course, I wouldn't want sound to play out of both at the same time when the headphone jack is plugged in, but at least they're both working. Unfortunately, even though the beeping sound happens with this configuration (and not with most others), no other sounds will play, for example playing a CD doesn't produce any sound regardless of if something is plugged into the headphone jack, as well as watching Youtube videos and playing games. Not sure which combination is correct or if I have to mess around with associations at this point to get it working, but I'm glad the verbose boot was at least able to make the beeping sounds happen.
 
pcm4: Speaker/Beep Volume (OSS: speaker): -28/0dB pcm4: +- ctl 3 (nid 19 out): -28/0dB (8 steps)

My guess is that nid31 "speaker" is outputing system beeps. You should be able to confirm by a incorrect terminal entry like holding the bksp key with the cursor already at the prompt.

Assigning pins the value
Code:
as=15
results in independent, unassociated pins and my understanding is that you want your working pins to be associated. This would allow plugging in a jack to disable the speakers. In the original pins configuration all associated are "as=15". You will also need your inputs to have the same numerical associations as the outputs.

The driver attempted to correct the grouping with
hdaa4: 30 9527011f 1 15 Headphones Fixed Analog 0x15 Unknown 1
hdaa4: 31 92170110 1 0 Speaker Fixed Analog 0x12 Unknown 1
hdaa4: 32 0445111f 1 15 SPDIF-out Jack Optical Right Black 1

Your original pin configuration sets up nid32 as the SPDIF-out (black jack) and the green headphone jack nid25. I think you want your headphones to be on the green jack and in the same group (as=1) as your speakers.

As an aside your E17 terminal may not be configured for root login.
 
I think shepper has the right idea. Remove the hint line for nid32 and try the following instead:

Code:
hint.hdac.1.cad0.nid31.config="as=1 seq=0 device=Speaker"
hint.hdac.1.cad0.nid25.config="as=1 seq=15 device=Headphones"
Also, something is strange about nid30. In the original pins configuration it is a Mic device, but in the patched configuration it got turned into Headphones and lumped into association 1 along with nid31. If after trying the above hints nid30 is still part of as=1, you may need to make a hint for nid30 to move it to another association (probably as=15).
 
Tried that, and it resulted in the volume-button-beeps not coming out of the onboard speakers when pressed, but coming out of my external speakers when they are plugged into the headphone jack. Manually set nid30 to association 15 also, same output though. I just tried manually settings nids 25, 30, 31, and 32 to what I think they should be, so now /boot/device.hints has these in it:
Code:
hint.hdac.1.cad0.nid25.config="as=1 seq=15 device=Headphones"
hint.hdac.1.cad0.nid30.config="as=15 seq=15 device=Mic"
hint.hdac.1.cad0.nid31.config="as=1 seq=0 device=Speaker"
hint.hdac.1.cad0.nid32.config="as=15 seq=0 device=Jack"
Hopefully this is just wrong, because it still results in the volume-button-beeps not coming out of the onboard speakers, coming out of the externals, and no other sounds ever happening. With ever configuration as I manually added each of those lines and rebooted, I'd also try changed the default unit using sysctl hw.snd.default_unit=<number> to every option and none would solve it.

dmesg shows this output at this current configuration if it's of interest:
Code:
...
pcm4: <Conexant CX20583 (Pebble HSF) (Analog 2.0+HP/2.0)> at nid 31,25 and 26 on hdaa4
pcm4: Playback:
pcm4:  Stream cap: 0x00000001 PCM
pcm4:  PCM cap: 0x000e0560 16 20 24 bits, 44 48 96 192 KHz
pcm4:  DAC: 16
pcm4:
pcm4:  nid=31 [pin: Speaker (Fixed)]
pcm4:  + <- nid=16 [audio output] [src: pcm]
pcm4:
pcm4:  nid=25 [pin: Headphones (Green Jack)]
pcm4:  + <- nid=16 [audio output] [src: pcm]
pcm4:
pcm4: Record:
pcm4:  Stream cap: 0x00000001 PCM
pcm4:  PCM cap: 0x000e0160 16 20 24 bits, 44 48 96 KHz
pcm4:  ADC: 20
pcm4:
pcm4:  nid=20 [audio input]
pcm4:  + <- nid=23 [audio selector] [src: mic]
pcm4:  + <- nid=26 [pin: Mic (Pink Jack)] [src: mic]
pcm4:
pcm4: Master Volume (OSS: vol): -74/0dB
pcm4:  +- ctl  1 (nid  16 out):  -74/0dB (75 steps) + mute
pcm4:
pcm4: PCM Volume (OSS: pcm): -74/0dB
pcm4:  +- ctl  1 (nid  16 out):  -74/0dB (75 steps) + mute
pcm4:
pcm4: Microphone Volume (OSS: mic): 0/40dB
pcm4:  +- ctl  4 (nid  20 in  0): -74/6dB (81 steps) + mute
pcm4:  +- ctl  7 (nid  23 out):  0/40dB (5 steps)
pcm4:
pcm4: Speaker/Beep Volume (OSS: speaker): -28/0dB
pcm4:  +- ctl  3 (nid  19 out):  -28/0dB (8 steps)
pcm4:
pcm4: Recording Level (OSS: rec): -74/6dB
pcm4:  +- ctl  4 (nid  20 in  0): -74/6dB (81 steps) + mute
pcm4:  +- ctl  7 (nid  23 out):  0/40dB (5 steps)
pcm4:
pcm4: Mixer "vol":
pcm4: Mixer "pcm":
pcm4: Mixer "speaker":
pcm4: Mixer "mic":
pcm4: Mixer "rec":
pcm4: Playback channel set is: Front Left, Front Right,
pcm4: Playback channel matrix is: 2.0 (connected)
pcm4: Recording channel set is: Front Left, Front Right,
pcm4: Recording channel matrix is: 2.0 (disconnected)
pcm5: <Conexant CX20583 (Pebble HSF) (Analog Mic)> at nid 30 on hdaa4
pcm5: Record:
pcm5:  Stream cap: 0x00000001 PCM
pcm5:  PCM cap: 0x000e0160 16 20 24 bits, 44 48 96 KHz
pcm5:  ADC: 22
pcm5:
pcm5:  nid=22 [audio input]
pcm5:  + <- nid=24 [audio selector] [src: monitor]
pcm5:  + <- nid=30 [pin: Mic (Fixed)] [src: monitor]
pcm5:
pcm5: Microphone2 Volume (OSS: monitor): 0/40dB
pcm5:  +- ctl  8 (nid  24 out):  0/40dB (5 steps)
pcm5:
pcm5: Recording Level (OSS: rec): 0/40dB
pcm5:  +- ctl  8 (nid  24 out):  0/40dB (5 steps)
pcm5:
pcm5: Mixer "rec":
pcm5: Mixer "monitor":
pcm5: Automatically set rec source to: monitor
pcm5: Recording channel set is: Front Left, Front Right,
pcm5: Recording channel matrix is: 2.0 (unknown)
pcm6: <Conexant CX20583 (Pebble HSF) (Right Digital)> at nid 32 on hdaa4
pcm6: Playback:
pcm6:  Stream cap: 0x00000005 AC3 PCM
pcm6:  PCM cap: 0x000e0160 16 20 24 bits, 44 48 96 KHz
pcm6:  DAC: 18
pcm6:
pcm6:  nid=32 [pin: Line-out (Black Jack)]
pcm6:  + <- nid=18 [audio output] [src: pcm]
pcm6:
pcm6: Mixer "vol" -> "none": child=0x00000010
pcm6: Mixer "pcm": parent="vol"
pcm6: Soft PCM mixer ENABLED
pcm6: Playback channel set is: Front Left, Front Right,
pcm6: Playback channel matrix is: 2.0 (unknown)
 
Tried that, and it resulted in the volume-button-beeps not coming out of the onboard speakers when pressed, but coming out of my external speakers when they are plugged into the headphone jack.
This is good. If the jack senses a plug it should mute the onboard speakers. One definite problem is you are defining nid30 as a mic. Your mic is an input and should be nid26 (pink jack).


From the snd_hda man page Association 2 has been defined as "in". Associations 0 and 1 are "out" and in the example represent front and rear connectors.
Using association (as) and sequence (seq) fields values pins are grouped
into 3 associations:

hdaa0: Association 0 (1) out:
hdaa0: Pin nid=21 seq=0
hdaa0: Pin nid=27 seq=15
hdaa0: Association 1 (2) out:
hdaa0: Pin nid=20 seq=0
hdaa0: Association 2 (3) in:
hdaa0: Pin nid=24 seq=0
hdaa0: Pin nid=26 seq=1
hdaa0: Pin nid=25 seq=15

I do not see that the sources of your sound input to the chip are defined. In the example above, 24 and 25 are mic inputs and 26 is line-in.

For your particular setup I wonder if nid's 20, 23 and 26 should be associated as an input group?
pcm4: nid=20 [audio input]
pcm4: + <- nid=23[audio selector] [src: mic]
pcm4: + <- nid=26 [pin: Mic (Pink Jack)] [src: mic]
 
After some thought
The output portion
Code:
hint.hdac.1.cad0.nid25.config="as=1 seq=15 device=Headphones"
hint.hdac.1.cad0.nid31.config="as=1 seq=0 device=Speaker"
targets pcm1 and pcm4 is your target

From Thread 30502, this /boot/device.hints worked for a Conexant Codec in a laptop with similar nids.
Code:
hint.hdaa.4.nid31.config="as=1 seq=0 device=Speaker"
hint.hdaa.4.nid25.config="as=1 seq=15 device=Headphones"
I would also try using the hdac syntax as described in the snd_hda(4) examples (Edit this should not matter-see below)
Code:
hint.hdac.4.nid31.config="as=1 seq=0 device=Speaker"
hint.hdac.4.nid25.config="as=1 seq=15 device=Headphones"

Edit: hdac vs hdaa should not matter per the man page
hint.hdac.%d.cad%d.nid%d.config
Same as hint.hdaa.%d.nid%d.config
 
Last edited:
Back
Top