# Laptop sound to speakers but no to headphones



## joplass (May 22, 2020)

Before starting this thread, I read a lot of other threads  but most are for desktops.
Sounds works from speakers but no from headphones.  I have not played with "hints" and such, I will appreciate any help.

Thank you,


```
$ cat /dev/sndstat
Installed devices:
pcm0: <NVIDIA (0x0041) (HDMI/DP 8ch)> (play)
pcm1: <NVIDIA (0x0041) (HDMI/DP 8ch)> (play)
pcm2: <Realtek ALC292 (Analog 2.0+HP/2.0)> (play/rec) default
pcm3: <Realtek ALC292 (Analog)> (play/rec)
No devices installed from userspace.
```


```
root@luna:~ # sysctl -a | grep snd
device    snd_cmi
device    snd_csa
device    snd_emu10kx
device    snd_es137x
device    snd_hda
device    snd_ich
device    snd_via8233
hw.snd.maxautovchans: 16
hw.snd.default_unit: 2
hw.snd.version: 2009061500/amd64
hw.snd.default_auto: 0
hw.snd.verbose: 0
hw.snd.vpc_mixer_bypass: 1
hw.snd.feeder_rate_quality: 1
hw.snd.feeder_rate_round: 25
hw.snd.feeder_rate_max: 2016000
hw.snd.feeder_rate_min: 1
hw.snd.feeder_rate_polyphase_max: 183040
hw.snd.feeder_rate_presets: 100:8:0.85 100:36:0.92 100:164:0.97
hw.snd.feeder_eq_exact_rate: 0
hw.snd.feeder_eq_presets: PEQ:16000,0.2500,62,0.2500:-9,9,1.0:44100,48000,88200,96000,176400,192000
hw.snd.basename_clone: 1
hw.snd.compat_linux_mmap: 0
hw.snd.syncdelay: -1
hw.snd.usefrags: 0
hw.snd.vpc_reset: 0
hw.snd.vpc_0db: 45
hw.snd.vpc_autoreset: 1
hw.snd.timeout: 5
hw.snd.latency_profile: 1
hw.snd.latency: 2
hw.snd.report_soft_matrix: 1
hw.snd.report_soft_formats: 1
```


```
hdacc0: <NVIDIA (0x0041) HDA CODEC> at cad 0 on hdac0
hdaa0: <NVIDIA (0x0041) Audio Function Group> at nid 1 on hdacc0
pcm0: <NVIDIA (0x0041) (HDMI/DP 8ch)> at nid 5 on hdaa0
pcm1: <NVIDIA (0x0041) (HDMI/DP 8ch)> at nid 7 on hdaa0
hdacc1: <Realtek ALC292 HDA CODEC> at cad 0 on hdac1
hdaa1: <Realtek ALC292 Audio Function Group> at nid 1 on hdacc1
pcm2: <Realtek ALC292 (Analog 2.0+HP/2.0)> at nid 20,21 and 24,25 on hdaa1
pcm3: <Realtek ALC292 (Analog)> at nid 22 and 18 on hdaa1
```


----------



## chrbr (May 22, 2020)

Dear joplass,


joplass said:


> hw.snd.default_unit: 2


If I am not wrong this is the item to play with using `sysctl`.


----------



## joplass (May 22, 2020)

Hello chrbr,

By default sound comes from laptop speakers nd think it is
	
	



```
pcm2: <Realtek ALC292 (Analog 2.0+HP/2.0)> at nid 20,21 and 24,25 on hdaa1
```

So I did 
	
	



```
sysctl hw.snd.default_unit=3
```
 but nothing from the headphones.  Reading the forum, I am thinking it has to do with pins and I have no experience for that.  I am hoping someone can help me.

Thank you.


----------



## chrbr (May 22, 2020)

On my laptop where I use headphones from time to time there is only pcm0 and pcm1. The later one is for the headphones.


joplass said:


> pcm2: <Realtek ALC292 (Analog 2.0+HP/2.0)> at nid 20,21 and 24,25 on hdaa1


HP could stand for headphones. Then the default should be fine. Often the headphone sockets contain a small integrated switch to detect the presence of a headphone, this is true. I hope someone with a similar configuration can help you. Otherwise I would dig in mixer settings and so on. There are too many options. I wish you success!


----------



## Minbari (May 22, 2020)

What `sysctl -a | grep original` says?


----------



