# No Audio on my system



## bcomputerguy (Aug 31, 2016)

I just setup freebsdFreeBSD on a macbook pro. I've got everything working mostly correct except now there is no audio at all. I installed firefox, chrome, vlc, xorg, nvidia drivers and a few other things. Here's a list of the installed programs.

sorry for all the text attachment but my mouse/ copy pasting isn't working very well in xterm at the moment.


----------



## bcomputerguy (Aug 31, 2016)

I needed more space to upload additional files. I also attached my pciconf -lv

Any help on getting sound hopefully while avoiding pulseaudio.


----------



## shepper (Aug 31, 2016)

As of FreeBSD 10, and above, snd_hda is statically compiled in the kernel.  The snd_hda entry in your /boot/loader.conf unnecessarily loads it a second time.  The handbook needs to be updated to reflect this fact.

I did a quick web search (FreeBSD MacBook Pro) and also searched this forum (MacBook Pro), there were both web and forum hits.  I'd link them except the hardware depended on the model of MacBook Pro.  If none of the search hits are helpful, it would help to post the model of your MacBook Pro .

Another aspect is that your sndstat shows 2 sound devices

```
Installed devices:
pcm0: <NVIDIA (0x0042) (HDMI/DP 8ch)> (play) default
pcm1: <NVIDIA (0x0042) (HDMI/DP 8ch)> (play)
pcm2: <NVIDIA (0x0042) (HDMI/DP 8ch)> (play)
pcm3: <Cirrus Logic (0x4208) (Analog 4.0/2.0)> (play/rec)
pcm4: <Cirrus Logic (0x4208) (Analog Headphones)> (play)
pcm5: <Cirrus Logic (0x4208) (Digital)> (play)
```

Unless you specify otherwise, the default device is pcm0.  Most laptops would wire the speakers to the Cirrus Logic sound chip.  The Handbook, section 7.2.3 tells how to change the default sound device.


----------



## bcomputerguy (Aug 31, 2016)

I removed the snd_had from my /boot/loader.conf but there is still two sets of audio devices being shown. If I remember correctly from debian I rarely used the HDMI ones, unless the mac was connected to a t.v.

There's the hdmi ports that control the internal sound chip and then the headphones but I am not sure how they are connected.

here's two more updated documents.

The macbook details are, not working atm... seems like dmidecode is just returning empty strings but I know it's worked before on linux. I will update this thread once I get that information.


----------



## shepper (Aug 31, 2016)

> I removed the snd_had from my /boot/loader.conf but there is still two sets of audio devices being shown. If I remember correctly from debian I rarely used the HDMI ones, unless the mac was connected to a t.v.



If you plug the MacBook into a TV, the default sound setting may work.

If instead you want to use built in speakers try the steps below.

Using the handbook section I linked above I would run the following command as root
`# sysctl hw.snd.default_unit=3`

If sound then works, you can assign pcm3 as the default sound device with the following entry in
/etc/sysctl.conf

```
hw.snd.default_unit=3
```


----------



## bcomputerguy (Aug 31, 2016)

Here is the output from dmidecode on the same machine


