Solved how to enable headphone in freebsd14.1 ?

Dear all :
i have dell latitude 3520 laptop with a headphone interface , now i plug in my headphone to laptop and play music. no sound output in headphone ,,,,,,,,, the sound still always come out from internal analog speaker ....below is my info..
$ cat /dev/sndstat
Installed devices:
pcm0: <Realtek ALC236 (Internal Analog Speaker)> (play)
pcm1: <Realtek ALC236 (Front Analog Headphones)> (play) default
pcm2: <Intel Tiger Lake (HDMI/DP 8ch)> (play)
No devices installed from userspace.
$ mixer
pcm1:mixer: <Realtek ALC236 (Front Analog Headphones)> on hdaa0 (play) (default)
vol = 0.85:0.85 pbk
pcm = 1.00:1.00 pbk
ogain = 1.00:1.00 pbk

how to sure my headphone is connected to freebsd14.1 ?
please help me , what i need to do for playing sound in my headphone ? thanks.
 
I have thinkpad so dont know if it helps:
my /boot/loader.conf
Code:
snd_driver_load="YES"
/etc/rc.conf
Code:
sndiod_enable="YES"
dmesg | grep pcm
Code:
pcm0: Realtek ALC257 nid 33,20 on hdaa0
pcm1: intel kaby lake at nid 3 on hdaa1
/etc/sysctl.conf:
Code:
hw.snd.default_unit=0


Code bellow most likely will be part of your problem
/boot/device.hints:
Code:
hint.hdac.0.cad0.nid33.config="as=1 seq=0 device=speakers"
hint.hdac.0.cad0.nid20.config="as=1 seq=15 device=headphones"

Plus - i use pavucontrol if i need to check if i can get sound by going trough options etc.
 
I have thinkpad so dont know if it helps:
my /boot/loader.conf
Code:
snd_driver_load="YES"
/etc/rc.conf
Code:
sndiod_enable="YES"
dmesg | grep pcm
Code:
pcm0: Realtek ALC257 nid 33,20 on hdaa0
pcm1: intel kaby lake at nid 3 on hdaa1
/etc/sysctl.conf:
Code:
hw.snd.default_unit=0


Code bellow most likely will be part of your problem
/boot/device.hints:
Code:
hint.hdac.0.cad0.nid33.config="as=1 seq=0 device=speakers"
hint.hdac.0.cad0.nid20.config="as=1 seq=15 device=headphones"

Plus - i use pavucontrol if i need to check if i can get sound by going trough options etc.
Dear GlitchyDot:
thanks for your help .. i just modify /boot/device.hints file adding your code. now the headphone is working normal .thanks.
my sound devices looks like add new pcm0: <Realtek ALC236 (Analog 2.0+HP)> at nid 20,33 on hdaa0 .....

:~ $ mixer
pcm0:mixer: <Realtek ALC236 (Analog 2.0+HP)> on hdaa0 (play) (default)
vol = 0.52:0.52 pbk
pcm = 0.80:0.80 pbk
ogain = 1.00:1.00 pbk
:~ $ dmesg |grep pcm
pcm0: <Realtek ALC236 (Internal Analog Speaker)> at nid 20 on hdaa0
pcm1: <Realtek ALC236 (Front Analog Headphones)> at nid 33 on hdaa0
pcm2: <Intel Tiger Lake (HDMI/DP 8ch)> at nid 4 on hdaa1
pcm0: <Realtek ALC236 (Analog 2.0+HP)> at nid 20,33 on hdaa0
pcm1: <Intel Tiger Lake (HDMI/DP 8ch)> at nid 4 on hdaa1
game@fb14:~ $

thanks.
 
Dear Glitchdot :
what mean is below code ? can you show me ? i am new guy to study freebsd. thanks.
Code:
hint.hdac.0.cad0.nid33.config="as=1 seq=0 device=speakers"
hint.hdac.0.cad0.nid20.config="as=1 seq=15 device=headphones"
 