## joplass (May 22, 2020)

See below Minbari,


```
$ sysctl -a | grep original
dev.hdaa.1.nid30_original: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.1.nid29_original: 0x40700001 as=0 seq=1 device=Modem-handset conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
dev.hdaa.1.nid27_original: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.1.nid26_original: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.1.nid25_original: 0x01a1903e as=3 seq=14 device=Mic conn=Jack ctype=1/8 loc=Rear color=Pink misc=0
dev.hdaa.1.nid24_original: 0x02a19031 as=3 seq=1 device=Mic conn=Jack ctype=1/8 loc=Front color=Pink misc=0
dev.hdaa.1.nid22_original: 0x01014020 as=2 seq=0 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Green misc=0
dev.hdaa.1.nid21_original: 0x0221401f as=1 seq=15 device=Headphones conn=Jack ctype=1/8 loc=Front color=Green misc=0
dev.hdaa.1.nid20_original: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
dev.hdaa.1.nid19_original: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.1.nid18_original: 0x90a60140 as=4 seq=0 device=Mic conn=Fixed ctype=Digital loc=Internal color=Unknown misc=1
dev.hdaa.0.nid7_original: 0x185600f0 as=15 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid6_original: 0x585600f0 as=15 seq=0 device=Digital-out conn=None ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid5_original: 0x185600f0 as=15 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid4_original: 0x585600f0 as=15 seq=0 device=Digital-out conn=None ctype=Digital loc=0x18 color=Unknown misc=0
```


----------



## Minbari (May 22, 2020)

Add 
	
	



```
hint.hdaa.1.nid21.config="as=1 seq=15 device=Headphones conn=Jack"
```
 in /boot/device.hints
That should make your headphones to work.


----------



## joplass (May 22, 2020)

Sorry that did not work either.  Restarted the machine.  Is there some space somewhere? Just guessing.


----------



## Minbari (May 22, 2020)

joplass said:


> Sorry that did not work either.  Restarted the machine.  Is there some space somewhere? Just guessing.


There is no space. Try without conn=Jack in that line.


----------



## joplass (May 22, 2020)

I try that as well with no result.  Thanks for your patience.  Since HP appears on this line here 
	
	



```
pcm2: <Realtek ALC292 (Analog 2.0+HP/2.0)> at nid 20,21 and 24,25 on hdaa1
```
 no need to run 
	
	



```
sysctl hw.snd.default_unit=n
```
 correct?  Plugin the headphones should just switch sound from speakers to headphones.  Right now when I plug headphones sound stops from speakers but nothing goes to headphones.


----------



## joplass (May 23, 2020)

I have tried all variations from snd_hda(4) without success.  Hopefully someone will point me to the right direction.


----------



## Minbari (May 23, 2020)

You need to play with pins. See what dmesg says when you have the headphones plugged in.

`sysctl dev.hdac.0.pindump=1`
`dmesg | grep hdaa > sound_pins.txt`


----------



## joplass (May 23, 2020)

Dear Minbari,

Thanks for your help.  I hate to be annoying. While using those commands what should I look for and what would I have to modify or add to make the headphones work.

So far I got these returns.


```
root@luna:~ # sysctl dev.hdac.0.pindump=1
dev.hdac.0.pindump: 0 -> 0
root@luna:~ # dmesg | grep hdaa > sound_pins.txt
root@luna:~ #
```

As you can see 
	
	



```
dmesg | grep hdaa > sound_pins.txt
```
 did not provide an output.  This with headphones plugged in.


----------



## George (May 23, 2020)

Btw is your laptop in this list?  Laptops - FreeBSD Wiki wiki.freebsd.org › Laptop

Are your mixer pcm settings high enough?


----------



## joplass (May 23, 2020)

Yes, this is it Dell_Precision_M4800.  I returned an Asus gaming machine to buy this one because hardware on the Asus were too new for FreeBSD.  I really hope the sound works out of headphones as I don't want to go back to Linux Devuan.

Yes, volume mixer are high about 80 to 90% using dsbmixer.

So we get this out as well.  The machine came with a Windows 10 drive that I removed but prior to that I made certain that everything works including sound in and out.


----------



## Minbari (May 23, 2020)

joplass said:


> Dear Minbari,
> 
> Thanks for your help.  I hate to be annoying. While using those commands what should I look for and what would I have to modify or add to make the headphones work.