```
# dmidecode 2.12
# SMBIOS entry point at 0x7ad15000
SMBIOS 2.4 present.
45 structures occupying 2597 bytes.
Table at 0x7AD14000.

Handle 0x0000, DMI type 4, 35 bytes
Processor Information
   Socket Designation: U3E1
   Type: Central Processor
   Family: Core i7
   Manufacturer: Intel(R) Corporation
   ID: 61 06 04 00 FF FB EB BF
   Signature: Type 0, Family 6, Model 70, Stepping 1
   Flags:
     FPU (Floating-point unit on-chip)
     VME (Virtual mode extension)
     DE (Debugging extension)
     PSE (Page size extension)
     TSC (Time stamp counter)
     MSR (Model specific registers)
     PAE (Physical address extension)
     MCE (Machine check exception)
     CX8 (CMPXCHG8 instruction supported)
     APIC (On-chip APIC hardware supported)
     SEP (Fast system call)
     MTRR (Memory type range registers)
     PGE (Page global enable)
     MCA (Machine check architecture)
     CMOV (Conditional move instruction supported)
     PAT (Page attribute table)
     PSE-36 (36-bit page size extension)
     CLFSH (CLFLUSH instruction supported)
     DS (Debug store)
     ACPI (ACPI supported)
     MMX (MMX technology supported)
     FXSR (FXSAVE and FXSTOR instructions supported)
     SSE (Streaming SIMD extensions)
     SSE2 (Streaming SIMD extensions 2)
     SS (Self-snoop)
     HTT (Multi-threading)
     TM (Thermal monitor supported)
     PBE (Pending break enabled)
   Version: Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
   Voltage: 1.0 V
   External Clock: 25 MHz
   Max Speed: 2300 MHz
   Current Speed: 2300 MHz
   Status: Populated, Enabled
   Upgrade: <OUT OF SPEC>
   L1 Cache Handle: 0x0002
   L2 Cache Handle: 0x0003
   L3 Cache Handle: 0x0004
   Serial Number: To Be Filled By O.E.M.
   Asset Tag: To Be Filled By O.E.M.
   Part Number: Not Specified

Handle 0x0001, DMI type 7, 19 bytes
Cache Information
   Socket Designation: Not Specified
   Configuration: Enabled, Not Socketed, Level 1
   Operational Mode: Write Back
   Location: Internal
   Installed Size: 128 kB
   Maximum Size: 128 kB
   Supported SRAM Types:
     Asynchronous
   Installed SRAM Type: Asynchronous
   Speed: Unknown
   Error Correction Type: Single-bit ECC
   System Type: Data
   Associativity: 8-way Set-associative

Handle 0x0002, DMI type 7, 19 bytes
Cache Information
   Socket Designation: Not Specified
   Configuration: Enabled, Not Socketed, Level 1
   Operational Mode: Write Back
   Location: Internal
   Installed Size: 128 kB
   Maximum Size: 128 kB
   Supported SRAM Types:
     Asynchronous
   Installed SRAM Type: Asynchronous
   Speed: Unknown
   Error Correction Type: Single-bit ECC
   System Type: Instruction
   Associativity: 8-way Set-associative

Handle 0x0003, DMI type 7, 19 bytes
Cache Information
   Socket Designation: Not Specified
   Configuration: Enabled, Not Socketed, Level 2
   Operational Mode: Write Back
   Location: Internal
   Installed Size: 1024 kB
   Maximum Size: 1024 kB
   Supported SRAM Types:
     Asynchronous
   Installed SRAM Type: Asynchronous
   Speed: Unknown
   Error Correction Type: Single-bit ECC
   System Type: Unified
   Associativity: 8-way Set-associative

Handle 0x0004, DMI type 7, 19 bytes
Cache Information
   Socket Designation: Not Specified
   Configuration: Enabled, Not Socketed, Level 3
   Operational Mode: Write Back
   Location: Internal
   Installed Size: 6144 kB
   Maximum Size: 6144 kB
   Supported SRAM Types:
     Asynchronous
   Installed SRAM Type: Asynchronous
   Speed: Unknown
   Error Correction Type: Single-bit ECC
   System Type: Unified
   Associativity: 12-way Set-associative

Handle 0x0005, DMI type 7, 19 bytes
Cache Information
   Socket Designation: Not Specified
   Configuration: Enabled, Not Socketed, Level 4
   Operational Mode: Write Back
   Location: Internal
   Installed Size: 0 kB
   Maximum Size: 0 kB
   Supported SRAM Types:
     Asynchronous
   Installed SRAM Type: Asynchronous
   Speed: Unknown
   Error Correction Type: Single-bit ECC
   System Type: Unified
   Associativity: 16-way Set-associative

Handle 0x0006, DMI type 16, 15 bytes
Physical Memory Array
   Location: System Board Or Motherboard
   Use: System Memory
   Error Correction Type: None
   Maximum Capacity: 8 GB
   Error Information Handle: Not Provided
   Number Of Devices: 2

Handle 0x0007, DMI type 130, 186 bytes
OEM-specific Type
   Header and Data:
     82 BA 07 00 08 00 00 00 B0 00 92 12 0B 03 04 21
     02 09 03 52 01 08 0A 00 FE 00 69 78 69 30 69 11
     18 81 20 08 3C 3C 00 F0 83 01 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 0F 11 65 01 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80
     AD 01 00 00 00 00 00 00 41 EB 48 4D 54 34 31 47
     53 36 41 46 52 38 41 2D 50 42 20 20 4E 41 80 AD
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00

Handle 0x0008, DMI type 17, 27 bytes
Memory Device
   Array Handle: 0x0006
   Error Information Handle: No Error
   Total Width: Unknown
   Data Width: Unknown
   Size: 8192 MB
   Form Factor: SODIMM
   Set: None
   Locator: DIMM0
   Bank Locator: BANK 0
   Type: DDR3
   Type Detail: Synchronous
   Speed: 1600 MHz
   Manufacturer: 0x80AD
   Serial Number: 0x00000000
   Asset Tag: Unknown
   Part Number: 0x484D54343147533641465238412D50422020

Handle 0x0009, DMI type 130, 186 bytes
OEM-specific Type
   Header and Data:
     82 BA 09 00 0A 00 00 00 B0 00 92 12 0B 03 04 21
     02 09 03 52 01 08 0A 00 FE 00 69 78 69 30 69 11
     18 81 20 08 3C 3C 00 F0 83 01 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 0F 11 65 01 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80
     AD 01 00 00 00 00 00 00 41 EB 48 4D 54 34 31 47
     53 36 41 46 52 38 41 2D 50 42 20 20 4E 41 80 AD
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00

Handle 0x000A, DMI type 17, 27 bytes
Memory Device
   Array Handle: 0x0006
   Error Information Handle: No Error
   Total Width: Unknown
   Data Width: Unknown
   Size: 8192 MB
   Form Factor: SODIMM
   Set: None
   Locator: DIMM0
   Bank Locator: BANK 1
   Type: DDR3
   Type Detail: Synchronous
   Speed: 1600 MHz
   Manufacturer: 0x80AD
   Serial Number: 0x00000000
   Asset Tag: Unknown
   Part Number: 0x484D54343147533641465238412D50422020

Handle 0x000B, DMI type 19, 15 bytes
Memory Array Mapped Address
   Starting Address: 0x00000000000
   Ending Address: 0x003FFFFFFFF
   Range Size: 16 GB
   Physical Array Handle: 0x0006
   Partition Width: 0

Handle 0x000C, DMI type 0, 24 bytes
BIOS Information
   Vendor: Apple Inc.
   Version: MBP112.88Z.0138.B16.1509081314
   Release Date: 09/08/2015
   ROM Size: 8192 kB
   Characteristics:
     PCI is supported
     BIOS is upgradeable
     BIOS shadowing is allowed
     Boot from CD is supported
     Selectable boot is supported
     ACPI is supported
     IEEE 1394 boot is supported
     Smart battery is supported
     Function key-initiated network boot is supported
   BIOS Revision: 0.1

Handle 0x000D, DMI type 1, 27 bytes
System Information
   Manufacturer: Apple Inc.
   Product Name: MacBookPro11,3
   Version: 1.0
   Serial Number: C02MP4NFFD57
   UUID: FC4D5ABE-CB96-2D51-9481-3C0E403F20B9
   Wake-up Type: Power Switch
   SKU Number: System SKU#
   Family: Mac

Handle 0x000E, DMI type 2, 16 bytes
Base Board Information
   Manufacturer: Apple Inc.
   Product Name: Mac-2BD1B31983FE1663
   Version: MacBookPro11,3
   Serial Number: C0241930070FP5214
   Asset Tag: Base Board Asset Tag#
   Features:
     Board is a hosting board
     Board is replaceable
   Location In Chassis: Part Component
   Chassis Handle: 0x000F
   Type: Motherboard
   Contained Object Handles: 0

Handle 0x000F, DMI type 3, 21 bytes
Chassis Information
   Manufacturer: Apple Inc.
   Type: Notebook
   Lock: Not Present
   Version: Mac-2BD1B31983FE1663
   Serial Number: C02MP4NFFD57
   Asset Tag: Not Specified
   Boot-up State: Safe
   Power Supply State: Safe
   Thermal State: Other
   Security Status: Other
   OEM Information: 0x00000000
   Height: Unspecified
   Number Of Power Cords: Unspecified
   Contained Elements: 0

Handle 0x0010, DMI type 8, 9 bytes
Port Connector Information
   Internal Reference Designator: None
   Internal Connector Type: None
   External Reference Designator: USB0
   External Connector Type: Access Bus (USB)
   Port Type: USB

Handle 0x0011, DMI type 8, 9 bytes
Port Connector Information
   Internal Reference Designator: None
   Internal Connector Type: None
   External Reference Designator: USB1
   External Connector Type: Access Bus (USB)
   Port Type: USB

Handle 0x0012, DMI type 8, 9 bytes
Port Connector Information
   Internal Reference Designator: None
   Internal Connector Type: Other
   External Reference Designator: Mini DisplayPort
   External Connector Type: None
   Port Type: Other

Handle 0x0013, DMI type 8, 9 bytes
Port Connector Information
   Internal Reference Designator: None
   Internal Connector Type: Other
   External Reference Designator: Mini DisplayPort
   External Connector Type: None
   Port Type: Other

Handle 0x0014, DMI type 8, 9 bytes
Port Connector Information
   Internal Reference Designator: None
   Internal Connector Type: Other
   External Reference Designator: HDMI
   External Connector Type: None
   Port Type: Other

Handle 0x0015, DMI type 8, 9 bytes
Port Connector Information
   Internal Reference Designator: None
   Internal Connector Type: Other
   External Reference Designator: Microphone
   External Connector Type: None
   Port Type: Other

Handle 0x0016, DMI type 8, 9 bytes
Port Connector Information
   Internal Reference Designator: None
   Internal Connector Type: Other
   External Reference Designator: Speaker
   External Connector Type: None
   Port Type: Other

Handle 0x0017, DMI type 8, 9 bytes
Port Connector Information
   Internal Reference Designator: None
   Internal Connector Type: None
   External Reference Designator: MagSafe DC Power
   External Connector Type: Other
   Port Type: Other

Handle 0x0018, DMI type 8, 9 bytes
Port Connector Information
   Internal Reference Designator: None
   Internal Connector Type: None
   External Reference Designator: Audio Line Out
   External Connector Type: Mini Jack (headphones)
   Port Type: Audio Port

Handle 0x0019, DMI type 8, 9 bytes
Port Connector Information
   Internal Reference Designator: None
   Internal Connector Type: None
   External Reference Designator: SD Card Reader
   External Connector Type: Access Bus (USB)
   Port Type: USB

Handle 0x001A, DMI type 9, 13 bytes
System Slot Information
   Designation: AirPort
   Type: x1 PCI Express
   Current Usage: Available
   Length: Short
   ID: 0
   Characteristics:
     3.3 V is provided
     Hot-plug devices are supported
     SMBus signal is supported

Handle 0x001B, DMI type 9, 13 bytes
System Slot Information
   Designation: Thunderbolt Slot 1
   Type: 32-bit PCI
   Current Usage: Available
   Length: Long
   ID: 2
   Characteristics:
     3.3 V is provided
     PME signal is supported
     Hot-plug devices are supported
     SMBus signal is supported

Handle 0x001C, DMI type 9, 13 bytes
System Slot Information
   Designation: Thunderbolt Slot 2
   Type: 32-bit PCI
   Current Usage: Available
   Length: Long
   ID: 3
   Characteristics:
     3.3 V is provided
     PME signal is supported
     Hot-plug devices are supported
     SMBus signal is supported

Handle 0x001D, DMI type 9, 13 bytes
System Slot Information
   Designation: Thunderbolt Slot 3
   Type: 32-bit PCI
   Current Usage: Available
   Length: Long
   ID: 4
   Characteristics:
     3.3 V is provided
     PME signal is supported
     Hot-plug devices are supported
     SMBus signal is supported

Handle 0x001E, DMI type 9, 13 bytes
System Slot Information
   Designation: Thunderbolt Slot 4
   Type: 32-bit PCI
   Current Usage: Available
   Length: Long
   ID: 5
   Characteristics:
     3.3 V is provided
     PME signal is supported
     Hot-plug devices are supported
     SMBus signal is supported

Handle 0x001F, DMI type 10, 6 bytes
On Board Device Information
   Type: Video
   Status: Enabled
   Description: nVidia Video Adapter

Handle 0x0020, DMI type 10, 6 bytes
On Board Device Information
   Type: Sound
   Status: Enabled
   Description: Azalia Audio Codec

Handle 0x0021, DMI type 10, 6 bytes
On Board Device Information
   Type: Other
   Status: Enabled
   Description: SATA

Handle 0x0022, DMI type 11, 5 bytes
OEM Strings
   String 1: Apple ROM Version.  BIOS ID:  MBP112.  Built by:  root@s
   String 2: aumon.  Date:  Tue Sep  8 13:12:19 PDT 2015.  Revision:
   String 3:  138.16.0~1 (B&I).  Buildcave ID: 1540.  ROM Version:  0138_
   String 4: B16.

Handle 0x0023, DMI type 12, 5 bytes
System Configuration Options

Handle 0x0024, DMI type 13, 22 bytes
BIOS Language Information
   Language Description Format: Long
   Installable Languages: 1
     <BAD INDEX>
   Currently Installed Language: Not Specified

Handle 0x0025, DMI type 32, 20 bytes
System Boot Information
   Status: No errors detected

Handle 0x0026, DMI type 131, 6 bytes
OEM-specific Type
   Header and Data:
     83 06 26 00 05 07

Handle 0x0027, DMI type 128, 88 bytes
OEM-specific Type
   Header and Data:
     80 58 27 00 04 00 00 00 37 F5 03 E8 37 FF 03 E8
     02 00 00 03 00 00 00 00 00 00 99 FF FF FF B2 FF
     00 00 B3 FF FF FF B5 FF 00 00 B6 FF FF FF DD FF
     00 00 E1 FF FF FF E3 FF 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00

Handle 0x0028, DMI type 133, 12 bytes
OEM-specific Type
   Header and Data:
     85 0C 28 00 02 00 00 00 00 00 00 00

Handle 0x0029, DMI type 221, 26 bytes
OEM-specific Type
   Header and Data:
     DD 1A 29 00 03 01 00 01 06 01 00 00 02 00 00 00
     00 0F 00 03 00 01 03 00 01 00
   Strings:
     Reference Code - CPU
     uCode Version
     TXT ACM version

Invalid entry length (0). DMI table is broken! Stop.



some audio device information:
=========
/sbin/lsmod | grep snd
snd_seq_dummy  12467  2
snd_hrtimer  12604  1
snd_seq_midi  12848  0
snd_seq_midi_event  13316  1 snd_seq_midi
snd_rawmidi  26909  1 snd_seq_midi
snd_seq  57068  8 snd_seq_midi_event,snd_seq_dummy,snd_seq_midi
snd_seq_device  13132  4 snd_seq,snd_rawmidi,snd_seq_dummy,snd_seq_midi
snd_hda_codec_hdmi  45118  1
snd_hda_codec_cirrus  17682  1
snd_hda_codec_generic  63181  1 snd_hda_codec_cirrus
snd_hda_intel  26407  3
snd_hda_controller  26646  1 snd_hda_intel
snd_hda_codec  104500  5 snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller,snd_hda_codec_cirrus
snd_hwdep  13148  1 snd_hda_codec
snd_pcm_oss  44798  0
snd_mixer_oss  22042  1 snd_pcm_oss
snd_pcm  88662  7 snd_pcm_oss,snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_controller
snd_timer  26614  3 snd_hrtimer,snd_pcm,snd_seq
snd  65244  18 snd_pcm_oss,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_seq,snd_rawmidi,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel,snd_seq_device,snd_mixer_oss,snd_hda_codec_cirrus
soundcore  13026  2 snd,snd_hda_codec
```

Reached the 2000 char limit.


----------



## bcomputerguy (Aug 31, 2016)

Second half of the output:


