# headphones no audio



## oscarandrea (Nov 20, 2016)

hi, i have a problem with freebsd, I can not hear sound from the headphones, the loudspeakers of my notebook (asus x55a) feels, but if I connect the headphones, and nothing changes in xfce4 plugin not the headphones item appears, time PC-BSD is installed it and it worked so I do not think it's a compatibility problem, thanks in advance





This is what appears when I inserted the headset


----------



## oscarandrea (Nov 22, 2016)

UP


----------



## shepper (Nov 22, 2016)

This can be complicated to answer.
Xfce4 uses gstreamer plugins and in NetBSD uses pulseaudio as a sound server.  In NetBSD you have to install the gstreamer pulseaudio plugin.  Not sure how the FreeBSD porters set this up.

I would start by just seeing if basic sound works from the command line.  Handbook section 7.2 goes into the basics but is a little dated.  You do not need to load the snd_hda module in FreeBSD 11.0 as it is statically built into the default kernel.

A simple way to generate test sound from the command line is to use audio/madplay and an *mp3 of your choice.


----------



## oscarandrea (Nov 23, 2016)

shepper said:


> This can be complicated to answer.
> Xfce4 uses gstreamer plugins and in NetBSD uses pulseaudio as a sound server.  In NetBSD you have to install the gstreamer pulseaudio plugin.  Not sure how the FreeBSD porters set this up.
> 
> I would start by just seeing if basic sound works from the command line.  Handbook section 7.2 goes into the basics but is a little dated.  You do not need to load the snd_hda module in FreeBSD 11.0 as it is statically built into the default kernel.
> ...


I changed de, now I have a window manager, dwm, still do not know how to configure the headset


----------



## shepper (Nov 23, 2016)

During boot, FreeBSD audio probes for the available input/output pins and groups into pcm* devices.  For a typical desktop, the rear panel jacks might be grouped into pcm0 while the front headphone/mic jacks would get grouped into pcm1. If your headphones are associated with pcm1, you can test by setting your default pcm to pcm1 Section 7.2 describes how to do this .

Most desktop user would like their front headphones to automatically mute the rear speaker jacks when plugged in. To do this you have to rearrange the pin associations as was done in this Thread 57969.

The reference for this is snd_hda(4).  Hopefully, the man pages are translated.  If you have problems post:
`# cat /dev/sndstat` and verbose dmesg content that list the pins for hdaa.
`# 
sysctl dev.hdac.0.pindump=1`
followed by
`# dmesg | grep hdaa > default_sound_gpio.txt`.


----------



## oscarandrea (Nov 25, 2016)

shepper said:


> During boot, FreeBSD audio probes for the available input/output pins and groups into pcm* devices.  For a typical desktop, the rear panel jacks might be grouped into pcm0 while the front headphone/mic jacks would get grouped into pcm1. If your headphones are associated with pcm1, you can test by setting your default pcm to pcm1 Section 7.2 describes how to do this .
> 
> Most desktop user would like their front headphones to automatically mute the rear speaker jacks when plugged in. To do this you have to rearrange the pin associations as was done in this Thread 57969.
> 
> ...


I'm not interested advanced configurations, interests me a command to use to assign the sound to the headphones

```
[oscar@oscar-freebsd ~]$ cat /dev/sndstat
Installed devices:
pcm0: <Realtek ALC269 (Internal Analog)> (play/rec) default
pcm1: <Realtek ALC269 (Left Analog)> (play/rec)
pcm2: <Intel Panther Point (HDMI/DP 8ch)> (play)
```


----------



## shepper (Nov 25, 2016)

In your present setup, FreeBSD grouped the audio gpio pins into 3 associations: pcm0 = Internal Analog, pcm1=Left Analog and pcm2=HDMI.  The HDMI grouping uses Intel Video.

The first question is if the grouping matches your physical layout:  Do you have jacks on the left side of what I assume is a laptop?

If there are left side audio jacks: do you get sound by changing the default sound device from pcm0 to pcm1.  This is done with the following command:
`# sysctl hw.snd.default_unit=1`


----------



## oscarandrea (Nov 26, 2016)

shepper said:


> In your present setup, FreeBSD grouped the audio gpio pins into 3 groups: pcm0 = Internal Analog, pcm1=Left Analog and pcm2=HDMI.  The HDMI grouping uses Intel Video.
> 
> The first question is if the grouping matches your physical layout:  Do you have jacks on the left side of what I assume is a laptop?
> 
> ...