Im not realy sure exactly ... but i think it something to do with signaling and connectors etc.
Code:
 as          Association  number.  Associations are used to group in-
              dividual 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 dis-
              abled  pin.  A value of 15 is a set of independent unas-
              sociated 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 cre-
              ated for every pair of input and output associations.

         seq      Sequence number.    A unique, per-association number  used
              to  order     pins  inside the particular association.  Se-
              quence 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 asso-
              ciation.

              The sequence numbers 14 and 15 has a special meaning for
              input associations.  Their presence in  association  de-
              fines  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 num-
              bers encode channel pairs    positions: 0 - Front, 1    - Cen-
              ter/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.
Read this snd_hda manual , it explains what is what.
 
Dear Glitchdot :
what mean is below code ? can you show me ? i am new guy to study freebsd. thanks.
Code:
hint.hdac.0.cad0.nid33.config="as=1 seq=0 device=speakers"
hint.hdac.0.cad0.nid20.config="as=1 seq=15 device=headphones"

I have this (Dell Latitude 5591 with headphone/mic combo 3.5mm jack and ALC3246):

Code:
hint.hdac.0.cad0.nid20.config="as=1 seq=0"
hint.hdac.0.cad0.nid33.config="as=1 seq=15 device=Headphones"

This post helped me figure out what pin numbers to put where: https://forums.freebsd.org/threads/...evice-hints-for-headphones.74193/#post-456681

I'm not too sure what the ordering difference means or why I didn't need a 2nd device= name, but it works :p
 
I have this (Dell Latitude 5591 with headphone/mic combo 3.5mm jack and ALC3246):

Code:
hint.hdac.0.cad0.nid20.config="as=1 seq=0"
hint.hdac.0.cad0.nid33.config="as=1 seq=15 device=Headphones"

This post helped me figure out what pin numbers to put where: https://forums.freebsd.org/threads/...evice-hints-for-headphones.74193/#post-456681

I'm not too sure what the ordering difference means or why I didn't need a 2nd device= name, but it works :p
Dear Espionage724:
thanks. do know what is function about "/boot/device.hints" file ? when we will need to configure device.hints ? thanks.
 
This is explained here: https://docs.freebsd.org/en/books/handbook/multimedia/

It shows how the system maps hardware audio components to specific nodes (nids) on the codec and provides a way to configure these mappings. This is how to read this:

pcm0 is the main analog output associated with the Realtek ALC892 codec, connected to nodes nid 23 and nid 26 on the hdaa0 (the audio device driver). pcm1 is a secondary analog output, specifically for the right headphone jack, connected to nid 22 on the same hdaa0.

The device.hints file allows manual configuration of the audio device, specifying how certain nodes (nids) should behave.

hint.hdac.0.cad0.nid22.config="as=1 seq=15 device=Headphones"

You read this as "nid 22 is configured as an analog output for Headphones, as=1 assigns this node to association 1 (grouping it with other audio outputs). seq=15 defines the sequence priority for output. Lower numbers have higher priority; here, it indicates the headphones are secondary to speakers. This is what you want
 
This is explained here: https://docs.freebsd.org/en/books/handbook/multimedia/

It shows how the system maps hardware audio components to specific nodes (nids) on the codec and provides a way to configure these mappings. This is how to read this:

pcm0 is the main analog output associated with the Realtek ALC892 codec, connected to nodes nid 23 and nid 26 on the hdaa0 (the audio device driver). pcm1 is a secondary analog output, specifically for the right headphone jack, connected to nid 22 on the same hdaa0.

The device.hints file allows manual configuration of the audio device, specifying how certain nodes (nids) should behave.

hint.hdac.0.cad0.nid22.config="as=1 seq=15 device=Headphones"

You read this as "nid 22 is configured as an analog output for Headphones, as=1 assigns this node to association 1 (grouping it with other audio outputs). seq=15 defines the sequence priority for output. Lower numbers have higher priority; here, it indicates the headphones are secondary to speakers. This is what you want
DEar fr0xk:
your comment like god's voice save me from the question. thanks. it's very good .
 
Back
Top