```
=====
aplay -L
default
  Playback/recording through the PulseAudio sound server
null
  Discard all samples (playback) or generate zero samples (capture)
pulse
  PulseAudio Sound Server
sysdefault:CARD=PCH
  HDA Intel PCH, CS4208 Analog
  Default Audio Device
front:CARD=PCH,DEV=0
  HDA Intel PCH, CS4208 Analog
  Front speakers
surround21:CARD=PCH,DEV=0
  HDA Intel PCH, CS4208 Analog
  2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
  HDA Intel PCH, CS4208 Analog
  4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
  HDA Intel PCH, CS4208 Analog
  4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
  HDA Intel PCH, CS4208 Analog
  5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
  HDA Intel PCH, CS4208 Analog
  5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
  HDA Intel PCH, CS4208 Analog
  7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=PCH,DEV=0
  HDA Intel PCH, CS4208 Digital
  IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=PCH,DEV=0
  HDA Intel PCH, CS4208 Analog
  Direct sample mixing device
dmix:CARD=PCH,DEV=1
  HDA Intel PCH, CS4208 Digital
  Direct sample mixing device
dsnoop:CARD=PCH,DEV=0
  HDA Intel PCH, CS4208 Analog
  Direct sample snooping device
dsnoop:CARD=PCH,DEV=1
  HDA Intel PCH, CS4208 Digital
  Direct sample snooping device
hw:CARD=PCH,DEV=0
  HDA Intel PCH, CS4208 Analog
  Direct hardware device without any conversions
hw:CARD=PCH,DEV=1
  HDA Intel PCH, CS4208 Digital
  Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
  HDA Intel PCH, CS4208 Analog
  Hardware device with all software conversions
plughw:CARD=PCH,DEV=1
  HDA Intel PCH, CS4208 Digital
  Hardware device with all software conversions
hdmi:CARD=NVidia,DEV=0
  HDA NVidia, HDMI 0
  HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
  HDA NVidia, HDMI 1
  HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
  HDA NVidia, HDMI 2
  HDMI Audio Output
dmix:CARD=NVidia,DEV=3
  HDA NVidia, HDMI 0
  Direct sample mixing device
dmix:CARD=NVidia,DEV=7
  HDA NVidia, HDMI 1
  Direct sample mixing device
dmix:CARD=NVidia,DEV=8
  HDA NVidia, HDMI 2
  Direct sample mixing device
dsnoop:CARD=NVidia,DEV=3
  HDA NVidia, HDMI 0
  Direct sample snooping device
dsnoop:CARD=NVidia,DEV=7
  HDA NVidia, HDMI 1
  Direct sample snooping device
dsnoop:CARD=NVidia,DEV=8
  HDA NVidia, HDMI 2
  Direct sample snooping device
hw:CARD=NVidia,DEV=3
  HDA NVidia, HDMI 0
  Direct hardware device without any conversions
hw:CARD=NVidia,DEV=7
  HDA NVidia, HDMI 1
  Direct hardware device without any conversions
hw:CARD=NVidia,DEV=8
  HDA NVidia, HDMI 2
  Direct hardware device without any conversions
plughw:CARD=NVidia,DEV=3
  HDA NVidia, HDMI 0
  Hardware device with all software conversions
plughw:CARD=NVidia,DEV=7
  HDA NVidia, HDMI 1
  Hardware device with all software conversions
plughw:CARD=NVidia,DEV=8
  HDA NVidia, HDMI 2
  Hardware device with all software conversions

====
lspci -v
00:00.0 Host bridge: Intel Corporation Crystal Well DRAM Controller (rev 08)
   Subsystem: Apple Inc. Device 012f
   Flags: bus master, fast devsel, latency 0
   Capabilities: <access denied>

00:01.0 PCI bridge: Intel Corporation Crystal Well PCI Express x16 Controller (rev 08) (prog-if 00 [Normal decode])
   Flags: bus master, fast devsel, latency 0
   Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
   I/O behind bridge: 00001000-00001fff
   Memory behind bridge: c0000000-c10fffff
   Prefetchable memory behind bridge: 0000000080000000-0000000091ffffff
   Capabilities: <access denied>
   Kernel driver in use: pcieport

00:01.1 PCI bridge: Intel Corporation Crystal Well PCI Express x8 Controller (rev 08) (prog-if 00 [Normal decode])
   Flags: bus master, fast devsel, latency 0
   Bus: primary=00, secondary=06, subordinate=9c, sec-latency=0
   I/O behind bridge: 00003000-00005fff
   Memory behind bridge: c1f00000-cdffffff
   Prefetchable memory behind bridge: 00000000ce000000-00000000d9ffffff
   Capabilities: <access denied>
   Kernel driver in use: pcieport

00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05) (prog-if 30 [XHCI])
   Subsystem: Intel Corporation Device 7270
   Flags: bus master, medium devsel, latency 0, IRQ 48
   Memory at c1e00000 (64-bit, non-prefetchable) [size=64K]
   Capabilities: <access denied>
   Kernel driver in use: xhci_hcd

00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)
   Subsystem: Intel Corporation Device 7270
   Flags: bus master, fast devsel, latency 0, IRQ 49
   Memory at c1e19100 (64-bit, non-prefetchable)
   Capabilities: <access denied>
   Kernel driver in use: mei_me

00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)
   Subsystem: Intel Corporation Device 7270
   Flags: bus master, fast devsel, latency 0, IRQ 50
   Memory at c1e14000 (64-bit, non-prefetchable) [size=16K]
   Capabilities: <access denied>
   Kernel driver in use: snd_hda_intel

00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d5) (prog-if 00 [Normal decode])
   Flags: bus master, fast devsel, latency 0
   Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
   I/O behind bridge: 00002000-00002fff
   Memory behind bridge: 7fa00000-7fbfffff
   Prefetchable memory behind bridge: 000000007fc00000-000000007fdfffff
   Capabilities: <access denied>
   Kernel driver in use: pcieport

00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 (rev d5) (prog-if 00 [Normal decode])
   Flags: bus master, fast devsel, latency 0
   Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
   Memory behind bridge: c1800000-c1afffff
   Capabilities: <access denied>
   Kernel driver in use: pcieport

00:1c.3 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #4 (rev d5) (prog-if 00 [Normal decode])
   Flags: bus master, fast devsel, latency 0
   Bus: primary=00, secondary=04, subordinate=04, sec-latency=0
   Memory behind bridge: c1c00000-c1dfffff
   Prefetchable memory behind bridge: 00000000a0000000-00000000afffffff
   Capabilities: <access denied>
   Kernel driver in use: pcieport

00:1c.4 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #5 (rev d5) (prog-if 00 [Normal decode])
   Flags: bus master, fast devsel, latency 0
   Bus: primary=00, secondary=05, subordinate=05, sec-latency=0
   Memory behind bridge: c1b00000-c1bfffff
   Capabilities: <access denied>
   Kernel driver in use: pcieport

00:1f.0 ISA bridge: Intel Corporation HM87 Express LPC Controller (rev 05)
   Subsystem: Intel Corporation Device 7270
   Flags: bus master, medium devsel, latency 0
   Capabilities: <access denied>
   Kernel driver in use: lpc_ich

00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 05)
   Subsystem: Intel Corporation Device 7270
   Flags: medium devsel, IRQ 18
   Memory at c1e19000 (64-bit, non-prefetchable)
   I/O ports at efa0

01:00.0 VGA compatible controller: NVIDIA Corporation GK107M [GeForce GT 750M Mac Edition] (rev a1) (prog-if 00 [VGA controller])
   Subsystem: Apple Inc. Device 0130
   Flags: bus master, fast devsel, latency 0, IRQ 51
   Memory at c0000000 (32-bit, non-prefetchable) [size=16M]
   Memory at 80000000 (64-bit, prefetchable) [size=256M]
   Memory at 90000000 (64-bit, prefetchable) [size=32M]
   I/O ports at 1000
   [virtual] Expansion ROM at c1000000 [disabled] [size=512K]
   Capabilities: <access denied>
   Kernel driver in use: nvidia

01:00.1 Audio device: NVIDIA Corporation GK107 HDMI Audio Controller (rev a1)
   Subsystem: Apple Inc. Device 0130
   Flags: bus master, fast devsel, latency 0, IRQ 17
   Memory at c1080000 (32-bit, non-prefetchable) [size=16K]
   Capabilities: <access denied>
   Kernel driver in use: snd_hda_intel

03:00.0 Network controller: Broadcom Corporation BCM4360 802.11ac Wireless Network Adapter (rev 03)
   Subsystem: Apple Inc. Device 0134
   Flags: bus master, fast devsel, latency 0, IRQ 18
   Memory at c1a00000 (64-bit, non-prefetchable) [size=32K]
   Memory at c1800000 (64-bit, non-prefetchable) [size=2M]
   Capabilities: <access denied>
   Kernel driver in use: wl

04:00.0 Multimedia controller: Broadcom Corporation Device 1570
   Subsystem: Broadcom Corporation Device 1570
   Flags: bus master, fast devsel, latency 0
   Memory at c1d00000 (64-bit, non-prefetchable) [size=64K]
   Memory at a0000000 (64-bit, prefetchable) [size=256M]
   Memory at c1c00000 (64-bit, non-prefetchable) [size=1M]
   Capabilities: <access denied>

05:00.0 SATA controller: Samsung Electronics Co Ltd Apple PCIe SSD (rev 01) (prog-if 01 [AHCI 1.0])
   Flags: bus master, fast devsel, latency 0, IRQ 16
   Memory at c1b00000 (32-bit, non-prefetchable) [size=8K]
   Expansion ROM at c1b10000 [disabled] [size=64K]
   Capabilities: <access denied>
   Kernel driver in use: ahci
```


I hope that this is enough information to get this audio issue sorted out on FreeBSD.


----------



## bcomputerguy (Aug 31, 2016)

shepper said:


> If you plug the MacBook into a TV, the default sound setting may work.
> 
> If instead you want to use built in speakers try the steps below.
> 
> ...



The audio has never worked on freeBSD it works on linux. Setting the device also doesn't work.

I've tried setting the new sound device, quitting firefox, relaunching firefox and trying to play a youtube video.

I've tried it on all snd hardware but so far none of them works.

Can you provide any other tips or link to those articles you were referring to earlier?


----------



## bcomputerguy (Aug 31, 2016)

I found this article that talks about settings home boot hints: http://blog.hplogsdon.com/tuning-freebsd-for-apple-hardware/
I also saw a forum thread talking about the same things.

How do you find these device ids to use to set the hints? Are those documented somewhere?

Here's the relevant parts sans the adding snd_hda(4) to /boot/loader.conf

Sound and Audio
Both my iMac and my MacBook Pro use snd_hda(4) as the driver. I've now compiled it directly into the kernel, but it can be easily loaded with
`kldload snd_hda`

or by adding this line to /boot/loader.conf:

```
snd_hda_load="YES"
```
But, with both computers, sound still didn't work. Right now, a month or more after running BSD almost full time, at least on my MacBook Pro, it still isn't working completely correctly. On my MacBook Pro, the lines I stick into /boot/device.hints to get my sound working through the speakers is:

```
hint.hdac.0.cad0.nid10.config="as=2 seq=2"
hint.hdac.0.cad0.nid12.config="as=4 seq=1"
hint.hdac.0.config="gpio0"
```
and in order to route it through the headphone jack, I have to stick these lines into /boot/device.hints:

```
hint.hdac.0.cad0.nid10.config="as=2 seq=2"
hint.hdac.0.cad0.nid11.config="as=0 seq=2"
hint.hdac.0.cad0.nid12.config="as=4 seq=1"
hint.hdac.0.cad0.nid15.config="as=0 seq=2"
hint.hdac.0.config="gpio0 ovref"
```
As you can see, there is a bit of duplication. I'm not completely sure how to combine these two groups to get speakers to work by default. Whenever I have the headphone jack lines in the device.hints file, the speakers quite working. Whenever I remove them, the speakers work again.

And the fact that I have to reboot my fucking computer every time I make one change in order for the device to reconfigured makes the fine tuning of my speakers a bitch to do, so it might be a while until I figure it out.

On my iMac, the sound in tinny. There is no bass sound, and that sucks. Also if I bring both PCM and VOL volumes up very high, and REC is up even a tiny bit, the speakers go haywire and the girlfriend starts throwing shit at me to turn it off. I haven't given up on adjusting the sound, but it takes a lit of effort.

I'll continue to edit this post as more information comes up... I can't remember thing that I have done.

=====
How can I find those hint.hdac.0.cad0.nid10 strings? I saw another one that was something like hint.hdaa.xxxxxx


----------



## bcomputerguy (Aug 31, 2016)

Actually, I think I found it with `sysctl -a | grep hda`, here's some output. Anything looks out of the ordinary? Any documentation on working with these things, this is totally uncharted waters for me.


----------



## shepper (Aug 31, 2016)

Sound chips that use the intel hda specification have many, many pins.  Most laptop manufacturers do not use all the pins,  Different manufacturers assign the pins differently, ie Asus may assign pin 14 to the on-board speakers while Apple may assign pin 15 to the speakers.

In linux there is a large database (codecs) that specifies the pin assignments.  There is variation within a codec and Linux users specify a particular variation in /etc/modprobe.d.  FreeBSD does not utilize a database, it interrogates the pins during boot (nids in your hda.txt output) and groups them based on location of the jacks.  FreeBSD sound configuration does not always configure the pin assignments correctly or as you would like them.  FreeBSD users can re-assign the pins using the /boot/device.hints file. device.hints(5)

If you just want to get the laptop working, I believe the fastest way is to search for your particular laptop model and FreeBSD.  Someone likely has already worked this out.

If, instead, you want to understand what you are doing, I would read snd_hda(4) and search this forum.  There are at least 8 or 9 posts where non-working sound has been sorted out and fixed.

One key thing in the snd_hda man page is putting the speaker nid and headphone nid in the same association.  If you then assign the headphone nid a sequence = 15, it should sense the headphone jack and mute any lower numbered nids, in that particular association, which are typically the onboard speakers.


----------



## wblock@ (Aug 31, 2016)

shepper said:


> The snd_hda entry in your /boot/loader.conf unnecessarily loads it a second time.


More specifically, it tries to load it a second time.  There ought to be a way to silence the warnings if it is already loaded, like the kldload(8) -q option.


----------



## shepper (Sep 1, 2016)

bcomputerguy said:


> I've tried setting the new sound device, quitting firefox, relaunching firefox and trying to play a youtube video.



I recall some issues with sound in FreeBSD/Firefox.  Playing an mp3 with simple player audio/mpg123 is a more reliable test.  The handbook section I referenced above also tells you how to generate some white noise.
`cat [I]filename[/I] > /dev/dsp`


----------



## bcomputerguy (Sep 1, 2016)

shepper said:


> I recall some issues with sound in FreeBSD/Firefox.  Playing an mp3 with simple player audio/mpg123 is a more reliable test.  The handbook section I referenced above also tells you how to generate some white noise.
> `cat [I]filename[/I] > /dev/dsp`



I don't have just a /dev/dsp, there's a /dev/dsp0.0% and /dev/dsp3.0% I am not sure what that's about to be honest.

I've also tried the sound on Firefox, Chromium, and VLC with an .wav file and nothing. The sound on the system is not functional. I saw this thread and asked over there as well : Thread 51788/


----------



## shepper (Sep 1, 2016)

bcomputerguy said:


> I don't have just a /dev/dsp, theres a /dev/dsp0.0% and /dev/dsp3.0% I am not sure what that's about to be honest.



My understanding is that dsp0 corresponds to pcm0 while dsp3 corresponds to pcm3.  /dev/dsp is suppose to be linked at boot to point to your default sound device.  In your case, it is likely that pcm3 would be your default device.  If you did not specify
/etc/sysctl.conf

```
hw.snd_default_unit=3
```
 you will loose the link on reboot.
See this Thread 9413.


----------



## grahamperrin@ (Sep 1, 2016)

bcomputerguy said:


> … hopefully while avoiding pulseaudio.



Please, why the avoidance? 

In a recent test of TrueOS Desktop I found that pavucontrol allowed me to get audio from (for example) YouTube in Firefox.


----------



## bcomputerguy (Sep 1, 2016)

grahamperrin There are many other discussions on pulseaudio, alsa and oss. Even on linux I only used pulseaudio as a jack module because I rand a lot of music programs, mostly seq24, ardour, cadence tools which was tool to configure jack although I did it with scripts before. If FreeBSD cannot run audio, I would be pretty bummed because music is one of the main things that I do on the side.

shepper that still didn't work, not with firefox, chromium or vlc with local mp3. Earlier you said that linux had some database files that laid out how the pins were supposed to be arranged. Couldn't those be added to the FreeBSD project, even as a port or something? Also how could I find that database of sound card configuration data?

Right now I am not sure which path to take but I can't really use FreeBSD w/o sound as I do a lot of sound work second only to graphics programming.


----------



## SirDice (Sep 1, 2016)

bcomputerguy said:


> How can I find those hint.hdac.0.cad0.nid10 strings? I saw another one that was something like hint.hdaa.xxxxxx


Have a look at the snd_hda(4) man page, specifically the examples section at the end. You basically have to do a verbose boot, which will give you a lot of information, then adjust the pin layout accordingly.


----------



## Snurg (Sep 1, 2016)

This NID mapping is a highly Interesting topic...
If I understand this correctly this might be the reason why some sound cards with the same chip work and others not (i.e. no input and/or output).

Is it is possible to write a tool which enables one to check through all NIDS semiautomatically and quickly find those that actually "do the connection"?
Maybe such would allow to adapt generic chip drivers to all possible sound boards with varying NID mapping?

Maybe it could also be possible to use the ACPI information to get this information from the BIOS? Here a Linux-related article about this.


----------



## Juha Nurmela (Sep 1, 2016)

A generic verb pump sounds like a great idea.

Needing to turn mic bias on/off, to key a ham radio, I hardcoded the NID 11 of the mic in this particular PC.
Should have thought further. dev.hdaa.0.verb=0x123

Note the CTLFLAG_ANYBODY.

Juha


```
$ diff -c /sys/dev/sound/pci/hda/hdaa.c*
*** /sys/dev/sound/pci/hda/hdaa.c  Thu Aug 25 14:17:22 2016
--- /sys/dev/sound/pci/hda/hdaa.c.orig  Fri Aug 19 03:33:00 2016
***************
*** 6386,6419 ****
  return (0);
  }
 
- /* junki */
- static int
- hdaa_sysctl_mic_control(SYSCTL_HANDLER_ARGS)
- {
-  struct hdaa_devinfo *devinfo = oidp->oid_arg1;
-  struct hdaa_widget *w = hdaa_widget_get(devinfo, 11);
-  int error, val;
-
-  if (w == NULL)
-  return (ENODEV);
-
-  val = w->wclass.pin.ctrl;
-
-  error = sysctl_handle_int(oidp, &val, 0, req);
-  if (error || req->newptr == NULL)
-  return (error);
-
-  hdaa_lock(devinfo);
-
-  w->wclass.pin.ctrl = val;
-
-  hda_command(devinfo->dev,
-  HDA_CMD_SET_PIN_WIDGET_CTRL(0, w->nid, w->wclass.pin.ctrl));
-  hdaa_unlock(devinfo);
-
-  return (0);
- }
-
  static int
  hdaa_sysctl_gpo_state(SYSCTL_HANDLER_ARGS)
  {
--- 6386,6391 ----
***************
*** 6701,6714 ****
  "reconfig", CTLTYPE_INT | CTLFLAG_RW,
  dev, sizeof(dev),
  hdaa_sysctl_reconfig, "I", "Reprocess configuration");
-
- /* junki */
-  SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
-  SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
-  "mic_control", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY,
-  devinfo, sizeof(devinfo),
-  hdaa_sysctl_mic_control, "I", "mic bias control etc");
-
  bus_generic_attach(dev);
  return (0);
  }
--- 6673,6678 ----
```
Sorry about the reversed diff


----------



## shepper (Sep 1, 2016)

bcomputerguy said:


> Right now I am not sure which path to take but I can't really use FreeBSD w/o sound as I do a lot of sound work second only to graphics programming.



It is going to take more effort but as the MacBook Pro 11.3 is common, it would be worthwhile to work this out.

Start by posting the audio portion of your verbose dmesg as suggested by SirDice above.


----------



## SirDice (Sep 2, 2016)

bcomputerguy, please use pastebin or a similar service to post large batches of logging.


----------



## bcomputerguy (Sep 2, 2016)

SirDice said:


> bcomputerguy, please use pastebin or a similar service to post large batches of logging.



My apologizes, I really didn't know there was a 20k limit on a forum post and once I started I didn't know what to do.

Does FreeBSD have it's own pastebin type service? Some communities are particular to that type of thing.


----------



## SirDice (Sep 2, 2016)

No, but we do have misc/pastebinit to make it easier.


----------



## bcomputerguy (Sep 2, 2016)

Here is the patebin : http://pastebin.com/KvBEwNY9
And I'll upload the file just because.

Also I removed all the previous posts with the code pasted all over the place. This is my complete boot log, how can we sort out this audio issue?


----------



## shepper (Sep 2, 2016)

bcomputerguy said:


> This is my complete boot log, how can we sort out this audio issue?



How you sort this out is in the manual page for snd_hda.  Prior posts have linked this for you.

When I went through this, I had to devote some effort to understand it.

Your default pin assignments are listed in your pastebin, lines 847 -> 1086.  We are going to focus on the Cirrus Logic Pins, Line 925.

```
[LIST=1]
[*]Sep  2 13:41:37 bn kernel: hdaa1: nid   0x    as seq device       conn  jack    loc        color   misc
[*]Sep  2 13:41:37 bn kernel: hdaa1: 16 002b4020 2  0  Headphones    Jack  Combo   0x00       Green   0
[*]Sep  2 13:41:37 bn kernel: hdaa1: 17 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
[*]Sep  2 13:41:37 bn kernel: hdaa1: 18 90100110 1  0  Speaker       Fixed Unknown Internal   Unknown 1
[*]Sep  2 13:41:37 bn kernel: hdaa1: 19 90100112 1  2  Speaker       Fixed Unknown Internal   Unknown 1
[*]Sep  2 13:41:37 bn kernel: hdaa1: 20 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
[*]Sep  2 13:41:37 bn kernel: hdaa1: 21 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
[*]Sep  2 13:41:37 bn kernel: hdaa1: 22 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
[*]Sep  2 13:41:37 bn kernel: hdaa1: 23 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
[*]Sep  2 13:41:37 bn kernel: hdaa1: 24 00ab9040 4  0  Mic           Jack  Combo   0x00       Pink    0
[*]Sep  2 13:41:37 bn kernel: hdaa1: 25 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
[*]Sep  2 13:41:37 bn kernel: hdaa1: 26 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
[*]Sep  2 13:41:37 bn kernel: hdaa1: 27 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
[*]Sep  2 13:41:37 bn kernel: hdaa1: 28 90a60100 0  0  Mic           Fixed Digital Internal   Unknown 1
[*]Sep  2 13:41:37 bn kernel: hdaa1: 29 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
[*]Sep  2 13:41:37 bn kernel: hdaa1: 30 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
[*]Sep  2 13:41:37 bn kernel: hdaa1: 31 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
[*]Sep  2 13:41:37 bn kernel: hdaa1: 32 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
[*]Sep  2 13:41:37 bn kernel: hdaa1: 33 004be030 3  0  SPDIF-out     Jack  Combo   0x00       White   0
[*]Sep  2 13:41:37 bn kernel: hdaa1: 34 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
[/LIST]
```

Note that pins (nid) 18 and 19 are Speakers and they are in the same association (as=1) and the device is hdaa1

Your prior hints

```
hint.hdac.0.cad0.nid10.config="as=2 seq=2"
hint.hdac.0.cad0.nid12.config="as=4 seq=1
```
assigned pins 10 and 11 to the zero device (hdac.0 which can also be referenced as hdaa.0 in the hints).

I would start by assigning pin 18 and 19 to hdac.1 with as=1

```
hint.hdac.1.cad0.nid18.config="as=1 seq=0"
hint.hdac.1.cad0.nid19.config="as=1 seq=2"
```

These hints are for pcm3 which will need to be the default.


----------



## fernandel (Sep 4, 2016)

I had the similar problem on iMac 11,1 long time. I didn't find correct settings. What I have now is that just headphones works. I had also once just speaker works but sound was not good and settings when works at the same time speakers and headphones.
Now I have in /boot/device.hints:

```
hint.hdaa.gpio_config="3=set"
hint.hdaa.1.nid9.config="as=4 seq=0 misc=1"
hint.hdaa.1.nid10.config="as=4 seq=2"
hint.hdaa.1.nid11.config="as=4 seq=4"
```
and in /etc/sysctl.conf:

```
hw.snd.default_auto=0
hw.snd.default_unit=1
```


```
# cat /dev/sndstat
Installed devices:
pcm0: <ATI R6xx (HDMI)> (play)
pcm1: <Cirrus Logic CS4206 (Analog 6ch/2.0)> (play/rec) default
pcm2: <Cirrus Logic CS4206 (Rear Analog Line-in)> (rec)
pcm3: <Cirrus Logic CS4206 (Rear Digital)> (play/rec)
```


```
# dmesg | grep pcm
pcm0: <ATI R6xx (HDMI)> at nid 3 on hdaa0
pcm1: <Cirrus Logic CS4206 (Analog 6ch/2.0)> at nid 9,10,11 and 13 on hdaa1
pcm2: <Cirrus Logic CS4206 (Rear Analog Line-in)> at nid 12 on hdaa1
pcm3: <Cirrus Logic CS4206 (Rear Digital)> at nid 16 and 15 on hdaa1
pcm0: <ATI R6xx (HDMI)> at nid 3 on hdaa0
pcm1: <Cirrus Logic CS4206 (Analog 6ch/2.0)> at nid 9,10,11 and 13 on hdaa1
pcm2: <Cirrus Logic CS4206 (Rear Analog Line-in)> at nid 12 on hdaa1
pcm3: <Cirrus Logic CS4206 (Rear Digital)> at nid 16 and 15 on hdaa1
```

Thank you.


----------



## bcomputerguy (Sep 6, 2016)

shepper said:


> How you sort this out is in the manual page for snd_hda.  Prior posts have linked this for you.
> 
> When I went through this, I had to devote some effort to understand it.
> 
> ...



shepper wow, that makes my headphone audio work and they sound great too! Here's the pastebin : http://paste2.org/ap1Bn9HF


----------



## bcomputerguy (Sep 8, 2016)

shepper please help once more.

I had to do a fresh install of FreeBSD because building some ports I setup a circular dependency that would run until my computer died. Anyways that's sorted out now but my audio no longer works, even with the edits you showed above.

I tried but I am making some mistakes and it takes a whole restart cycle to test. Here's what I've done so far.

Updated my /etc/sysctl.conf to this adding the code to set the default hw to 3

```
# $FreeBSD: releng/11.0/etc/sysctl.conf 112200 2003-03-13 18:43:50Z mux $
#
#  This file is read when going to multi-user and its contents piped thru
#  ``sysctl'' to adjust kernel values.  ``man 5 sysctl.conf'' for details.
#

# Uncomment this to prevent users from seeing information about processes that
# are being run under another UID.
#security.bsd.see_other_uids=0
kern.ipc.shm_allow_removed=1
hw.snd.default_unit=3
```

edit my /boot/device.hints, I used hint.hdaa because that's what the name comes up as in the verbose boot logs. Although you wrote hdac in the above, I also tried hdac but that didn't work either.


```
# $FreeBSD: releng/11.0/sys/amd64/conf/GENERIC.hints 297243 2016-03-24 20:52:35Z mav $
hint.fdc.0.at="isa"
hint.fdc.0.port="0x3F0"
hint.fdc.0.irq="6"
hint.fdc.0.drq="2"
hint.fd.0.at="fdc0"
hint.fd.0.drive="0"
hint.fd.1.at="fdc0"
hint.fd.1.drive="1"
hint.atkbdc.0.at="isa"
hint.atkbdc.0.port="0x060"
hint.atkbd.0.at="atkbdc"
hint.atkbd.0.irq="1"
hint.psm.0.at="atkbdc"
hint.psm.0.irq="12"
hint.sc.0.at="isa"
hint.sc.0.flags="0x100"
hint.uart.0.at="isa"
hint.uart.0.port="0x3F8"
hint.uart.0.flags="0x10"
hint.uart.0.irq="4"
hint.uart.1.at="isa"
hint.uart.1.port="0x2F8"
hint.uart.1.irq="3"
hint.ppc.0.at="isa"
hint.ppc.0.irq="7"
hint.atrtc.0.at="isa"
hint.atrtc.0.port="0x70"
hint.atrtc.0.irq="8"
hint.attimer.0.at="isa"
hint.attimer.0.port="0x40"
hint.attimer.0.irq="0"
hint.acpi_throttle.0.disabled="1"
hint.p4tcc.0.disabled="1"
hint.hdaa.1.cad0.nid18.config="as=1 seq=0"
hint.hdaa.1.cad0.nid19.config="as=1 seq=2"
```

and my verbose boot logs, I found all the parts that I think are relevant as well. I might have missed something though.