Running these commands should provide more information about sound "pins" when headphones are connected.


joplass said:


> As you can see
> 
> 
> 
> ...


The output of that command is in that file sound_pins.txt. Use a text editor (vi/vim/nano/ee, etc.) to see it and then post it on forum.


----------



## joplass (May 23, 2020)

wow pardon my ignorance


```
dmesg | grep hdaa > sound_pins.txt

as user
hdac0: <NVIDIA (0x0e0b) HDA Controller> mem 0xf5080000-0xf5083fff irq 17 at device 0.1 on pci1
hdac1: <Intel Lynx Point HDA Controller> mem 0xf7130000-0xf7133fff irq 22 at device 27.0 on pci0
hdacc0: <NVIDIA (0x0041) HDA CODEC> at cad 0 on hdac0
hdaa0: <NVIDIA (0x0041) Audio Function Group> at nid 1 on hdacc0
hdacc1: <Realtek ALC292 HDA CODEC> at cad 0 on hdac1
hdaa1: <Realtek ALC292 Audio Function Group> at nid 1 on hdacc1

as root
daa0: <NVIDIA (0x0041) Audio Function Group> at nid 1 on hdacc0
pcm0: <NVIDIA (0x0041) (HDMI/DP 8ch)> at nid 5 on hdaa0
pcm1: <NVIDIA (0x0041) (HDMI/DP 8ch)> at nid 7 on hdaa0
hdaa1: <Realtek ALC292 Audio Function Group> at nid 1 on hdacc1
pcm2: <Realtek ALC292 (Analog 2.0+HP/2.0)> at nid 20,21 and 24,25 on hdaa1
pcm3: <Realtek ALC292 (Analog)> at nid 22 and 18 on hdaa1
hdaa0: Dumping AFG pins:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0:  4 585600f0 15 0  Digital-out   None  Digital 0x18       Unknown 0 DISA
hdaa0:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa0:  5 185600f0 15 0  Digital-out   Jack  Digital 0x18       Unknown 0
hdaa0:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa0:  6 585600f0 15 0  Digital-out   None  Digital 0x18       Unknown 0 DISA
hdaa0:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa0:  7 185600f0 15 0  Digital-out   Jack  Digital 0x18       Unknown 0
hdaa0:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa0: NumGPIO=0 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=0
hdaa0: Dumping AFG pins:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0:  4 585600f0 15 0  Digital-out   None  Digital 0x18       Unknown 0 DISA
hdaa0:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa0:  5 185600f0 15 0  Digital-out   Jack  Digital 0x18       Unknown 0
hdaa0:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa0:  6 585600f0 15 0  Digital-out   None  Digital 0x18       Unknown 0 DISA
hdaa0:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa0:  7 185600f0 15 0  Digital-out   Jack  Digital 0x18       Unknown 0
hdaa0:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa0: NumGPIO=0 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=0
hdaa0: Dumping AFG pins:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0:  4 585600f0 15 0  Digital-out   None  Digital 0x18       Unknown 0 DISA
hdaa0:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa0:  5 185600f0 15 0  Digital-out   Jack  Digital 0x18       Unknown 0
hdaa0:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa0:  6 585600f0 15 0  Digital-out   None  Digital 0x18       Unknown 0 DISA
hdaa0:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa0:  7 185600f0 15 0  Digital-out   Jack  Digital 0x18       Unknown 0
hdaa0:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa0: NumGPIO=0 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=0
```


----------



## Minbari (May 23, 2020)

I don't know if the "no sound error"  it's from your sound card or if it's form headphones because it does not show them connected. Did you try to use other pair of headphones? One from a phone ar a music player. On my Thinkpad T430 I can see when headphones are connected.