out of curiosity I tried to download a song, and with mplayer / vlc works! so the problem is only on firefox!
is weird no?
thanks for the help


----------



## shepper (Nov 26, 2016)

oscarandrea said:


> the problem is only on firefox!



There are some posts in this forum about how to fix sound in firefox.  The "Search Forums" link at the top should bring them up.


----------



## tobik@ (Nov 26, 2016)

oscarandrea said:


> out of curiosity I tried to download a song, and with mplayer / vlc works! so the problem is only on firefox!


What does `pkg info firefox pulseaudio` say?


----------



## oscarandrea (Nov 26, 2016)

tobik said:


> What does `pkg info firefox pulseaudio` say?




```
[oscar@oscar-freebsd ~]$ pkg info firefox pulseaudio
firefox-50.0_1,1
pulseaudio-8.0_2
```
in fact xfce4 do not use it, but I have not been able to remove it, it may have some of its setting to create problems?


----------



## tobiam (Nov 27, 2016)

I am having a similar problem and also don't have audio on the headphones. The speakers work though. However I think I should have correct values, so I am unsure what to do. I am using FreeBSD 11.0 on amd64


```
mixer

Mixer vol      is currently set to 100:100
Mixer pcm      is currently set to 100:100
```



```
cat /dev/sndstat

Installed devices:
pcm0: <Realtek ALC269 (Analog 2.0+HP/2.0)> (play/rec)
pcm1: <Realtek ALC269 (Left Analog Mic)> (rec)
pcm2: <Intel Panther Point (HDMI/DP 8ch)> (play) default
No devices installed from userspace.
```


```
hdac0: <Intel Panther Point HDA Controller> mem 0xd3610000-0xd3613fff irq 22 at device 27.0 on pci0
hdacc0: <Realtek ALC269 HDA CODEC> at cad 0 on hdac0
hdaa0: <Realtek ALC269 Audio Function Group> at nid 1 on hdacc0
pcm0: <Realtek ALC269 (Analog 2.0+HP/2.0)> at nid 20,33 and 27 on hdaa0
pcm1: <Realtek ALC269 (Left Analog Mic)> at nid 24 on hdaa0
hdacc1: <Intel Panther Point HDA CODEC> at cad 3 on hdac0
hdaa1: <Intel Panther Point Audio Function Group> at nid 1 on hdacc1
pcm2: <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 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN              
hdaa0: 20 99130110 1  0  Speaker       Fixed ATAPI   Onboard    Unknown 1
hdaa0:     Caps:    OUT    EAPD      Sense: 0x00000000 (disconnected)
hdaa0: 23 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps:    OUT          
hdaa0: 24 03a19830 3  0  Mic           Jack  1/8     Left       Pink    8
hdaa0:     Caps: IN OUT         VREF Sense: 0x80000000 (connected)
hdaa0: 25 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN             VREF Sense: 0x00000000 (disconnected)
hdaa0: 26 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN OUT HP           Sense: 0x00000000 (disconnected)
hdaa0: 27 99a30920 2  0  Mic           Fixed ATAPI   Onboard    Unknown 9
hdaa0:     Caps: IN OUT              Sense: 0x00000000 (disconnected)
hdaa0: 30 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa0: 33 0321101f 1  15 Headphones    Jack  1/8     Left       Black   0
hdaa0:     Caps:    OUT HP           Sense: 0x80000000 (connected)
hdaa0: NumGPIO=2 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
hdaa0:  GPIO0: output state=1
hdaa0:  GPIO1: disabled
hdaa1: Dumping AFG pins:
hdaa1: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa1:  5 58560010 1  0  Digital-out   None  Digital 0x18       Unknown 0 DISA
hdaa1:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa1:  6 58560020 2  0  Digital-out   None  Digital 0x18       Unknown 0 DISA
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
hdaa0: Dumping AFG pins:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0: 18 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN              
hdaa0: 20 99130110 1  0  Speaker       Fixed ATAPI   Onboard    Unknown 1
hdaa0:     Caps:    OUT    EAPD      Sense: 0x00000000 (disconnected)
hdaa0: 23 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps:    OUT          
hdaa0: 24 03a19830 3  0  Mic           Jack  1/8     Left       Pink    8
hdaa0:     Caps: IN OUT         VREF Sense: 0x80000000 (connected)
hdaa0: 25 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN             VREF Sense: 0x00000000 (disconnected)
hdaa0: 26 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN OUT HP           Sense: 0x00000000 (disconnected)
hdaa0: 27 99a30920 2  0  Mic           Fixed ATAPI   Onboard    Unknown 9
hdaa0:     Caps: IN OUT              Sense: 0x00000000 (disconnected)
hdaa0: 30 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa0: 33 0321101f 1  15 Headphones    Jack  1/8     Left       Black   0
hdaa0:     Caps:    OUT HP           Sense: 0x80000000 (connected)
hdaa0: NumGPIO=2 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
hdaa0:  GPIO0: output state=1
hdaa0:  GPIO1: disabled
hdaa1: Dumping AFG pins:
hdaa1: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa1:  5 58560010 1  0  Digital-out   None  Digital 0x18       Unknown 0 DISA
hdaa1:     Caps:    OUT              Sense: 0x00000000 (disconnected)
hdaa1:  6 58560020 2  0  Digital-out   None  Digital 0x18       Unknown 0 DISA
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
hdac0: <Intel Panther Point HDA Controller> mem 0xd3610000-0xd3613fff irq 22 at device 27.0 on pci0
hdacc0: <Realtek ALC269 HDA CODEC> at cad 0 on hdac0
hdaa0: <Realtek ALC269 Audio Function Group> at nid 1 on hdacc0
pcm0: <Realtek ALC269 (Analog 2.0+HP/2.0)> at nid 20,33 and 27 on hdaa0
pcm1: <Realtek ALC269 (Left Analog Mic)> at nid 24 on hdaa0
hdacc1: <Intel Panther Point HDA CODEC> at cad 3 on hdac0
hdaa1: <Intel Panther Point Audio Function Group> at nid 1 on hdacc1
pcm2: <Intel Panther Point (HDMI/DP 8ch)> at nid 7 on hdaa1
```