```
blubee@bn:~ % cat all.log | grep hda
Sep  7 19:48:47 bn kernel: hdac0: <NVIDIA (0x0e1b) HDA Controller> mem 0xc1080000-0xc1083fff at device 0.1 on pci1
Sep  7 19:48:47 bn kernel: hdac1: <Intel Lynx Point HDA Controller> mem 0xc1b14000-0xc1b17fff at device 27.0 on pci0
Sep  7 19:48:47 bn kernel: hdacc0: <NVIDIA (0x0042) HDA CODEC> at cad 0 on hdac0
Sep  7 19:48:47 bn kernel: hdaa0: <NVIDIA (0x0042) Audio Function Group> at nid 1 on hdacc0
Sep  7 19:48:47 bn kernel: pcm0: <NVIDIA (0x0042) (HDMI/DP 8ch)> at nid 4 on hdaa0
Sep  7 19:48:47 bn kernel: pcm1: <NVIDIA (0x0042) (HDMI/DP 8ch)> at nid 5 on hdaa0
Sep  7 19:48:47 bn kernel: pcm2: <NVIDIA (0x0042) (HDMI/DP 8ch)> at nid 7 on hdaa0
Sep  7 19:48:47 bn kernel: hdacc1: <Cirrus Logic (0x4208) HDA CODEC> at cad 0 on hdac1
Sep  7 19:48:47 bn kernel: hdaa1: <Cirrus Logic (0x4208) Audio Function Group> at nid 1 on hdacc1
Sep  7 19:48:47 bn kernel: pcm3: <Cirrus Logic (0x4208) (Analog 4.0/2.0)> at nid 18,19 and 24 on hdaa1
Sep  7 19:48:47 bn kernel: pcm4: <Cirrus Logic (0x4208) (Analog Headphones)> at nid 16 on hdaa1
Sep  7 19:48:47 bn kernel: pcm5: <Cirrus Logic (0x4208) (Digital)> at nid 33 on hdaa1
Sep  7 20:01:22 bn kernel: hdac0: <NVIDIA (0x0e1b) HDA Controller> mem 0xc1080000-0xc1083fff at device 0.1 on pci1
Sep  7 20:01:22 bn kernel: hdac0: PCI card vendor: 0x106b, device: 0x0130
Sep  7 20:01:22 bn kernel: hdac0: HDA Driver Revision: 20120126_0002
Sep  7 20:01:22 bn kernel: hdac0: Config options: on=0x00000000 off=0x00000000
Sep  7 20:01:22 bn kernel: hdac0: attempting to allocate 1 MSI vectors (1 supported)
Sep  7 20:01:22 bn kernel: hdac0: using IRQ 264 for MSI
Sep  7 20:01:22 bn kernel: hdac0: Caps: OSS 4, ISS 4, BSS 0, NSDO 4, 64bit, CORB 256, RIRB 256
Sep  7 20:01:22 bn kernel: random: harvesting attach, 8 bytes (4 bits) from hdac0
Sep  7 20:01:22 bn kernel: hdac1: <Intel Lynx Point HDA Controller> mem 0xc1b14000-0xc1b17fff at device 27.0 on pci0
Sep  7 20:01:22 bn kernel: hdac1: PCI card vendor: 0x8086, device: 0x7270
Sep  7 20:01:22 bn kernel: hdac1: HDA Driver Revision: 20120126_0002
Sep  7 20:01:22 bn kernel: hdac1: Config options: on=0x00000000 off=0x00000000
Sep  7 20:01:22 bn kernel: hdac1: attempting to allocate 1 MSI vectors (1 supported)
Sep  7 20:01:22 bn kernel: hdac1: using IRQ 266 for MSI
Sep  7 20:01:22 bn kernel: hdac1: Caps: OSS 4, ISS 4, BSS 0, NSDO 1, 64bit, CORB 256, RIRB 256
Sep  7 20:01:22 bn kernel: random: harvesting attach, 8 bytes (4 bits) from hdac1
Sep  7 20:01:22 bn kernel: hdacc0: <NVIDIA (0x0042) HDA CODEC> at cad 0 on hdac0
Sep  7 20:01:22 bn kernel: hdaa0: <NVIDIA (0x0042) Audio Function Group> at nid 1 on hdacc0
Sep  7 20:01:22 bn kernel: hdaa0: Subsystem ID: 0x106b0130
Sep  7 20:01:22 bn kernel: hdaa0: NumGPIO=0 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=0
Sep  7 20:01:22 bn kernel: hdaa0: Original pins configuration:
Sep  7 20:01:22 bn kernel: hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
Sep  7 20:01:22 bn kernel: hdaa0:  4 185600f0 15 0  Digital-out   Jack  Digital 0x18       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa0:  5 185600f0 15 0  Digital-out   Jack  Digital 0x18       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa0:  6 585600f0 15 0  Digital-out   None  Digital 0x18       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa0:  7 185600f0 15 0  Digital-out   Jack  Digital 0x18       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa0: Patched pins configuration:
Sep  7 20:01:22 bn kernel: hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
Sep  7 20:01:22 bn kernel: hdaa0:  4 185600f0 15 0  Digital-out   Jack  Digital 0x18       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa0:  5 185600f0 15 0  Digital-out   Jack  Digital 0x18       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa0:  6 585600f0 15 0  Digital-out   None  Digital 0x18       Unknown 0 DISA
Sep  7 20:01:22 bn kernel: hdaa0:  7 185600f0 15 0  Digital-out   Jack  Digital 0x18       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa0: 3 associations found:
Sep  7 20:01:22 bn kernel: hdaa0: Association 0 (15) out:
Sep  7 20:01:22 bn kernel: hdaa0:  Pin nid=4 seq=0
Sep  7 20:01:22 bn kernel: hdaa0: Association 1 (15) out:
Sep  7 20:01:22 bn kernel: hdaa0:  Pin nid=5 seq=0
Sep  7 20:01:22 bn kernel: hdaa0: Association 2 (15) out:
Sep  7 20:01:22 bn kernel: hdaa0:  Pin nid=7 seq=0
Sep  7 20:01:22 bn kernel: hdaa0: Tracing association 0 (15)
Sep  7 20:01:22 bn kernel: hdaa0:  Pin 4 traced to DAC 8
Sep  7 20:01:22 bn kernel: hdaa0: Association 0 (15) trace succeeded
Sep  7 20:01:22 bn kernel: hdaa0: Tracing association 1 (15)
Sep  7 20:01:22 bn kernel: hdaa0:  Pin 5 traced to DAC 9
Sep  7 20:01:22 bn kernel: hdaa0: Association 1 (15) trace succeeded
Sep  7 20:01:22 bn kernel: hdaa0: Tracing association 2 (15)
Sep  7 20:01:22 bn kernel: hdaa0:  Pin 7 traced to DAC 10
Sep  7 20:01:22 bn kernel: hdaa0: Association 2 (15) trace succeeded
Sep  7 20:01:22 bn kernel: hdaa0: Looking for additional DAC for association 0 (15)
Sep  7 20:01:22 bn kernel: hdaa0: Looking for additional DAC for association 1 (15)
Sep  7 20:01:22 bn kernel: hdaa0: Looking for additional DAC for association 2 (15)
Sep  7 20:01:22 bn kernel: hdaa0: Tracing input monitor
Sep  7 20:01:22 bn kernel: hdaa0: Tracing other input monitors
Sep  7 20:01:22 bn kernel: hdaa0: Tracing beeper
Sep  7 20:01:22 bn kernel: hdaa0: FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivref
Sep  7 20:01:22 bn kernel: pcm0: <NVIDIA (0x0042) (HDMI/DP 8ch)> at nid 4 on hdaa0
Sep  7 20:01:22 bn kernel: pcm1: <NVIDIA (0x0042) (HDMI/DP 8ch)> at nid 5 on hdaa0
Sep  7 20:01:22 bn kernel: pcm2: <NVIDIA (0x0042) (HDMI/DP 8ch)> at nid 7 on hdaa0
Sep  7 20:01:22 bn kernel: random: harvesting attach, 8 bytes (4 bits) from hdaa0
Sep  7 20:01:22 bn kernel: random: harvesting attach, 8 bytes (4 bits) from hdacc0
Sep  7 20:01:22 bn kernel: hdacc1: <Cirrus Logic (0x4208) HDA CODEC> at cad 0 on hdac1
Sep  7 20:01:22 bn kernel: hdaa1: <Cirrus Logic (0x4208) Audio Function Group> at nid 1 on hdacc1
Sep  7 20:01:22 bn kernel: hdaa1: Subsystem ID: 0x106b5e00
Sep  7 20:01:22 bn kernel: hdaa1: NumGPIO=6 NumGPO=2 NumGPI=0 GPIWake=1 GPIUnsol=1
Sep  7 20:01:22 bn kernel: hdaa1:  GPIO0: output state=0
Sep  7 20:01:22 bn kernel: hdaa1:  GPIO1: disabled
Sep  7 20:01:22 bn kernel: hdaa1:  GPIO2: disabled
Sep  7 20:01:22 bn kernel: hdaa1:  GPIO3: disabled
Sep  7 20:01:22 bn kernel: hdaa1:  GPIO4: disabled
Sep  7 20:01:22 bn kernel: hdaa1:  GPIO5: disabled
Sep  7 20:01:22 bn kernel: hdaa1:  GPO0: state=0hdaa1:  GPO1: state=0hdaa1: Original pins configuration:
Sep  7 20:01:22 bn kernel: hdaa1: nid   0x    as seq device       conn  jack    loc        color   misc
Sep  7 20:01:22 bn kernel: hdaa1: 16 002b4020 2  0  Headphones    Jack  Combo   0x00       Green   0
Sep  7 20:01:22 bn kernel: hdaa1: 17 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa1: 18 90100110 1  0  Speaker       Fixed Unknown Internal   Unknown 1
Sep  7 20:01:22 bn kernel: hdaa1: 19 90100112 1  2  Speaker       Fixed Unknown Internal   Unknown 1
Sep  7 20:01:22 bn kernel: hdaa1: 20 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa1: 21 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa1: 22 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa1: 23 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa1: 24 00ab9040 4  0  Mic           Jack  Combo   0x00       Pink    0
Sep  7 20:01:22 bn kernel: hdaa1: 25 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa1: 26 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa1: 27 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa1: 28 90a60100 0  0  Mic           Fixed Digital Internal   Unknown 1
Sep  7 20:01:22 bn kernel: hdaa1: 29 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa1: 30 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa1: 31 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa1: 32 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa1: 33 004be030 3  0  SPDIF-out     Jack  Combo   0x00       White   0
Sep  7 20:01:22 bn kernel: hdaa1: 34 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0
Sep  7 20:01:22 bn kernel: hdaa1: Patched pins configuration:
Sep  7 20:01:22 bn kernel: hdaa1: nid   0x    as seq device       conn  jack    loc        color   misc
Sep  7 20:01:22 bn kernel: hdaa1: 16 002b4020 2  0  Headphones    Jack  Combo   0x00       Green   0
Sep  7 20:01:22 bn kernel: hdaa1: 17 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep  7 20:01:22 bn kernel: hdaa1: 18 90100110 1  0  Speaker       Fixed Unknown Internal   Unknown 1
Sep  7 20:01:22 bn kernel: hdaa1: 19 90100112 1  2  Speaker       Fixed Unknown Internal   Unknown 1
Sep  7 20:01:22 bn kernel: hdaa1: 20 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep  7 20:01:22 bn kernel: hdaa1: 21 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep  7 20:01:22 bn kernel: hdaa1: 22 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep  7 20:01:22 bn kernel: hdaa1: 23 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep  7 20:01:22 bn kernel: hdaa1: 24 00ab9040 4  0  Mic           Jack  Combo   0x00       Pink    0
Sep  7 20:01:22 bn kernel: hdaa1: 25 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep  7 20:01:22 bn kernel: hdaa1: 26 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep  7 20:01:22 bn kernel: hdaa1: 27 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep  7 20:01:22 bn kernel: hdaa1: 28 90a60100 0  0  Mic           Fixed Digital Internal   Unknown 1 DISA
Sep  7 20:01:22 bn kernel: hdaa1: 29 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep  7 20:01:22 bn kernel: hdaa1: 30 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep  7 20:01:22 bn kernel: hdaa1: 31 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep  7 20:01:22 bn kernel: hdaa1: 32 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep  7 20:01:22 bn kernel: hdaa1: 33 004be030 3  0  SPDIF-out     Jack  Combo   0x00       White   0
Sep  7 20:01:22 bn kernel: hdaa1: 34 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep  7 20:01:22 bn kernel: hdaa1: 4 associations found:
Sep  7 20:01:22 bn kernel: hdaa1: Association 0 (1) out:
Sep  7 20:01:22 bn kernel: hdaa1:  Pin nid=18 seq=0
Sep  7 20:01:22 bn kernel: hdaa1:  Pin nid=19 seq=2
Sep  7 20:01:22 bn kernel: hdaa1: Association 1 (2) out:
Sep  7 20:01:22 bn kernel: hdaa1:  Pin nid=16 seq=0
Sep  7 20:01:22 bn kernel: hdaa1: Association 2 (3) out:
Sep  7 20:01:22 bn kernel: hdaa1:  Pin nid=33 seq=0
Sep  7 20:01:22 bn kernel: hdaa1: Association 3 (4) in:
Sep  7 20:01:22 bn kernel: hdaa1:  Pin nid=24 seq=0
Sep  7 20:01:22 bn kernel: hdaa1: Tracing association 0 (1)
Sep  7 20:01:22 bn kernel: hdaa1:  Pin 18 traced to DAC 3
Sep  7 20:01:22 bn kernel: hdaa1:  Pin 19 traced to DAC 4
Sep  7 20:01:22 bn kernel: hdaa1: Association 0 (1) trace succeeded
Sep  7 20:01:22 bn kernel: hdaa1: Tracing association 1 (2)
Sep  7 20:01:22 bn kernel: hdaa1:  Pin 16 traced to DAC 2
Sep  7 20:01:22 bn kernel: hdaa1: Association 1 (2) trace succeeded
Sep  7 20:01:22 bn kernel: hdaa1: Tracing association 2 (3)
Sep  7 20:01:22 bn kernel: hdaa1:  Pin 33 traced to DAC 14
Sep  7 20:01:22 bn kernel: hdaa1: Association 2 (3) trace succeeded
Sep  7 20:01:22 bn kernel: hdaa1: Tracing association 3 (4)
Sep  7 20:01:22 bn kernel: hdaa1:  Unable to trace pin 24 to ADC 6, undo traces
Sep  7 20:01:22 bn kernel: hdaa1:  Pin 24 traced to ADC 7
Sep  7 20:01:22 bn kernel: hdaa1: Association 3 (4) trace succeeded
Sep  7 20:01:22 bn kernel: hdaa1: Looking for additional DAC for association 0 (1)
Sep  7 20:01:22 bn kernel: hdaa1: Looking for additional DAC for association 1 (2)
Sep  7 20:01:22 bn kernel: hdaa1: Looking for additional DAC for association 2 (3)
Sep  7 20:01:22 bn kernel: hdaa1: Looking for additional ADC for association 3 (4)
Sep  7 20:01:22 bn kernel: hdaa1: Tracing input monitor
Sep  7 20:01:22 bn kernel: hdaa1: Tracing other input monitors
Sep  7 20:01:22 bn kernel: hdaa1:  Tracing nid 24 to out
Sep  7 20:01:22 bn kernel: hdaa1: Tracing beeper
Sep  7 20:01:22 bn kernel: hdaa1: FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivref
Sep  7 20:01:22 bn kernel: pcm3: <Cirrus Logic (0x4208) (Analog 4.0/2.0)> at nid 18,19 and 24 on hdaa1
Sep  7 20:01:22 bn kernel: pcm4: <Cirrus Logic (0x4208) (Analog Headphones)> at nid 16 on hdaa1
Sep  7 20:01:22 bn kernel: pcm5: <Cirrus Logic (0x4208) (Digital)> at nid 33 on hdaa1
Sep  7 20:01:22 bn kernel: random: harvesting attach, 8 bytes (4 bits) from hdaa1
Sep  7 20:01:22 bn kernel: random: harvesting attach, 8 bytes (4 bits) from hdacc1
```