```
hdaa0: <Realtek ALC269 Audio Function Group> at nid 1 on hdacc0
pcm0: <Realtek ALC269 (Analog 2.0+HP/2.0)> at nid 20,21 and 24 on hdaa0
pcm1: <Realtek ALC269 (Internal Analog Mic)> at nid 18 on hdaa0
hdaa1: <Intel Panther Point Audio Function Group> at nid 1 on hdacc1
pcm2: <Intel Panther Point (HDMI/DP 8ch)> at nid 5 on hdaa1
pcm3: <Intel Panther Point (HDMI/DP 8ch)> at nid 6 on hdaa1
pcm4: <Intel Panther Point (HDMI/DP 8ch)> at nid 7 on hdaa1
hdaa0: Dumping AFG pins:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0: 18 90a60140 4  0  Mic           Fixed Digital Internal   Unknown 1
hdaa0:     Caps: IN                 
hdaa0: 20 90170110 1  0  Speaker       Fixed Analog  Internal   Unknown 1
hdaa0:     Caps:    OUT    EAPD      Sense: 0x00000000 (disconnected)
*hdaa0: 21 0321101f 1  15 Headphones    Jack  1/8     Left       Black   0
hdaa0:     Caps:    OUT HP EAPD      Sense: 0x80000000 (connected)*
hdaa0: 23 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps:    OUT             
hdaa0: 24 03a11830 3  0  Mic           Jack  1/8     Left       Black   8
hdaa0:     Caps: IN OUT         VREF Sense: 0x00000000 (disconnected)
hdaa0: 25 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN OUT         VREF Sense: 0x00000000 (disconnected)
hdaa0: 26 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN OUT HP      VREF Sense: 0x00000000 (disconnected)
hdaa0: 27 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN OUT         VREF Sense: 0x00000000 (disconnected)
hdaa0: 30 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa0: NumGPIO=2 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
hdaa0:  GPIO0: disabled
hdaa0:  GPIO1: disabled
hdaa1: Dumping AFG pins:
hdaa1: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa1:  5 18560010 1  0  Digital-out   Jack  Digital 0x18       Unknown 0
hdaa1:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa1:  6 18560020 2  0  Digital-out   Jack  Digital 0x18       Unknown 0
hdaa1:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa1:  7 18560030 3  0  Digital-out   Jack  Digital 0x18       Unknown 0
hdaa1:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa1: NumGPIO=0 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=0
```


----------



## joplass (May 24, 2020)

I tried another pair of headphones but still did not produce an output like yours.

I am suspecting one thing tho, I could be wrong but maybe you can give me your opinion.  This installation was on a desktop.  I removed the SSD and put it on this laptop.  Do you think a brand new installation on this laptop could help?  I think it could.


----------



## Minbari (May 24, 2020)

joplass said:


> I tried another pair of headphones but still did not produce an output like yours.
> 
> I am suspecting one thing tho, I could be wrong but maybe you can give me your opinion.  This installation was on a desktop.  I removed the SSD and put it on this laptop.  Do you think a brand new installation on this laptop could help?  I think it could.


It shouldn't be that a problem because FreeBSD or GNU/Linux installs are not like M$ Windows which is bounded to the motherboard serial code. You can try another install, maybe I'm wrong; after all I'm not a FreeBSD guru, just a simple user.


----------



## joplass (May 25, 2020)

Minbari and all,

I re-installed FreeBSD and that did not change anything.  So I decided to install Devuan.  At first headphones did not work either so I was given a suggestion to use alsamixer and finally headphones came alive.  I intend to go back to FreeBSD and use alsamixer there or the equivalent.  This thread is good but I rather stick to FreeBSD original programs, I will fallback to alsamixer only if I must.

Thank you,


----------



## Minbari (May 25, 2020)

Alsamixer doesn't work on FreeBSD. The native FreeBSD mixer is called "mixer" and this one don't know how to "mute/unmute" sound channels like alsamixer. Even if he did, your headphones jack is not detected.


----------



## joplass (May 26, 2020)

Thank you, I was hopping you will come back and write something in those lines.  I will stick to Devuan for now I will probably try future FreeBSD releases.  

Really appreciate the help.


----------



## Minbari (May 26, 2020)

joplass said:


> Thank you, I was hopping you will come back and write something in those lines.  I will stick to Devuan for now I will probably try future FreeBSD releases.
> 
> Really appreciate the help.


I wish I could help you solve that problem, but I'm not a developer and most likely the sound driver needs a patch for that Dell Workstation. As for running FreeBSD in future on laptops I suggest to pick Thinkpads, they are gone have a very good support.


> The FreeBSD Foundation would like to ensure that running    FreeBSD on    contemporary hardware, including laptops, remains viable.    To that end    we plan to purchase the latest generation of one or more    of a family    of laptops preferred by members of the FreeBSD community,    evaluate the    existing state of hardware support, and implement missing    hardware    support where possible.
> As the first laptop for this project we have selected a    7th Generation   * Lenovo X1 Carbon*.
> This project was sponsored by The FreeBSD Foundation.


----------