----------



## shepper (Nov 27, 2016)

pcm0 has nid 20 as a fixed, onboard speaker with jack sensing from the headphones muting it.  nid 20 is in association (as) 1 with seq = 0:

```
hdaa0: 20 99130110 1  0  Speaker       Fixed ATAPI   Onboard    Unknown 1
hdaa0:     Caps:    OUT    EAPD      Sense: 0x00000000 (disconnected)
```

nid 33 is also in pcm0 and in the same output association (1) as nid 20 with a seq=15.  It should be wired to the HP jack.

```
hdaa0: 33 0321101f 1  15 Headphones    Jack  1/8     Left       Black   0
hdaa0:     Caps:    OUT HP           Sense: 0x80000000 (connected)
```

Both the headphone and mic jacks are described as "black" so you are using the newer 4 pin jacks.  Older setups, like mine, has separate mic (pink) and headphone (green) jacks.  If you are using older 3 pin headphones they will not work with the newer 4 pin jacks.

If you generated the above verbose dmesg with the headphones plugged in it correctly shows the headphone plugged in.

If you are using the newer Headphones, I wonder if it is possible for nids 27 and 30 to be misconfigured since they share the same jack  If that is the case you could try swapping the settings for those 2 nids.


----------



## tobik@ (Nov 27, 2016)

oscarandrea said:


> ```
> [oscar@oscar-freebsd ~]$ pkg info firefox pulseaudio
> firefox-50.0_1,1
> pulseaudio-8.0_2
> ...


Yes, could be. Firefox has enabled PulseAudio by default. If audio doesn't work in Firefox then PulseAudio is probably misconfigured or not running. Firefox will not start the daemon automatically anymore AFAICT and the ALSA output never worked for me. If you try playing e.g. a YouTube video in Firefox, is PulseAudio running (`pgrep pulseaudio`)?

If not does it work if you run `pulseaudio --start` first?


----------



## tobiam (Nov 27, 2016)

Thanks for you response,

yes the connection/disconnection is sensed correctly.



shepper said:


> If you are using the newer Headphones, I wonder if it is possible for nids 27 and 30 to be misconfigured since they share the same jack  If that is the case you could try swapping the settings for those 2 nids.


 
I am not sure how what you mean here. I don't think I understand what you wanna swap or the rationale behind it. Do you mean completely swapping the settings between 27 and 30?

Like so?

```
hint.hdac.0.cad0.nid27.config="as=15 seq=0 device=Speaker"
hint.hdac.0.cad0.nid30.config="as=0 seq=15 device=Mic"
```
Because then I am out of luck.

I think you could have meant also meant swapping them with what currently is "as" 1. I am not sure about the rationale and I am pretty sure I am missing something here - especially because of the 27 being the mic. I read snd_hda(4). To explain what I don't really understand about that: Since the mic is sensed correctly and the as is the same "as" as the working speaker output isn't that what I want?

But then of course I don't know where nid 27 and 30 really belong to.

I'll play more with, trying to get a better understanding.

Or did you mean adding them to the same as?
`hint.hdac.0.cad0.nid27.config="as=2"
hint.hdac.0.cad0.nid30.config="as=1"`

That also didn't help.


----------



## oscarandrea (Nov 27, 2016)

I had some problems with firefox because I updated the ports, though now I reinstalled firefox, I installed pavucontrol and sound pulse, I tried to put `sysctl hw.snd.default_unit = 1`
and even offline (with VLC / mplayer) works this time, I wonder if maybe I'm wrong, because of GNU / Linux I used the default ALSA always and never had any problems, what is the software to the default audio control for freebsd? to be honest I'm not understanding much, read OSS audio pulse, alsa etc. If my sound card is supported do I need to have a working default configuration? They do not care advanced options, only be able to use speakers and headphones Notebook. Thanks


----------



## shepper (Nov 27, 2016)

An as=15 disables the device.  What I was suggesting was putting nid27 in as=1, seq=15 and device=headphone.   For testing you could disable nid30 by giving it as=15.

One point of confusion is that you have two "mics".  Many laptop have a builtin mic at the top of the monitor bezel - usually a little hole next to the webcam.  In your default setup nid24 is as=3 and nid27 is in as=2.  I have always wondered if one could combine two different mics into the same as and multiplex the recording for stereo?


----------



## tobiam (Nov 27, 2016)

Thanks for your response.

No, this didn't solve the issue. I don't have output on neither the headphones nor the speakers after changing this.


----------



## shepper (Nov 27, 2016)

I'm making suggestions based on the initial verbose dmesg where nid20 is the fixed onboard speakers.  The device hints I suggested should not have altered that pin assignment.  With your device hints in place, you can regenerate a verbose dmesg to see what happened to nid20.  On my amd64 system dmesg concatenates so you will want to be sure you are looking at the latest output.


----------



## tobiam (Nov 28, 2016)

Starting from blank (original device.hints), after adding:

```
hint.hdac.0.cad0.nid27.config="as=1 seq=15 device=Headphones"
hint.hdac.0.cad0.nid30.config="as=15"
```
20, 27 and 33 all switch to DISA.

nid27 changes accordingly:

```
hdaa0: 27 9923091f 1  15 Headphones    Fixed ATAPI   Onboard    Unknown 9 DISA
```
nid30  already was on as 15, so doesn't change

There is no other change.


----------



## shepper (Nov 28, 2016)

One question is if your headphones are really plugged in on both dmesg outputs?
In the above, nid33 shows the headphones as "connected" which will "disconnect" the lowest nid in that association = nid20.  I recall reading some FreeBSD mailings that some brands "invert" jack sensing ie the jack says connected when nothing is plugged in.  There is a way to invert jack sensing in the snd_hda man page.  Perhaps remove the above device.hints and just make an entry to invert the jack sensing for nid33?

If the headphone jack sensing is correct, I would try either disabling nid33 rather than having it configured as a 2nd Headphone or changing it to a mic input.


----------



## tobiam (Nov 28, 2016)

Yes, the headphones are really plugged in. Disconnecting it will switch it to disconnected, so the sensing really works correctly. I only have the headphones plugged in, not the mic. I have it that way to see which one is the one I want. And so I can make sure it works, when it does. I also kept and will keep it that way, unless I state otherwise for pindumps (not for testing around in between of course), so it won't get confusing.

Disabling (setting as=0) nid33 brings back the sound, even when the headphones are connected.

In the original configuration, without any hints added the speakers work, but when I put in the headphones they stop, which is expected. Just the headphones don't work.
With 27 and 30 changed (as in the right side of the diff) they turn to DISA, neither works anymore.
Setting nid33 to disabled (as=0) now makes it so that even with the headphones plugged in the speakers keep working.
The only thing that bothers me is that the headphones never output any sound. It's not a physical problem On the same machine I also have a Linux installation.

I am not exactly sure how to map it, but this is what a working configuration looks under Linux, if it helps:


```
Codec: Realtek ALC271X
Address: 0
AFG Function Id: 0x1 (unsol 1)
Vendor Id: 0x10ec0269
Subsystem Id: 0x10250686
Revision Id: 0x100100
No Modem Function Group found
Default PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
State of AFG node 0x01:
  Power states:  D0 D1 D2 D3 CLKSTOP EPSS
  Power: setting=D0, actual=D0