----------



## shepper (Sep 8, 2016)

What you have looks good to me.  You may want to check your mixer(8) settings to make sure the speakers are not muted.  You may also want to try putting pin 16 (Headphones) into the same association as the speakers with a sequence of 15

```
hint.hdaa.1.cad0.nid16.config="as=1 seq=15"
```

Your setup is odd in that the headphones are usually a higher pin number than the speakers but I noted that your speakers have lower numbered pins as inputs (? preamp).


----------



## bcomputerguy (Sep 9, 2016)

shepper said:


> What you have looks good to me.  You may want to check your mixer(8) settings to make sure the speakers are not muted.  You may also want to try putting pin 16 (Headphones) into the same association as the speakers with a sequence of 15
> 
> ```
> hint.hdaa.1.cad0.nid16.config="as=1 seq=15"
> ...



I tried that but there's still no sound. This is craxy, it was working before I had to wipe my hdd now it's not.

Is there anything else that I can try to change? Also do I need to restart my machine after each change?


```
blubee@bn:~ % cat /dev/sndstat 
Installed devices:
pcm0: <NVIDIA (0x0042) (HDMI/DP 8ch)> (play)
pcm1: <NVIDIA (0x0042) (HDMI/DP 8ch)> (play)
pcm2: <NVIDIA (0x0042) (HDMI/DP 8ch)> (play)
pcm3: <Cirrus Logic (0x4208) (Analog 4.0/2.0)> (play/rec) default
pcm4: <Cirrus Logic (0x4208) (Analog Headphones)> (play)
pcm5: <Cirrus Logic (0x4208) (Digital)> (play)
No devices installed from userspace.
```


----------



## shepper (Sep 9, 2016)

bcomputerguy said:


> Also do I need to restart my machine after each change?



Unfortunately yes.  The reassignment of the pins only occurs during boot.

The only other thing I can recommend is to repost your /boot/device.hints, /etc/sysctl.conf, mixer (8)and the verbose dmesg that reflects the /boot/device.hints and /etc/sysctl.conf settings.  Sometimes a second set of eyes will pick up a minor syntax error.  Your initial logs showed 10.3 and the latest log 11.0.  There is also the distinct possibility that there may have been breakage in 11.0rc2


----------



## shepper (Sep 9, 2016)

One other thought - your prior post shows the headphones to be pcm4.


bcomputerguy said:


> pcm4: <Cirrus Logic (0x4208) (Analog Headphones)> (play)



If your main goal is headphone use, what happens with removing 

```
hint.hdaa.1.cad0.nid16.config="as=1 seq=15"
```
 and setting your default sound device to pcm4?


----------



## bcomputerguy (Sep 11, 2016)

shepper said:


> One other thought - your prior post shows the headphones to be pcm4.
> 
> 
> If your main goal is headphone use, what happens with removing
> ...



I actually sorted this out just now with the help of vlc. In vlc, you can choose which audio device to use and I was just clicking on the different pcm devices, 0-5 and on pcm4 I heard audio in my headphones, but what you said was 100% correct.

So now headphones work again and that's pretty good. What I would like to do though is sort out the audio interfaces/ gpio and configuration for the internal speakers.

I have been reading the snd_hda documentation but it's really confusing. For example let's say I create some associations between two devices, how do I even know if those devices are getting power is the gpio correctly configured? Is there any way that I can check? There are so many moving parts...

At least i learned about the FreeBSD mixer and now I know how to change volumes w/o any third party tools, I can actually bind the correct commands to my keyboard shortcuts which again xkb helped me understand, which seemed like black magic on linux because config files were thrown all over the place but on FreeBSD they are well organized and make sense.

shepper do you know anyone else with a lot of experience with configuring the snd_hda or if you can help me as I walk through this. I know this can be setup correctly, it just needs time and effort.


----------



## shepper (Sep 11, 2016)

bcomputerguy said:


> shepper do you know anyone else with a lot of experience with configuring the snd_hda or if you can help me as I walk through this. I know this can be setup correctly, it just needs time and effort.



The fly in the ointment is your MacBook Pro 11.3.  Manufacturer's have gone so far as to reverse jack sensing as set up by FreeBSD - plugging in the headphones shuts off the jack.  The general process is to

1)  Choose your desired configuration.  For example default to the onboard speakers, headphone mutes speakers and use the built-in mic for recording.
2)  Generate the default configuration and compare it to the configuration you desire.
3)  Configure the desired pcm in /etc/sysctl.conf and assign the pins in hints
4)  Test and review the new pin assignments.  I recommend doing this incrementally.  For instance, using pcm4 as default, does the verbose dmesg show any internal speakers in pcm4?  Can the speakers be moved to the same association as the headphones?

It is a tedious process that is most efficiently done by the individual sitting in front of the MacBook.


----------



## bcomputerguy (Sep 12, 2016)

shepper said:


> The fly in the ointment is your MacBook Pro 11.3.  Manufacturer's have gone so far as to reverse jack sensing as set up by FreeBSD - plugging in the headphones shuts off the jack.  The general process is to
> 
> 1)  Choose your desired configuration.  For example default to the onboard speakers, headphone mutes speakers and use the built-in mic for recording.
> 2)  Generate the default configuration and compare it to the configuration you desire.
> ...



I have no problem with the tedious process of getting this sorted out. It's just the fact that the docs are really hard to parse. If you or anyone else don't mind helping will work this out.

The headphones are working and here's the verbose log with headphones plugged in : http://paste2.org/k6mVv64L
The text file will be attached as well.

I saw a lot of GPIO pin states that said disabled..... 

I understand that the computer can detect when headphones are plugged in or not or even hdmi for that matter. On LInux The audio would play out of everything, headphones and speakers unless I turned down the headphones or internal speakers manually.

So is there a way that I can create a script file to say when a device is connected, what is it and get it's device info? That would be a great start.

After that I can create the proper audio setup configuration 1 for headphones, one for internal speakers one for hdmi, etc.... Then using the above script decide which configuration to load based on the state of the connected hardware.

So currently the headphones is pcm4, what would be the next steps in trying to configure the internal speakers only configuration?


----------



## shepper (Sep 12, 2016)

```
Sep 12 15:18:36 bn kernel: hdaa1: Patched pins configuration:
Sep 12 15:18:36 bn kernel: hdaa1: nid   0x    as seq device       conn  jack    loc        color   misc
Sep 12 15:18:36 bn kernel: hdaa1: 16 002b4020 2  0  Headphones    Jack  Combo   0x00       Green   0
Sep 12 15:18:36 bn kernel: hdaa1: 17 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep 12 15:18:36 bn kernel: hdaa1: 18 90100110 1  0  Speaker       Fixed Unknown Internal   Unknown 1
Sep 12 15:18:36 bn kernel: hdaa1: 19 90100112 1  2  Speaker       Fixed Unknown Internal   Unknown 1
Sep 12 15:18:36 bn kernel: hdaa1: 20 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep 12 15:18:36 bn kernel: hdaa1: 21 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep 12 15:18:36 bn kernel: hdaa1: 22 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep 12 15:18:36 bn kernel: hdaa1: 23 400000f0 15 0  Line-out      None  Unknown 0x00       Unknown 0 DISA
Sep 12 15:18:36 bn kernel: hdaa1: 24 00ab9040 4  0  Mic           Jack  Combo   0x00       Pink    0

