[G41MT-S2P, VIA VT2020, Pink Mic, Rear] No sound at all

Bug #1365769 reported by Gideon Walker
2
Affects Status Importance Assigned to Milestone
alsa-driver (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

The problem is that the microphone is not detected after a reboot. As a result, some applications cannot get sound from the microphone.

The Input tab of the Sound window lists no device.

I have a workround which is to disconnect and then connect the microphone after I have logged in.

Interestingly, the audacity application can access the microphone when the system says that the device does not exist

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: alsa-base 1.0.25+dfsg-0ubuntu4
ProcVersionSignature: Ubuntu 3.2.0-67.101-generic 3.2.60
Uname: Linux 3.2.0-67-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.3
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: tim 2060 F.... pulseaudio
CurrentDesktop: Unity
Date: Fri Sep 5 00:12:39 2014
InstallationDate: Installed on 2011-07-29 (1133 days ago)
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
PackageArchitecture: all
SourcePackage: alsa-driver
Symptom: audio
Symptom_AlsaRecordingTest: ALSA recording test through plughw:Intel failed
Symptom_Card: Built-in Audio - HDA Intel
Symptom_DevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: tim 2060 F.... pulseaudio
Symptom_Jack: Pink Mic, Rear
Symptom_Type: No sound at all
Title: [G41MT-S2P, VIA VT2020, Pink Mic, Rear] No sound at all
UpgradeStatus: Upgraded to trusty on 2014-08-15 (20 days ago)
dmi.bios.date: 12/31/2010
dmi.bios.vendor: Award Software International, Inc.
dmi.bios.version: F1
dmi.board.name: G41MT-S2P
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: x.x
dmi.chassis.type: 3
dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
dmi.modalias: dmi:bvnAwardSoftwareInternational,Inc.:bvrF1:bd12/31/2010:svnGigabyteTechnologyCo.,Ltd.:pnG41MT-S2P:pvr:rvnGigabyteTechnologyCo.,Ltd.:rnG41MT-S2P:rvrx.x:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvr:
dmi.product.name: G41MT-S2P
dmi.sys.vendor: Gigabyte Technology Co., Ltd.

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :
Revision history for this message
Raymond (superquad-vortex2) wrote :

you have select line instead of rear mic

Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Front Mic' 'Rear Mic' 'Line' 'Stereo Mixer'
  Item0: 'Line'
Simple mixer control 'Input Source',1
  Capabilities: cenum
  Items: 'Front Mic' 'Rear Mic' 'Line' 'Stereo Mixer'
  Item0: 'Rear Mic'

it strange that no alt analog capture device when there Are two adc

ARECORD

**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: VT2020 Analog [VT2020 Analog]
  Subdevices: 2/2
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1

Revision history for this message
Raymond (superquad-vortex2) wrote :

Kernel Information
!!------------------

Kernel release: 3.2.0-67-generic
Operating System: GNU/Linux
Architecture: x86_64
Processor: x86_64
SMP Enabled: Yes

seem you are using old version of alsa driver with Ubuntu 14.04

since smart5.1 switch has been replaced by channel mode

Revision history for this message
Raymond (superquad-vortex2) wrote :

are you using alsa dkms before upgrade, seem upgrade did not install the kernel alsa driver ?

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

I had booted into an old version of the kernel.

I get the same problem with the current version which is 3.13.0-34-generic

> cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version k3.13.0-34-generic.

I used alsamixer to change Input Source to "Read Mic" but the device is still not visible in Input tab

Revision history for this message
Raymond (superquad-vortex2) wrote :

post output of alsa-info.sh

Changed in alsa-driver (Ubuntu):
status: New → Incomplete
Revision history for this message
Raymond (superquad-vortex2) wrote :

your codec have two adc and audio input node 0x10 with stream tag 4 is recording

Node 0x10 [Audio Input] wcaps 0x10051b: 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="VT2020 Analog", type="Audio", device=0
  Amp-In caps: ofs=0x0b, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-In vals: [0x1f 0x1f]
  Converter: stream=4, channel=0
  SDI-Select: 0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 1
     0x1e
Node 0x11 [Audio Input] wcaps 0x10051b: Stereo Amp-In
  Control: name="Capture Volume", index=1, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Control: name="Capture Switch", index=1, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Amp-In caps: ofs=0x0b, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-In vals: [0x1f 0x1f]
  Converter: stream=0, channel=0
  SDI-Select: 0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 1
     0x1f

Node 0x1e [Audio Selector] wcaps 0x300501: Stereo
  Control: name="Input Source", index=0, device=0
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 6
     0x2c 0x2b 0x2a* 0x29 0x28 0x21
Node 0x1f [Audio Selector] wcaps 0x300501: Stereo
  Control: name="Input Source", index=1, device=0
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 6
     0x2c 0x2b* 0x2a 0x29 0x28 0x21

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

Just to be clear, you want me to do the following
1. boot machine
2. change Input Source to "Read Mic" using alsamixer
3. run alsa-info.sh
4. provide output

Is that correct?

Revision history for this message
Raymond (superquad-vortex2) wrote :

smaft 5.1 was replcaed by channel mode long time ago

Simple mixer control 'Smart 5.1',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda/patch_via.c?id=b3f6008f2d511133e0f04782c437a13b6865d26b

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

Yes, I see the kernel diff.

I need to know whether I should go ahead with the actions in comment 8.

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

Well, I decided to go ahead with the actions in comment 8.

For this test, I am using the standard 14.04 kernel which is 3.13.0-34-generic

The output is attached.

In addition, I confirmed that the device is not displayed. In other words, the bug was present

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

Well, I made a mistake and forgot to do the alsamixer command.

So I now attach the output after having done it

Revision history for this message
Raymond (superquad-vortex2) wrote :

seem Jack detection problem , pulseaudio check the Jack state

try

hda-jack-sense-test -a

control.31 {
  iface CARD
  name 'Front Mic Jack'
  value false
  comment {
   access read
   type BOOLEAN
   count 1
  }
 }
 control.32 {
  iface CARD
  name 'Rear Mic Jack'
  value false
  comment {
   access read
   type BOOLEAN
   count 1
  }
 }
 control.33 {
  iface CARD
  name 'Line Jack'
  value false
  comment {
   access read
   type BOOLEAN
   count 1
  }
 }
 control.34 {
  iface CARD
  name 'Line Out Jack'
  value false
  comment {
   access read
   type BOOLEAN
   count 1
  }
 }
 control.35 {
  iface CARD
  name 'Front Headphone Jack'
  value false
  comment {
   access read
   type BOOLEAN
   count 1
  }
 }

Revision history for this message
Raymond (superquad-vortex2) wrote :

pcm.!default {
       type plug
       slave.pcm "asymed"
}

any reason to overwrite pcm.default when you are running pulseaudio

for desktop , the front panel headphone and Mic can use alt analog device when independent HP is enabled

APLAY

**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: VT2020 Analog [VT2020 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 2: VT2020 Alt Analog [VT2020 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

ARECORD

**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: VT2020 Analog [VT2020 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 2: VT2020 Alt Analog [VT2020 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Revision history for this message
Raymond (superquad-vortex2) wrote :

ports:
  analog-input-microphone-front: Front Microphone (priority 8500, latency offset 0 usec, available: no)
   properties:
    device.icon_name = "audio-input-microphone"
  analog-input-microphone-rear: Rear Microphone (priority 8200, latency offset 0 usec, available: no)
   properties:
    device.icon_name = "audio-input-microphone"
  analog-input-linein: Line In (priority 8100, latency offset 0 usec, available: no)
   properties:

 active port: <analog-input-linein>

Revision history for this message
Raymond (superquad-vortex2) wrote :

you may need to open an upstream bug report at

https://bugzilla.kernel.org/enter_bug.cgi?product=Drivers

it is pulseaudio module-switch-on-port-available which change the input source when the jacks are not plugged

for the workaround, you may try disable Jack detection by hint using early patching

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/Documentation/sound/alsa/HD-Audio.txt

The generic parser supports the following hints:

- jack_detect (bool): specify whether the jack detection is available
  at all on this machine; default true

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

I do not have the hda-jack-sense-test command.

I was not aware that I was overriding the pcm.default. Is it worth changing this to see if the bug goes away? How would I do that?

Do I need to build my own version of the kernel to disable jack detection?

Revision history for this message
Raymond (superquad-vortex2) wrote : Re: [pulseaudio-discuss] [V4 PATCH] module-switch-on-connect: add an argument for conditionally connecting

>>
>> >
>> > On a machine without fixed connecting audio devices like internal
>> > microphone or internal speaker, and when there is no external audio
>> > devices plugging in, the default source/sink is alsa_input/alsa_output
>> > and there is no input devices/output devices listed in the gnome
>> > sound-setting.

https://launchpadlibrarian.net/184055917/PulseList.txt

Seem line in is active port when all ports are not available
Pulseaudio won't switch away from line in but gnome won't show line in
since it is not plugged

ports:
analog-input-microphone-front: Front Microphone (priority 8500, latency
offset 0 usec, available: no)
properties:
device.icon_name = "audio-input-microphone"
analog-input-microphone-rear: Rear Microphone (priority 8200, latency
offset 0 usec, available: no)
properties:
device.icon_name = "audio-input-microphone"
analog-input-linein: Line In (priority 8100, latency offset 0 usec,
available: no)
properties:

active port: <analog-input-linein>

https://launchpadlibrarian.net/184417469/alsa2.txt

Revision history for this message
Hui Wang (hui.wang) wrote :

On 09/26/2014 12:13 AM, Raymond Yau wrote:
>
>
> >>
> >> >
> >> > On a machine without fixed connecting audio devices like internal
> >> > microphone or internal speaker, and when there is no external audio
> >> > devices plugging in, the default source/sink is
> alsa_input/alsa_output
> >> > and there is no input devices/output devices listed in the gnome
> >> > sound-setting.
>
> https://launchpadlibrarian.net/184055917/PulseList.txt
>
> Seem line in is active port when all ports are not available
> Pulseaudio won't switch away from line in but gnome won't show line in
> since it is not plugged
>
> ports:
> analog-input-microphone-front: Front Microphone (priority 8500,
> latency offset 0 usec, available: no)
> properties:
> device.icon_name = "audio-input-microphone"
> analog-input-microphone-rear: Rear Microphone (priority 8200, latency
> offset 0 usec, available: no)
> properties:
> device.icon_name = "audio-input-microphone"
> analog-input-linein: Line In (priority 8100, latency offset 0 usec,
> available: no)
> properties:
>
> active port: <analog-input-linein>
>
Yes, in this situation, the default-source->active_port->available=no,
if you use this module and pass "only_from_unavailable=yes", when
connect bluetooth headset, the default source will automatically switch
to bluez-source.

In this situation, if you plug something in the line-in jack, the
default-source->active_port-available=yes, and if you pass
"only_from_unavailable=yes", the default source will not switch.
>
> https://launchpadlibrarian.net/184417469/alsa2.txt
>
>
>
> _______________________________________________
> pulseaudio-discuss mailing list
> <email address hidden>
> http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Revision history for this message
Raymond (superquad-vortex2) wrote :
Download full text (3.2 KiB)

>> >>
>> >> >
>> >> > On a machine without fixed connecting audio devices like internal
>> >> > microphone or internal speaker, and when there is no external audio
>> >> > devices plugging in, the default source/sink is
alsa_input/alsa_output
>> >> > and there is no input devices/output devices listed in the gnome
>> >> > sound-setting.
>>
>> https://launchpadlibrarian.net/184055917/PulseList.txt
>>
>> Seem line in is active port when all ports are not available
>> Pulseaudio won't switch away from line in but gnome won't show line in
since it is not plugged
>>
>> ports:
>> analog-input-microphone-front: Front Microphone (priority 8500, latency
offset 0 usec, available: no)
>> properties:
>> device.icon_name = "audio-input-microphone"
>> analog-input-microphone-rear: Rear Microphone (priority 8200, latency
offset 0 usec, available: no)
>> properties:
>> device.icon_name = "audio-input-microphone"
>> analog-input-linein: Line In (priority 8100, latency offset 0 usec,
available: no)
>> properties:
>>
>> active port: <analog-input-linein>
>
> Yes, in this situation, the default-source->active_port->available=no, if
you use this module and pass "only_from_unavailable=yes", when connect
bluetooth headset, the default source will automatically switch to
bluez-source.
>
> In this situation, if you plug something in the line-in jack, the
default-source->active_port-available=yes, and if you pass
"only_from_unavailable=yes", the default source will not switch.
>>
>> https://launchpadlibrarian.net/184417469/alsa2.txt
>>
>>

>I do not have the hda-jack-sense-test command.

>I was not aware that I was overriding the pcm.default. Is it worth
changing this to see if the bug goes away? How would I do that?

Seem upgrade does not remove previous conf

System wide config file (/etc/asound.conf)

###################### /etc/asound.conf ##################################
pcm.!default {
       type plug
       slave.pcm "asymed"
}

pcm.asymed {
       type asym
       playback.pcm "swmixer"
       capture.pcm "mixin"
}

pcm.dsp0 {
       type plug
       slave.pcm "asymed"
}

pcm.swmixer {
       type dmix
       ipc_key 1234
       slowptr yes
       slave {
               pcm "hw:0,0"
               period_time 0
               period_size 1024
               buffer_size 4096
               rate 48000
       }
}

ctl.dmixer {
       type hw
       card 0
}

pcm.mixin {
       type dsnoop
       ipc_key 5978293 # must be unique for all dmix plugins!!!!
       ipc_key_add_uid yes
       slave {
               pcm "hw:0,0"
               channels 2
               period_size 1024
               buffer_size 4096
               rate 48000
               periods 0
               period_time 0
       }
       bindings {
               0 0
               0 1
       }
}

> Do I need to build my own version of the kernel to disable jack detection?

https://launchpad.net/~diwic/+archive/ubuntu/hda

Install snd-hda-tools and run hda-jack-sense-test to find out whether rear
Mic Jack , line in and front Mic report correct Jack state when you plugged
and unplugged

If it work in windows, you may need to file an upstream bug report

If rear Mic Jack cannot report correct Ja...

Read more...

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

okay, I installed snd-hda-tools.

I ran hda-jack-sense-test and got this output

Traceback (most recent call last):
  File "/usr/bin/hda-jack-sense-test", line 47, in <module>
    codec = HDACodec(cardindex, codecindex)
  File "/usr/share/snd-hda-tools/hda_codec.py", line 1023, in __init__
    self.fd = os.open("/dev/snd/hwC%sD%s" % (card, device), os.O_RDWR)
OSError: [Errno 2] No such file or directory: '/dev/snd/hwC0D0'

Revision history for this message
Raymond (superquad-vortex2) wrote :

seem you are not using latest alsa driver

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda?id=f1e762ddc8035f803d15f8c524151bf788482ec2

Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Front Mic' 'Rear Mic' 'Line'
  Item0: 'Rear Mic'
Simple mixer control 'Input Source',1
  Capabilities: cenum
  Items: 'Front Mic' 'Rear Mic' 'Line'
  Item0: 'Rear Mic'
Simple mixer control 'Loopback Mixing',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'

Node 0x1e [Audio Selector] wcaps 0x300501: Stereo
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 6
     0x2c 0x2b* 0x2a 0x29 0x28 0x21

most via codecs able to record the playing signal by select stereo mix ( node 0x21)

Node 0x21 [Audio Mixer] wcaps 0x20050b: Stereo Amp-In
  Control: name="Front Mic Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=3, ofs=0
  Control: name="Front Mic Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=3, ofs=0
  Control: name="Rear Mic Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=1, ofs=0
  Control: name="Rear Mic Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=1, ofs=0
  Control: name="Line Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=2, ofs=0
  Control: name="Line Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=2, ofs=0
  Amp-In caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-In vals: [0x80 0x80] [0x1f 0x1f] [0x81 0x81] [0x80 0x80] [0x80 0x80]
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 5
     0x2c 0x2b 0x2a 0x29 0x28
  In-driver Connection: 6
     0x2c 0x2b 0x2a 0x29 0x28 0x08

node 0x08 is the audio output

Revision history for this message
Raymond (superquad-vortex2) wrote :

>> >>
>> >> >
>> >> > On a machine without fixed connecting audio devices like internal
>> >> > microphone or internal speaker, and when there is no external audio
>> >> > devices plugging in, the default source/sink is
alsa_input/alsa_output
>> >> > and there is no input devices/output devices listed in the gnome
>> >> > sound-setting.
>>
>> https://launchpadlibrarian.net/184055917/PulseList.txt
>>
>> Seem line in is active port when all ports are not available
>> Pulseaudio won't switch away from line in but gnome won't show line in
since it is not plugged
>>
>> ports:
>> analog-input-microphone-front: Front Microphone (priority 8500, latency
offset 0 usec, available: no)
>> properties:
>> device.icon_name = "audio-input-microphone"
>> analog-input-microphone-rear: Rear Microphone (priority 8200, latency
offset 0 usec, available: no)
>> properties:
>> device.icon_name = "audio-input-microphone"
>> analog-input-linein: Line In (priority 8100, latency offset 0 usec,
available: no)
>> properties:
>>
>> active port: <analog-input-linein>
>
> Yes, in this situation, the default-source->active_port->available=no, if
you use this module and pass "only_from_unavailable=yes", when connect
bluetooth headset, the default source will automatically switch to
bluez-source.
>
> In this situation, if you plug something in the line-in jack, the
default-source->active_port-available=yes, and if you pass
"only_from_unavailable=yes", the default source will not switch.
>>
>> https://launchpadlibrarian.net/184417469/alsa2.txt
>>
>>

https://bugs.freedesktop.org/show_bug.cgi?id=84334

Ports:
analog-output: Analog Output (priority: 9900)
analog-output-speaker: Speakers (priority: 10000)
analog-output-headphones: Headphones (priority: 9000, not available)
Active Port: analog-output-headphones

Even pulseaudio may neglect the Jack state of line out and line in

Select unplugged line out and line in as active port when headphone or Mic
Jack is unplugged

But active port cannot be an unavailable headphone

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

Should I move to the latest alsa driver? If so, how do I do this?

Revision history for this message
Raymond (superquad-vortex2) wrote :

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/log/sound/pci/hda/patch_via.c

may need this patch if dynamic power control is broken

 https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/refs/tags

Kernel release: 3.13.0-34-generic

seem 8 months

ALSA Device nodes
!!-----------------

crw-rw----+ 1 root audio 116, 7 Sep 9 07:14 /dev/snd/controlC0
crw-rw----+ 1 root audio 116, 6 Sep 9 07:14 /dev/snd/hwC0D2
crw-rw----+ 1 root audio 116, 5 Sep 9 07:15 /dev/snd/pcmC0D0c
crw-rw----+ 1 root audio 116, 4 Sep 9 22:01 /dev/snd/pcmC0D0p
crw-rw----+ 1 root audio 116, 3 Sep 9 07:14 /dev/snd/pcmC0D2c
crw-rw----+ 1 root audio 116, 2 Sep 9 07:14 /dev/snd/pcmC0D2p
crw-rw----+ 1 root audio 116, 1 Sep 9 07:14 /dev/snd/seq
crw-rw----+ 1 root audio 116, 33 Sep 9 07:14 /dev/snd/timer

you need to ask author why hda -jack-sense-test fail

Revision history for this message
Raymond (superquad-vortex2) wrote :

OSError: [Errno 2] No such file or directory: '/dev/snd/hwC0D0'

strange that only have /dev/snd/hwC0D2

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

I have contacted the author. We will see what happens

Revision history for this message
David Henningsson (diwic) wrote :

 > strange that only have /dev/snd/hwC0D2

There is only one codec, and it has address 2. This is unusual, but not wrong. Just supply card and device arguments to hda-jack-sense-test: "sudo hda-jack-sense-test -c 0 -d 2".
That said, hda-jack-sense-test has a tendency to break from time to time, when the proc files add new stuff. So I'm not sure it works anyway. I should probably rewrite it to be more robust.

Revision history for this message
David Henningsson (diwic) wrote :

 > Should I move to the latest alsa driver? If so, how do I do this?

Just follow the instructions here:
https://wiki.ubuntu.com/Audio/UpgradingAlsa/DKMS

Try that first. If it does not help, here's another workaround you can try:

Edit the file /etc/modprobe.d/alsa-base.conf and add:
options snd-hda-intel jackpoll_ms=400

Reboot and test, and see if this helps. Thanks.

Revision history for this message
David Henningsson (diwic) wrote :

Also, you seem to have some strange stuff in ~/.asoundrc and /etc/asound.conf. Before doing anything else, could you remove these files (or move them somewhere for backup purposes). It probably won't solve this issue, but it's just good to have one cause of error removed.

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

I ran
sudo hda-jack-sense-test -c 0 -d 2
but I got an error "ValueError: wrong proc file format ( In-driver Connection: 6)"

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

Okay, moving to the latest driver did not help.
The change to alsa-base.conf did work.
I now see the microphone in Sound Settings

Revision history for this message
Raymond (superquad-vortex2) wrote :

you have to post output of alsa -info.sh

the polling is implemented for vt1708 which does not support unsolicited event,

this may mean unsolicited event is broken and you need to fire an upstream bug report

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

here is the output

Revision history for this message
Raymond (superquad-vortex2) wrote :

it is strange that unsolicited event is not enabled on hp, mic,....

and strange that unsolicited gpio used in desktop

GPIO: io=1, o=0, i=0, unsolicited=1, wake=0
  IO[0]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0

Node 0x28 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
  Control: name="Headphone Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Control: name="Front Headphone Jack", index=0, device=0
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals: [0x00 0x00]
  Pincap 0x0000233c: IN OUT HP Detect
    Vref caps: HIZ 50 100
  Pin Default 0x0221401f: [Jack] HP Out at Ext Front
    Conn = 1/8, Color = Green
    DefAssociation = 0x1, Sequence = 0xf
  Pin-ctls: 0xc0: OUT HP VREF_HIZ
  Unsolicited: tag=00, enabled=0
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 1
     0x1b
Node 0x29 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
  Control: name="Front Mic Boost Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Control: name="Front Mic Jack", index=0, device=0
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals: [0x80 0x80]
  Pincap 0x0000233c: IN OUT HP Detect
    Vref caps: HIZ 50 100
  Pin Default 0x02a19037: [Jack] Mic at Ext Front
    Conn = 1/8, Color = Pink
    DefAssociation = 0x3, Sequence = 0x7
  Pin-ctls: 0x21: IN VREF_50
  Unsolicited: tag=00, enabled=0
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 1
     0x1c

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

I forgot to mention that I have deleted ~/.asoundrc and /etc/asound.conf

Revision history for this message
Raymond (superquad-vortex2) wrote :

http://git.kernel.org/cgit/linux/kernel/git/tiwai/hda-emu.git/tree/codecs/vt1708-clevo-m540se?id=HEAD

let take vt1708 as example
pincap of hp and mic support DETECT but not support unsolicited event and this require to set a timer to send get_pin_sense periodcally when open the playback/capture device

Node 0x20 [Pin Complex] wcaps 0x40010d: Stereo Amp-Out
  Amp-Out caps: ofs=0x1b, nsteps=0x1b, stepsize=0x06, mute=1
  Amp-Out vals: [0x15 0x15]
  Pincap 0x081c: OUT HP Detect
  Pin Default 0x022140f0: [Jack] HP Out at Ext Front
    Conn = 1/8, Color = Green
  Pin-ctls: 0xc0: OUT HP
  Connection: 1
     0x17
Node 0x21 [Pin Complex] wcaps 0x400101: Stereo
  Pincap 0x08334: IN OUT Detect
  Pin Default 0x02a190f0: [Jack] Mic at Ext Front
    Conn = 1/8, Color = Pink
  Pin-ctls: 0x21: IN
  Connection: 1
     0x1b

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda/patch_via.c?id=4e2d16d326fd33e3101ddf08730c953b480ec2ef

seem all via codec except vt1708 use unsol event for jack event and power state event

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/log/sound/pci/hda/hda_jack.c

Revision history for this message
Raymond (superquad-vortex2) wrote :

I ran
 sudo hda-jack-sense-test -c 0 -d 2
 but I got an error "ValueError: wrong proc file format ( In-driver Connection: 6)"

This is bug of the codec parser of hda-analyzer

because connection from audio mixer to audio ouput node 0x08 is hidden

select stereo mix as input source is can get signal from mix of DAC and any input pins

Node 0x21 [Audio Mixer] wcaps 0x20050b: Stereo Amp-In
  Control: name="Front Mic Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=3, ofs=0
  Control: name="Front Mic Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=3, ofs=0
  Control: name="Rear Mic Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=1, ofs=0
  Control: name="Rear Mic Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=1, ofs=0
  Control: name="Line Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=2, ofs=0
  Control: name="Line Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=2, ofs=0
  Amp-In caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-In vals: [0x80 0x80] [0x1f 0x1f] [0x01 0x01] [0x00 0x00] [0x80 0x80]
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 5
     0x2c 0x2b 0x2a 0x29 0x28
  In-driver Connection: 6
     0x2c 0x2b 0x2a 0x29 0x28 0x08

Revision history for this message
Raymond (superquad-vortex2) wrote :

the input mux can select rear mic, front mic , line in and audio mixer node 0x21

this mean that the unavailable line in port cannot be the active port

Node 0x1e [Audio Selector] wcaps 0x300501: Stereo
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 6
     0x2c 0x2b* 0x2a 0x29 0x28 0x21
Node 0x1f [Audio Selector] wcaps 0x300501: Stereo
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 6
     0x2c 0x2b* 0x2a 0x29 0x28 0x21

ports:
  analog-input-microphone-front: Front Microphone (priority 8500, latency offset 0 usec, available: no)
   properties:
    device.icon_name = "audio-input-microphone"
  analog-input-microphone-rear: Rear Microphone (priority 8200, latency offset 0 usec, available: no)
   properties:
    device.icon_name = "audio-input-microphone"
  analog-input-linein: Line In (priority 8100, latency offset 0 usec, available: no)
   properties:

 active port: <analog-input-linein>

Revision history for this message
Raymond (superquad-vortex2) wrote :
Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

I checked the hda_proc.py file and it does not contain that patch.

So you could be right in saying that the patch might fix it.

I guess the package snd-hda-tools should be updated at some point

Revision history for this message
Raymond (superquad-vortex2) wrote :

umsolicited event was disabled when you enable polling

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sounda/hda_jack.c?id=34a9318772d00efc5c1af00639526232050c49b8

does your symptom look like the state of jack is/are changing rapidly from plugged and unplugged many times within a second?

 pulseaudio verbose log without specify jackpoll_ms=400

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

The Sound Settings window does not suggest that the jack state is rapidly changing.

I am not sure what the "verbose log" is

Revision history for this message
Raymond (superquad-vortex2) wrote :

https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/874535

 headphone jack has detection problem

https://wiki.ubuntu.com/PulseAudio/Log

as driver won't enable auto mic for desktop have two or more detectable jack

you can only check pulseaudio log for those plug and unplug event

Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Front Mic' 'Rear Mic' 'Line' 'Stereo Mix'
  Item0: 'Rear Mic'
Simple mixer control 'Input Source',1
  Capabilities: cenum
  Items: 'Front Mic' 'Rear Mic' 'Line' 'Stereo Mix'
  Item0: 'Rear Mic'

Revision history for this message
Raymond (superquad-vortex2) wrote :

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/Documentation/sound/alsa/HD-Audio.txt

if you still can not use unsol event. for jack detect

you need a debug version of alsa driver to enable tracepoint tyo trace hda unsol event

Revision history for this message
Raymond (superquad-vortex2) wrote :

previous driver allow you to change the volume from audio output by pcm loopback playback volume but the current driver set this gain to 0dB

Node 0x21 [Audio Mixer] wcaps 0x20050b: Stereo Amp-In
  Control: name="PCM Loopback Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=5, ofs=0
  Control: name="PCM Loopback Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=5, ofs=0
  Control: name="Front Mic Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=3, ofs=0
  Control: name="Front Mic Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=3, ofs=0
  Control: name="Rear Mic Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=1, ofs=0
  Control: name="Rear Mic Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=1, ofs=0
  Control: name="Line Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=2, ofs=0
  Control: name="Line Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=2, ofs=0
  Amp-In caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-In vals: [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80]
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 5
     0x2c 0x2b 0x2a 0x29 0x28

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

Here is the log generated by running pulseaudio for a few seconds.

"a debug version of alsa driver" - how should I get this?

Revision history for this message
Raymond (superquad-vortex2) wrote :

seem cannot detect any jacks when pulseaudio start

can you post the output of patched

 hda-jack-sense-test -a

or use hda-verb to query line out, headphone

239542] sound hdaudioC0D2: autoconfig: line_outs=1 (0x24/0x0/0x0/0x0/0x0) type:line
[ 17.239547] sound hdaudioC0D2: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[ 17.239548] sound hdaudioC0D2: hp_outs=1 (0x28/0x0/0x0/0x0/0x0)
[ 17.239550] sound hdaudioC0D2: mono: mono_out=0x0
[ 17.239551] sound hdaudioC0D2: inputs:
[ 17.239554] sound hdaudioC0D2: Front Mic=0x29
[ 17.239556] sound hdaudioC0D2: Rear Mic=0x2b
[ 17.239557] sound hdaudioC0D2: Line=0x2a

return value 0x80000000 mean jack is present and zero mean jack is not present

sudo hda-verb /dev/snd/hwC0D2 0x2b GET_PIN_SENSE 0

http://git.alsa-project.org/?p=alsa-tools.git;a=blob;f=hda-verb/README;hb=HEAD

086| 0.000) I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:0'
( 0.086| 0.000) D: [pulseaudio] module-alsa-card.c: Jack 'Line Out Jack' is now unplugged
( 0.086| 0.000) D: [pulseaudio] module-alsa-card.c: Jack 'Front Headphone Jack' is now unplugged
( 0.087| 0.000) D: [pulseaudio] device-port.c: Setting port analog-output-headphones to status no
( 0.087| 0.000) D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
( 0.087| 0.000) D: [pulseaudio] module-switch-on-port-available.c: finding port analog-output-headphones
( 0.087| 0.000) D: [pulseaudio] module-alsa-card.c: Jack 'Front Mic Jack' is now unplugged
( 0.087| 0.000) D: [pulseaudio] device-port.c: Setting port analog-input-microphone-front to status no
( 0.087| 0.000) D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
( 0.087| 0.000) D: [pulseaudio] module-switch-on-port-available.c: finding port analog-input-microphone-front
( 0.087| 0.000) D: [pulseaudio] module-alsa-card.c: Jack 'Rear Mic Jack' is now unplugged
( 0.087| 0.000) D: [pulseaudio] device-port.c: Setting port analog-input-microphone-rear to status no
( 0.087| 0.000) D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
( 0.087| 0.000) D: [pulseaudio] module-switch-on-port-available.c: finding port analog-input-microphone-rear
( 0.087| 0.000) D: [pulseaudio] module-alsa-card.c: Jack 'Line Jack' is now unplugged
( 0.087| 0.000) D: [pulseaudio] device-port.c: Setting port analog-input-linein to status no
( 0.087| 0.000) D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
( 0.087| 0.000) D: [pulseaudio] module-switch-on-port-available.c: finding port analog-input-linein

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

I did "sudo hda-verb /dev/snd/hwC0D2 0x2b GET_PIN_SENSE 0"
nid = 0x2b, verb = 0xf09, param = 0x0
value = 0x80000000

I also unplugged the mic and then got a value 0x0

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

I am happy to use the workround (modifying alsa-base.conf). So, this issue is not high priority for me

Revision history for this message
Furkan (falaca) wrote :

I submitted a kernel bug report, which I think might be related to your issue: https://bugzilla.kernel.org/show_bug.cgi?id=98921

Would you be able to test the kernel patch in comment #9 to see if it solves your issue too?

Revision history for this message
Gideon Walker (gideon425-launchpad) wrote :

I have removed the workround and no longer see the problem. I am therefore closing the bug

Changed in alsa-driver (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.