GPIO: io=2, o=0, i=0, unsolicited=1, wake=0
  IO[0]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[1]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
Node 0x02 [Audio Output] wcaps 0x1d: Stereo Amp-Out
  Control: name="Headphone Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Device: name="ALC271X Analog", type="Audio", device=0
  Amp-Out caps: ofs=0x57, nsteps=0x57, stepsize=0x02, mute=0
  Amp-Out vals:  [0x41 0x41]
  Converter: stream=5, channel=0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
Node 0x03 [Audio Output] wcaps 0x1d: Stereo Amp-Out
  Control: name="Speaker Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-Out caps: ofs=0x57, nsteps=0x57, stepsize=0x02, mute=0
  Amp-Out vals:  [0x00 0x00]
  Converter: stream=5, channel=0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
Node 0x04 [Vendor Defined Widget] wcaps 0xf00000: Mono
Node 0x05 [Vendor Defined Widget] wcaps 0xf00000: Mono
Node 0x06 [Audio Output] wcaps 0x211: Stereo Digital
  Converter: stream=0, channel=0
  Digital:
  Digital category: 0x0
  IEC Coding Type: 0x0
  PCM:
    rates [0x5e0]: 44100 48000 88200 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
Node 0x07 [Vendor Defined Widget] wcaps 0xf00000: Mono
Node 0x08 [Audio Input] wcaps 0x10011b: Stereo Amp-In
  Control: name="Capture Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Control: name="Capture Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Device: name="ALC271X Analog", type="Audio", device=0
  Amp-In caps: ofs=0x0b, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-In vals:  [0x1f 0x1f]
  Converter: stream=1, channel=0
  SDI-Select: 0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
  Connection: 1
     0x23
Node 0x09 [Audio Input] wcaps 0x10011b: Stereo Amp-In
  Amp-In caps: ofs=0x0b, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-In vals:  [0x8b 0x8b]
  Converter: stream=0, channel=0
  SDI-Select: 0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
  Connection: 1
     0x22
Node 0x0a [Vendor Defined Widget] wcaps 0xf00000: Mono
Node 0x0b [Audio Mixer] wcaps 0x20010b: Stereo Amp-In
  Control: name="Internal Mic Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=3, ofs=0
  Control: name="Internal Mic Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=3, ofs=0
  Control: name="Mic Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Control: name="Mic Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Control: name="Beep Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=4, ofs=0
  Control: name="Beep Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=4, ofs=0
  Amp-In caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-In vals:  [0x1f 0x1f] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80]
  Connection: 5
     0x18 0x19 0x1a 0x1b 0x1d
Node 0x0c [Audio Mixer] wcaps 0x20010b: Stereo Amp-In
  Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-In vals:  [0x00 0x00] [0x00 0x00]
  Connection: 2
     0x02 0x0b
Node 0x0d [Audio Mixer] wcaps 0x20010b: Stereo Amp-In
  Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-In vals:  [0x00 0x00] [0x00 0x00]
  Connection: 2
     0x03 0x0b
Node 0x0e [Vendor Defined Widget] wcaps 0xf00000: Mono
Node 0x0f [Audio Mixer] wcaps 0x20010a: Mono Amp-In
  Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-In vals:  [0x00] [0x80]
  Connection: 2
     0x02 0x0b
Node 0x10 [Vendor Defined Widget] wcaps 0xf00000: Mono
Node 0x11 [Vendor Defined Widget] wcaps 0xf00000: Mono
Node 0x12 [Pin Complex] wcaps 0x40000b: Stereo Amp-In
  Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x2f, mute=0
  Amp-In vals:  [0x00 0x00]
  Pincap 0x00000020: IN
  Pin Default 0x411111f0: [N/A] Speaker at Ext Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0xf, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x00:
Node 0x13 [Vendor Defined Widget] wcaps 0xf00000: Mono
Node 0x14 [Pin Complex] wcaps 0x40018d: Stereo Amp-Out
  Control: name="Speaker Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x80 0x80]
  Pincap 0x00010014: OUT EAPD Detect
  EAPD 0x2: EAPD
  Pin Default 0x99130110: [Fixed] Speaker at Int ATAPI
    Conn = ATAPI, Color = Unknown
    DefAssociation = 0x1, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x00:
  Unsolicited: tag=00, enabled=0
  Connection: 2
     0x0c 0x0d*