*******
clip
*******
Sep 12 15:18:36 bn kernel: pcm3: <Cirrus Logic (0x4208) (Analog 4.0/2.0)> at nid 18,19 and 24 on hdaa1
Sep 12 15:18:36 bn kernel: pcm3: Playback:
Sep 12 15:18:36 bn kernel: pcm3:      Stream cap: 0x00000003 FLOAT32 PCM
Sep 12 15:18:36 bn kernel: pcm3:         PCM cap: 0x001e07f0 16 20 24 32 bits, 32 44 48 88 96 176 192 KHz
Sep 12 15:18:36 bn kernel: pcm3:             DAC: 3 4
Sep 12 15:18:36 bn kernel: pcm3:
Sep 12 15:18:36 bn kernel: pcm3:     nid=18 [pin: Speaker (Fixed)]
Sep 12 15:18:36 bn kernel: pcm3:       + <- nid=3 [audio output] [src: pcm]
Sep 12 15:18:36 bn kernel: pcm3:
Sep 12 15:18:36 bn kernel: pcm3:     nid=19 [pin: Speaker (Fixed)]
Sep 12 15:18:36 bn kernel: pcm3:       + <- nid=4 [audio output] [src: pcm]
Sep 12 15:18:36 bn kernel: pcm3:
********
clip
********
Sep 12 15:18:36 bn kernel: pcm4: <Cirrus Logic (0x4208) (Analog Headphones)> at nid 16 on hdaa1
Sep 12 15:18:36 bn kernel: pcm4: Playback:
Sep 12 15:18:36 bn kernel: pcm4:      Stream cap: 0x00000003 FLOAT32 PCM
Sep 12 15:18:36 bn kernel: pcm4:         PCM cap: 0x001e07f0 16 20 24 32 bits, 32 44 48 88 96 176 192 KHz
Sep 12 15:18:36 bn kernel: pcm4:             DAC: 2
Sep 12 15:18:36 bn kernel: pcm4:
Sep 12 15:18:36 bn kernel: pcm4:     nid=16 [pin: Headphones (Green Jack)]
Sep 12 15:18:36 bn kernel: pcm4:       + <- nid=2 [audio output] [src: pcm]
Sep 12 15:18:36 bn kernel: pcm4:
Sep 12 15:18:36 bn kernel: pcm4: Master Volume (OSS: vol): -66/0dB
Sep 12 15:18:36 bn kernel: pcm4:    +- ctl  1 (nid   2 out):    -63/0dB (128 steps) + mute
Sep 12 15:18:36 bn kernel: pcm4:    +- ctl  9 (nid  16 in ):    -66/0dB (67 steps) + mute
Sep 12 15:18:36 bn kernel: pcm4:
Sep 12 15:18:36 bn kernel: pcm4: PCM Volume (OSS: pcm): -63/0dB
Sep 12 15:18:36 bn kernel: pcm4:    +- ctl  1 (nid   2 out):    -63/0dB (128 steps) + mute
Sep 12 15:18:36 bn kernel: pcm4:    +- ctl  9 (nid  16 in ):    -66/0dB (67 steps) + mute
```
I am not sure how the DAC's interact with the pin assignments ie nid2 => nid16 (headphones), nid3->nid18(Speaker fixed) and nid4->nid19(another fixed speaker).
Can you try associating the speaker pins with the headphones.

```
hint.hdac.1.cad0.nid18.config="as=2 seq=0"
hint.hdac..cad0.nid19.config="as=2 seq=0"
```
Why you have 2 internal speakers, I do not know.  If the above does not work, I would try disabling one of the speaker pins by assigning as=0 to that pin.

The headphones will be odd.
snd_hda(4) states


> 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 association.


The headphones are the first pin in the association and theoretically will mute themselves.    It is possible to set a misc=0 for the headphones which would disable jack detection.  I would play with that option once the speakers work.


----------



## bcomputerguy (Sep 13, 2016)

shepper said:


> ```
> Sep 12 15:18:36 bn kernel: hdaa1: Patched pins configuration:
> Sep 12 15:18:36 bn kernel: hdaa1: nid   0x    as seq device       conn  jack    loc        color   misc
> Sep 12 15:18:36 bn kernel: hdaa1: 16 002b4020 2  0  Headphones    Jack  Combo   0x00       Green   0
> ...



I think it might show two internal speakers because there's one for the left and right speakers? At least that was my first though when I saw it.

But on another note yikes! 

I tried the new associations that you recommended but when the machine booted up there were no audio devices. I have no hardware devices listed at all.

in my 
	
	



```
/boot/devices.hints
```
 I made these edits


```
# hint.hdac.1.cad0.nid18.config="as=1 seq=0"
# hint.hdac.1.cad0.nid19.config="as=1 seq=2"

hint.hdac.1.cad0.nid18.config="as=2 seq=0"
hint.hdac.1.cad0.nid19.config="as=2 seq=0"
```

That didn't work at all.


----------



## shepper (Sep 13, 2016)

Edit:

I found this Alsa bug report on this Arch Linux MacBook Sound wiki.  Sound on MBP has been a challenge.
You may want to post to the FreeBSD multimedia list.
End Edit.
From snd_hda(4)
The section on "as"
"Association number.  Associations are used to group
                        individual pins to form a complex multi-pin device.
                        For example, 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."

The section on "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 association.

                        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 association, the association will provide
                        multichannel input.

For multichannel input/output associations sequence
                        numbers encode channel pairs positions: 0 - Front, 1 -
                        Center/LFE, 2 - Back, 3 - Front Wide Center, 4 - Side.
                        Standard combinations are: (0) - Stereo; (0, 2), (0,
                        4) - Quadro; (0, 1, 2), (0, 1, 4) - 5.1; (0, 1, 2, 4)
                        - 7.1."

If you have multichannel output associations you can either try disabling, 
	
	



```
as=0
```
 one of the pins (nid18 or nid19) and setting the remaining to stereo, 
	
	



```
seq=0
```
.  You can also trying changing the default 0,2 combination to a 0,4.  Given that your headphone jack is a "combo" and by default is disabled, I would give up on trying to put the headphones and speakers in the same association.  One last thought, are there any FreeBSD MacBook Pro howto's that reference a Cirrus Logic sound chip?  Perhaps Apple was consistent in how they wired the pins on that chip.


----------



## bcomputerguy (Sep 14, 2016)

shepper said:


> Edit:
> 
> I found this Alsa bug report on this Arch Linux MacBook Sound wiki.  Sound on MBP has been a challenge.
> You may want to post to the FreeBSD multimedia list.
> ...



I have been reading that snd_hda documentation but it's real dense. I can't visualize what's going on so i am lost.

Tell me if I have this mental model correct.

You have the GPIO pins that send power to the DAC and the DAC has the different ports that should connect to the headphones, internal speakers, mic, the GPU with it's hdmi port and it's audio devices as well? Something like this

seems like the forum software doesn't like blank spaces.

[GPIO] == [--------] >==------<[ left internal speaker ]
[GPIO] == [---D---] >-----=---<[ right internal speaker ]
[GPIO] == [---A---] >--------=<[ headphone jack  ]
[GPIO] == [---C---] >----------<[ to hdmi stuff ]
[GPIO] == [--------] >----------<[ more internal chips ]

sorry for the bad ascii art but i'm trying to use the '=' to show a connection between the GPIO pin the DAC and through to the headphones

the lines for the DAC should connect to the hardware?

So is that mental model correct? The device.hints hdac configurations that we are attempting to write is to basically create associations and link up the DAC to things like the internal speakers, mic, etc?

Is that what's going on?


----------



## shepper (Sep 14, 2016)

bcomputerguy said:


> [GPIO] == [--------] >==------<[ left internal speaker ]
> [GPIO] == [---D---] >-----=---<[ right internal speaker ]



I'm not sure about this part.  Dating myself, my father built Heathkits in the late 50's and the initial implementation of stereo was one channel on FM, the opposite channel on AM.   Multiplexing the channels did away with the need for 2 receivers.  So I do not understand why Apple would go back to the 50's and separate feeds for the R and L channels.  Is it possible that one of the channels is something like a subwoofer or rear output?  Your default pin configuration in FreeBSD is treating pin19 (seq=2) as "rear".


----------



## bcomputerguy (Sep 14, 2016)

shepper said:


> I'm not sure about this part.  Dating myself, my father built Heathkits in the late 50's and the initial implementation of stereo was one channel on FM, the opposite channel on AM.   Multiplexing the channels did away with the need for 2 receivers.  So I do not understand why Apple would go back to the 50's and separate feeds for the R and L channels.  Is it possible that one of the channels is something like a subwoofer or rear output?  Your default pin configuration in FreeBSD is treating pin19 (seq=2) as "rear".



Apple might do that just because it's Apple and their no 3.5mm or all their other antics but leaving that aside.

I did notice when I had an OS X partition that there was more bass in the speakers so that could be it. I honestly hate the way the audio sounded on these speakers when using linux.

A short aside, I also HATED the way the trackpad felt on linux, it felt totally unresponsive. Then on FreeBSD i noticed the trackpad is actually suppose to click. I think the linux drivers disabled the clicking action of the trackpad and only simulated it with touches, which felt really horrible. So much so that's why I went to i3 in the first place, I dreaded thinking of touching the trackpad.

Back to the audio issue, Apple could just have done something like that. That means this might not be so simple but I don't mind learning and figuring these things out. I feel like i could help myself and others in the future as well but most of all I'll be learning in a controlled environment, where i am sure that the system is sane and I can focus on the problem at hand and not some combination of the problem and the system.


----------



## bcomputerguy (Sep 15, 2016)

shepper my last comment was a bit off topic but I think I'll just send an email over to the mailing list to see if I can get some additional help sorting this out.


----------