Node 0x15 [Vendor Defined Widget] wcaps 0xf00000: Mono
Node 0x16 [Vendor Defined Widget] wcaps 0xf00000: Mono
Node 0x17 [Pin Complex] wcaps 0x40010c: Mono Amp-Out
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x80]
  Pincap 0x00000010: OUT
  Pin Default 0x411111f0: [N/A] Speaker at Ext Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0xf, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x00:
  Connection: 1
     0x0f
Node 0x18 [Pin Complex] wcaps 0x40018f: Stereo Amp-In Amp-Out
  Control: name="Mic Boost Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x2f, mute=0
  Amp-In vals:  [0x00 0x00]
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x80 0x80]
  Pincap 0x00001734: IN OUT Detect
    Vref caps: HIZ 50 GRD 80
  Pin Default 0x03a19830: [Jack] Mic at Ext Left
    Conn = 1/8, Color = Pink
    DefAssociation = 0x3, Sequence = 0x0
  Pin-ctls: 0x24: IN VREF_80
  Unsolicited: tag=02, enabled=1
  Connection: 1
     0x0d
Node 0x19 [Pin Complex] wcaps 0x40008b: Stereo Amp-In
  Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x2f, mute=0
  Amp-In vals:  [0x00 0x00]
  Pincap 0x00001724: IN Detect
    Vref caps: HIZ 50 GRD 80
  Pin Default 0x411111f0: [N/A] Speaker at Ext Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0xf, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x20: IN VREF_HIZ
  Unsolicited: tag=00, enabled=0
Node 0x1a [Pin Complex] wcaps 0x40018f: Stereo Amp-In Amp-Out
  Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x2f, mute=0
  Amp-In vals:  [0x00 0x00]
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x80 0x80]
  Pincap 0x0000003c: IN OUT HP Detect
  Pin Default 0x411111f0: [N/A] Speaker at Ext Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0xf, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x20: IN
  Unsolicited: tag=00, enabled=0
  Connection: 2
     0x0c* 0x0d
Node 0x1b [Pin Complex] wcaps 0x40018f: Stereo Amp-In Amp-Out
  Control: name="Internal Mic Boost Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x2f, mute=0
  Amp-In vals:  [0x00 0x00]
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x80 0x80]
  Pincap 0x00000034: IN OUT Detect
  Pin Default 0x99a30920: [Fixed] Mic at Int ATAPI
    Conn = ATAPI, Color = Unknown
    DefAssociation = 0x2, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x20: IN
  Unsolicited: tag=00, enabled=0
  Connection: 2
     0x0c* 0x0d
Node 0x1c [Vendor Defined Widget] wcaps 0xf00000: Mono
Node 0x1d [Pin Complex] wcaps 0x400000: Mono
  Pincap 0x00000020: IN
  Pin Default 0x4017992d: [N/A] Speaker at Ext N/A
    Conn = Analog, Color = Pink
    DefAssociation = 0x2, Sequence = 0xd
    Misc = NO_PRESENCE
  Pin-ctls: 0x20: IN
Node 0x1e [Pin Complex] wcaps 0x400381: Stereo Digital
  Pincap 0x00000014: OUT Detect
  Pin Default 0x411111f0: [N/A] Speaker at Ext Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0xf, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x40: OUT
  Unsolicited: tag=00, enabled=0
  Connection: 1
     0x06
Node 0x1f [Vendor Defined Widget] wcaps 0xf00000: Mono
Node 0x20 [Vendor Defined Widget] wcaps 0xf00040: Mono
  Processing caps: benign=0, ncoeff=25
Node 0x21 [Pin Complex] wcaps 0x40018d: Stereo Amp-Out
  Control: name="Headphone Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x00 0x00]
  Pincap 0x0000001c: OUT HP Detect
  Pin Default 0x0321101f: [Jack] HP Out at Ext Left
    Conn = 1/8, Color = Black
    DefAssociation = 0x1, Sequence = 0xf
  Pin-ctls: 0xc0: OUT HP
  Unsolicited: tag=01, enabled=1
  Connection: 2
     0x0c* 0x0d
Node 0x22 [Audio Selector] wcaps 0x30010b: Stereo Amp-In
  Amp-In caps: N/A
  Amp-In vals:  [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00]
  Connection: 7
     0x18* 0x19 0x1a 0x1b 0x1d 0x0b 0x12
Node 0x23 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In
  Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-In vals:  [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x00 0x00] [0x80 0x80] [0x80 0x80]
  Connection: 6
     0x18 0x19 0x1a 0x1b 0x1d 0x0b
```


----------



## oscarandrea (Nov 28, 2016)

kindly you might even help me with my problem? unfortunately now it does not work either with VLC audio


----------



## shepper (Nov 28, 2016)

tobiam said:


> Node 0x02 [Audio Output] wcaps 0x1d: Stereo Amp-Out Control: name="Headphone Playback Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Device: name="ALC271X Analog", type="Audio", device=0 Amp-Out caps: ofs=0x57, nsteps=0x57, stepsize=0x02, mute=0 Amp-Out vals: [0x41 0x41] Converter: stream=5, channel=0 PCM:



I was interested in the "switches" in the ALSA output and  did a search for ALC271X.  If found this at kernel.org:


> ALC22x/23x/25x/269/27x/28x/29x (and vendor-specific ALC3xxx models)
> ======
> laptop-amic        Laptops with analog-mic input
> laptop-dmic        Laptops with digital-mic input
> ...



I might help to search for FreeBSD sound on your particular make/model of laptop.  If you come up empty I would look at the bug reporting guidelines at FreeBSD Sound wiki - they are at the bottom of the page

oscarandrea  - Didn't mean to hijack your thread - I was hoping that some of tobiam posts would help you sort through your problem.  Can you state where you are at?  I'm assuming Basic sound works because VLC worked and the issue is Firefox/PulseAudio.  Note that if you use pulse audio you have to tell your other applications to also use pulseaudio.


----------



## tobiam (Nov 28, 2016)

Sorry, also didn't want to hijack your thread. I just thought we had a similar problem and therefor didn't want to start another thread.

My Laptop is an Acer Aspire V3-771.

Sadly I can't find much looking for it. I think Acers aren't particularly common among FreeBSD users.

Bug reported: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214920


----------



## tobiam (Dec 18, 2016)

I am really rather confused. After a while I booted into this system again (haven't booted it since). I upgraded (freebsd-update and pkg upgrade) and it suddenly works. I'd guess it's the packages (see upgrade log below), but then it shouldn't affect a test like 'cat /dev/random > /dev/dsp', should it?

I see alsa-plugins, but I am not sure whether or not these affect the dsp device on FreeBSD.

The pinout didn't change from the original, no device hints are active. Everything is back to default.


```
pkg upgraded: 1.9.3 -> 1.9.4
gettext-runtime upgraded: 0.19.8.1 -> 0.19.8.1_1
expat upgraded: 2.2.0 -> 2.2.0_1
xcb-util upgraded: 0.4.0_1,1 -> 0.4.0_2,1
pcre upgraded: 8.39 -> 8.39_1
libiconv upgraded: 1.14_9 -> 1.14_10
icu upgraded: 58.1,1 -> 58.2,1
dbus upgraded: 1.8.20 -> 1.10.12
tiff upgraded: 4.0.7 -> 4.0.7_1
harfbuzz upgraded: 1.3.3_1 -> 1.3.4
gnutls upgraded: 3.4.16 -> 3.4.17
py27-setuptools27 upgraded: 28.1.0 -> 28.8.0
libxslt upgraded: 1.1.29 -> 1.1.29_1
libogg upgraded: 1.3.2_1,4 -> 1.3.2_2,4
libIDL upgraded: 0.8.14_2 -> 0.8.14_3
libvorbis upgraded: 1.3.5,3 -> 1.3.5_1,3
argyllcms upgraded: 1.7.0_2 -> 1.9.2
ORBit2 upgraded: 2.14.19_1 -> 2.14.19_2
libx264 upgraded: 0.148.2708_1 -> 0.148.2708_2
libtheora upgraded: 1.1.1_6 -> 1.1.1_7
colord upgraded: 1.2.11_1 -> 1.2.12
policykit-gnome upgraded: 0.9.2_7 -> 0.9.2_8
nss upgraded: 3.27.1_1 -> 3.27.2
libopenraw upgraded: 0.0.9_4 -> 0.1.0
libnotify upgraded: 0.7.6_1 -> 0.7.6_2
hunspell upgraded: 1.3.3 -> 1.5.4
ffmpeg upgraded: 2.8.8_8,1 -> 3.2.2_1,1
desktop-file-utils upgraded: 0.22_3 -> 0.22_4
alsa-plugins upgraded: 1.1.1 -> 1.1.1_1
zsh upgraded: 5.2_4 -> 5.3
xwininfo upgraded: 1.1.3_1 -> 1.1.3_2
xfce4-tumbler upgraded: 0.1.31_3 -> 0.1.31_4
xclock upgraded: 1.0.7_1 -> 1.0.7_2
vim-lite upgraded: 8.0.0094 -> 8.0.0130
unique upgraded: 1.1.6_6 -> 1.1.6_7
telepathy-glib upgraded: 0.24.1 -> 0.24.1_1
popt upgraded: 1.16_1 -> 1.16_2
p7zip upgraded: 15.14_1 -> 16.02
libwnck upgraded: 2.30.7 -> 2.30.7_1
libssh2 upgraded: 1.7.0,2 -> 1.8.0,2
libslang2 upgraded: 2.3.0 -> 2.3.1
libmng upgraded: 1.0.10_2 -> 1.0.10_3
gtksourceview2 upgraded: 2.10.5_4 -> 2.10.5_5
gstreamer-plugins-good upgraded: 0.10.31_2,3 -> 0.10.31_3,3
gnome-mount upgraded: 0.8_12 -> 0.8_13
gegl upgraded: 0.2.0_16 -> 0.2.0_19
firefox upgraded: 50.0.1,1 -> 50.1.0_4,1
enchant upgraded: 1.6.0_5 -> 1.6.0_6
curl upgraded: 7.51.0_1 -> 7.51.0_3
```


----------



## sakhmatd (Jan 6, 2017)

I speculate gstreamer may have something to do with it although I really do not know how.

We have the exact same model laptop and this issue has been eating me for the entire day. I had latest 11.0 update and all packages were up to date. I looked through your packages, installed gstreamer with plugins and suddenly it all worked.


----------



## tobiam (Jan 21, 2017)

Something that is strange, even though I haven't seen a pattern yet is that it might be related to reboots, also of the Linux based OS. Do you also dual boot? I can't seem to reproduce it, but sounds keeps working if it does when I don't reboot into the other OS.

I hope this question doesn't seem too odd, but could it be that there is some state stored inside the audio chip? Like something that is meant to be configured by a driver? Of course that seems a bit like pulling ideas out of thin air, but I fail to explain it really, as I didn't change any configuration ever since the tests I made and today was the first time I had this appear again after rebooting from the Linux system.

Very odd behavior.

The only other explanation I'd have is a race condition of some sort.

The pinout btw. looks the same and always remains the original.

EDIT: I don't think it's gstreamer, because that shozldn't affect piping to /dev/dsp*
EDIT2: Also did sound work without gstreamer, when you didn't have headphones plugged in?
EDIT3: There appears to be some kind of state. On some tests I noticed that both on Linux and BSD there are differences after bootup from a completely halted system vs reboot for example (Linux never loses output completely, but for example without any changes has a rustling, from boot onwards). So looks like power affects it. That would explain the "suddenly working" part despite any changes. Do you see that too sakhmatd? Maybe some driver problem?
We don't seem to be the only ones having problems with that: https://forums.freebsd.org/threads/50381/
EDIT4: Could this be related? https://lists.freebsd.org/pipermail/freebsd-questions/2012-October/246013.html


----------



## tobiam (Jan 28, 2017)

Update. So I have now seen it multiple times that booting into another OS in between causes the issue.

Another thing the repeatedly happens is that igain (or its Linux equivalent) gets muted/unmuted. This is odd[1], but maybe means it's related to this. Whenever my igain comes up unmuted the headphones work, when they come up muted they don't. The pinout remains the same though. Raising the volume on igain doesn't change anything. I usually have to turn it off, because I otherwise hear sound from the internal mic on the headphones/speakers.

Speakers themselves, always work.

[1] or maybe it's not. I don't know enough about audio and how drivers work.

EDIT: Okay, verified that it always gets fixed by powering off rather than rebooting. Maybe something I could do to simulate that from within the OS? Then this could be done by the driver to have the same behavior all the time?

By the way, that also means that it's not related to packages, which would have been strange since piping to /dev/dsp didn't work either. So if you wanna make sure it's the same, do that instead of using some application that might need libraries, etc.


----------

