Skip to contentSkip to conversation

Intel HDA Driver - Bug

DISCUSSION Steven King 2 participants 6 messages Jul 26, 2007 – Aug 2, 2007 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,

I have been trying to get the sound on my Dell Inspiron 1720 laptop running under Debian Etch (STAC 9205). Originally, I could only get sound through the main speakers, there was no headphone sound or mic.

I downloaded the latest alsa-drivers package (1.0.14), compiled it and installed it. I received the following messages (and the device would not register itself):

hda_intel: azx_get_response timeout, switching to polling mode...
hda_intel: azx_get_response timeout, switching to single_cmd mode...

I started digging into the driver code and found an issue with one of the routines going outside an array.

The offending code is (all in patch_sigmatel):
static void stac92xx_set_config_regs(struct hda_codec *codec) {
// ...
for (i = 0; i < spec->num_pins; i++) {
// ...
}

And in:
static int patch_stac9205(struct hda_codec *codec) {
// ..
spec->num_pins = 14 ; //ERROR
// ..
}

However, there are only 12 pins with 12 corresponding NIDs and default configuration so in stac92xx_set_config_regs it accesses spec->pin_configs[i] and spec->pin_nids[i] outside of bounds.

Fix: Add a define (STAC_9205_MAX_PINS = 12) and use for array defines and num_pins.

The driver loads now, but I still only have sound out the main speaker. If I get rid of the configuration sent to the chipset altogether. I get sound through Headphone and Speakers (with detect working on HP), but still no MIC.

How can I add support for my Dell as I don't know the configuration to use or am I missing something here?

Thanks,

Steve

#1 lore raw

At Thu, 26 Jul 2007 16:32:00 +0100,

Quoted 33 lines · Steven King

Hi,

I have been trying to get the sound on my Dell Inspiron 1720 laptop running under Debian Etch (STAC 9205). Originally, I could only get sound through the main speakers, there was no headphone sound or mic.

I downloaded the latest alsa-drivers package (1.0.14), compiled it and installed it. I received the following messages (and the device would not register itself):

hda_intel: azx_get_response timeout, switching to polling mode...
hda_intel: azx_get_response timeout, switching to single_cmd mode...

I started digging into the driver code and found an issue with one of the routines going outside an array.

The offending code is (all in patch_sigmatel):
static void stac92xx_set_config_regs(struct hda_codec *codec) {
// ...
for (i = 0; i < spec->num_pins; i++) {
// ...
}

And in:
static int patch_stac9205(struct hda_codec *codec) {
// ..
spec->num_pins = 14 ; //ERROR
// ..
}

Quoted 6 lines

However, there are only 12 pins with 12 corresponding NIDs and default configuration so in stac92xx_set_config_regs it accesses spec->pin_configs[i] and spec->pin_nids[i] outside of bounds.

Fix: Add a define (STAC_9205_MAX_PINS = 12) and use for array defines and num_pins.

It's a known problem and was fixed on HG repo weeks ago.

BTW, it seems that hg-mirror.alsa-project.org is out of sync. Try hg.alsa-project.org instead.

thanks,

Takashi

#2 lore raw

Hi Takashi,

I have grabbed the source tree: hg clone
http://hg.alsa-project.org/alsa-kernel, hg clone
http://hg.alsa-project.org/alsa-driver

I compiled the module and reloaded it. The main speaker and headphones work (with HP jack detect), however the mic is still not working (a mic jack). In alsamixer I get: ADCMux, InMux and InVol, I turned these all up to full and tried using gnome-sound-recorder to record sound, no luck. With Digital Input Source ->

What can I do to work out the correct input device? I think that no mic input is detected during autoconfiguration.

Thanks for your help,

Steve

Quoted 53 lines · Takashi Iwai

At Thu, 26 Jul 2007 16:32:00 +0100,

Quoted 33 lines · Steven King

Hi,

I have been trying to get the sound on my Dell Inspiron 1720 laptop running under Debian Etch (STAC 9205). Originally, I could only get sound through the main speakers, there was no headphone sound or mic.

I downloaded the latest alsa-drivers package (1.0.14), compiled it and installed it. I received the following messages (and the device would not register itself):

hda_intel: azx_get_response timeout, switching to polling mode...
hda_intel: azx_get_response timeout, switching to single_cmd mode...

I started digging into the driver code and found an issue with one of the routines going outside an array.

The offending code is (all in patch_sigmatel):
static void stac92xx_set_config_regs(struct hda_codec *codec) {
// ...
for (i = 0; i < spec->num_pins; i++) {
// ...
}

And in:
static int patch_stac9205(struct hda_codec *codec) {
// ..
spec->num_pins = 14 ; //ERROR
// ..
}

Quoted 6 lines

However, there are only 12 pins with 12 corresponding NIDs and default configuration so in stac92xx_set_config_regs it accesses spec->pin_configs[i] and spec->pin_nids[i] outside of bounds.

Fix: Add a define (STAC_9205_MAX_PINS = 12) and use for array defines and num_pins.

It's a known problem and was fixed on HG repo weeks ago.

BTW, it seems that hg-mirror.alsa-project.org is out of sync. Try hg.alsa-project.org instead.

thanks,

Takashi

#3 lore raw

At Thu, 26 Jul 2007 18:14:03 +0100,

Quoted 6 lines · Steven King

Hi Takashi,

I have grabbed the source tree: hg clone http://hg.alsa-project.org/alsa-kernel , hg clone http://hg.alsa-project.org/alsa-driver

Quoted 7 lines

I compiled the module and reloaded it. The main speaker and headphones work (with HP jack detect), however the mic is still not working (a mic jack). In alsamixer I get:
ADCMux, InMux and InVol, I turned these all up to full and tried using gnome-sound-recorder to record sound, no luck. With Digital Input Source ->

What can I do to work out the correct input device? I think that no mic input is detected during autoconfiguration.

Well, I'm not sure whether the recording works on _all_ mac models there. It was confirmed to work at least on some models, but not on every model.

Anyway, let's sort out the possible mixer setting problem. Please attach the contents of /proc/asound/card0/codec#* (for audio codec) and the generated file via "alsactl -f somefile store" for further analysis.

Takashi

#4 lore raw

Hi Takashi,

See the attached files for the alsaconfig and card info. This is the first time I've looked into the drivers of ALSA, so please be patient :)

Thanks,

Steve

Quoted 20 lines · Takashi Iwai

At Thu, 26 Jul 2007 18:14:03 +0100,

Quoted 6 lines · Steven King

Hi Takashi,

I have grabbed the source tree: hg clone http://hg.alsa-project.org/alsa-kernel , hg clone http://hg.alsa-project.org/alsa-driver

Quoted 7 lines

I compiled the module and reloaded it. The main speaker and headphones work (with HP jack detect), however the mic is still not working (a mic jack). In alsamixer I get:
ADCMux, InMux and InVol, I turned these all up to full and tried using gnome-sound-recorder to record sound, no luck. With Digital Input Source ->

What can I do to work out the correct input device? I think that no mic input is detected during autoconfiguration.

Well, I'm not sure whether the recording works on _all_ mac models there. It was confirmed to work at least on some models, but not on every model.

Quoted 8 lines

Anyway, let's sort out the possible mixer setting problem. Please attach the contents of /proc/asound/card0/codec#* (for audio codec) and the generated file via "alsactl -f somefile store" for further analysis.

Takashi

state.Intel {
	control.1 {
		comment.access 'read write'
		comment.type ENUMERATED
		comment.count 1
		comment.item.0 'Analog Inputs'
		comment.item.1 'Digital Mic 1'
		iface MIXER
		name 'Digital Input Source'
		value 'Analog Inputs'
	}
	control.2 {
		comment.access 'read write'
		comment.type ENUMERATED
		comment.count 1
		comment.item.0 Line
		iface MIXER
		name 'Input Source'
		value Line
	}
	control.3 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 4'
		iface MIXER
		name 'InMux Capture Volume'
		value.0 0
		value.1 0
	}
	control.4 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 15'
		iface MIXER
		name 'InVol Capture Volume'
		value.0 0
		value.1 0
	}
	control.5 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'ADCMux Capture Switch'
		value.0 false
		value.1 false
	}
	control.6 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 127'
		iface MIXER
		name 'Front Playback Volume'
		value.0 111
		value.1 111
	}
	control.7 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'Front Playback Switch'
		value.0 true
		value.1 true
	}
	control.8 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 127'
		iface MIXER
		name 'Surround Playback Volume'
		value.0 81
		value.1 81
	}
	control.9 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'Surround Playback Switch'
		value.0 true
		value.1 true
	}
	control.10 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Line In as Output Switch'
		value false
	}
	control.11 {
		comment.access 'read write user'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 255'
		comment.tlv '0000000100000008ffffec1400000014'
		iface MIXER
		name 'PCM Playback Volume'
		value.0 200
		value.1 200
	}
}

Codec: SigmaTel STAC9205
Address: 0
Vendor Id: 0x838476a0
Subsystem Id: 0x102801f2
Revision Id: 0x100204
No Modem Function Group found
Default PCM:

    rates [0x7e0]: 44100 48000 88200 96000 176400 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM

Default Amp-In caps: ofs=0x00, nsteps=0x0f, stepsize=0x05, mute=0 Default Amp-Out caps: ofs=0x7f, nsteps=0x7f, stepsize=0x02, mute=1 Node 0x0a [Pin Complex] wcaps 0x400181: Stereo
Pincap 0x08173f: IN OUT HP Detect
Pin Default 0x0321101f: [Jack] HP Out at Ext Left
Conn = 1/8, Color = Black
Pin-ctls: 0xc0: OUT HP
Connection: 2

     0x10* 0x11

Node 0x0b [Pin Complex] wcaps 0x400181: Stereo
Pincap 0x081737: IN OUT Detect
Pin Default 0x03811020: [Jack] Line In at Ext Left
Conn = 1/8, Color = Black
Pin-ctls: 0x20: IN
Connection: 2

     0x10 0x11*

Node 0x0c [Pin Complex] wcaps 0x400181: Stereo
Pincap 0x081737: IN OUT Detect
Pin Default 0x40f000f0: [N/A] Other at Ext N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x00:
Connection: 1

     0x11

Node 0x0d [Pin Complex] wcaps 0x400181: Stereo
Pincap 0x083f: IN OUT HP Detect
Pin Default 0x90170110: [Fixed] Speaker at Int N/A
Conn = Analog, Color = Unknown
Pin-ctls: 0x40: OUT
Connection: 1

     0x10

Node 0x0e [Pin Complex] wcaps 0x400181: Stereo
Pincap 0x081737: IN OUT Detect
Pin Default 0x40f000f1: [N/A] Other at Ext N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x00:
Connection: 1

     0x10

Node 0x0f [Pin Complex] wcaps 0x400181: Stereo
Pincap 0x081737: IN OUT Detect
Pin Default 0x40f000f2: [N/A] Other at Ext N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x00:
Connection: 1

     0x11

Node 0x10 [Audio Output] wcaps 0xd0c05: Stereo Amp-Out
Amp-Out caps: N/A
Amp-Out vals: [0x6f 0x6f]
Power: 0x0
Node 0x11 [Audio Output] wcaps 0xd0c05: Stereo Amp-Out
Amp-Out caps: N/A
Amp-Out vals: [0x51 0x51]
Power: 0x0
Node 0x12 [Audio Input] wcaps 0x1d0541: Stereo
Power: 0x0
Connection: 1

     0x1d
Node 0x13 [Audio Input] wcaps 0x1d0541: Stereo
  Power: 0x0
  Connection: 1
     0x1e

Node 0x14 [Pin Complex] wcaps 0x40010c: Mono Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x00]
Pincap 0x0810: OUT
Pin Default 0x40f000f3: [N/A] Other at Ext N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x00:
Connection: 1

     0x15
Node 0x15 [Audio Mixer] wcaps 0x200100: Mono
  Connection: 1
     0x10

Node 0x16 [Pin Complex] wcaps 0x400001: Stereo
Pincap 0x0820: IN
Pin Default 0x40f000f4: [N/A] Other at Ext N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x00:
Node 0x17 [Pin Complex] wcaps 0x400001: Stereo
Pincap 0x0820: IN
Pin Default 0x90a60030: [Fixed] Mic at Int N/A
Conn = Digital, Color = Unknown
Pin-ctls: 0x20: IN
Node 0x18 [Pin Complex] wcaps 0x400001: Stereo
Pincap 0x0820: IN
Pin Default 0x40f000f5: [N/A] Other at Ext N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x20: IN
Node 0x19 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x04, stepsize=0x27, mute=0 Amp-Out vals: [0x00 0x00]
Connection: 7

     0x0e 0x16 0x0f 0x0b* 0x0c 0x0d 0x0a

Node 0x1a [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x04, stepsize=0x27, mute=0 Amp-Out vals: [0x00 0x00]
Connection: 7

     0x0e 0x16 0x0f 0x0b* 0x0c 0x0d 0x0a

Node 0x1b [Audio Selector] wcaps 0x300103: Stereo Amp-In
Amp-In caps: N/A
Amp-In vals: [0x00 0x00]
Connection: 1

     0x19

Node 0x1c [Audio Selector] wcaps 0x300103: Stereo Amp-In
Amp-In caps: N/A
Amp-In vals: [0x00 0x00]
Connection: 1

     0x1a

Node 0x1d [Audio Selector] wcaps 0x30090d: Stereo Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 3

     0x1b* 0x17 0x18

Node 0x1e [Audio Selector] wcaps 0x30090d: Stereo Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 3

     0x1c* 0x17 0x18
Node 0x1f [Audio Output] wcaps 0x40211: Stereo Digital
  PCM:
    rates [0x5e0]: 44100 48000 88200 96000 192000
    bits [0xe]: 16 20 24
    formats [0x5]: PCM AC3
Node 0x20 [Audio Input] wcaps 0x140311: Stereo Digital
  PCM:
    rates [0x160]: 44100 48000 96000
    bits [0xe]: 16 20 24
    formats [0x5]: PCM AC3
  Connection: 1
     0x22

Node 0x21 [Pin Complex] wcaps 0x400301: Stereo Digital
Pincap 0x0810: OUT
Pin Default 0x40f000f6: [N/A] Other at Ext N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x00:
Connection: 3

     0x1f* 0x1d 0x1e

Node 0x22 [Pin Complex] wcaps 0x430681: Stereo Digital
Pincap 0x0810024: IN EAPD Detect
Pin Default 0x40f000f7: [N/A] Other at Ext N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x00:
Power: 0x0
Node 0x23 [Beep Generator Widget] wcaps 0x70000c: Mono Amp-Out
Amp-Out caps: ofs=0x03, nsteps=0x03, stepsize=0x17, mute=0 Amp-Out vals: [0x00]
Node 0x24 [Volume Knob Widget] wcaps 0x600000: Mono Node 0x25 [Vendor Defined Widget] wcaps 0xf00001: Stereo
Codec: Conexant ID 2c06
Address: 1
Vendor Id: 0x14f12c06
Subsystem Id: 0x14f1000f
Revision Id: 0x100000
Modem Function Group: 0x2

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

At Tue, 31 Jul 2007 13:58:32 +0100,

Quoted 8 lines · Steven King

Hi Takashi,

I still have not had much success getting the front microphone jack working correctly. The internal array microphone works by setting the "Digital Input Source" to "Digital Mic 1" which corresponds to the chipset configuration loaded by BIOS and then by the driver in patch_sigmatel.c. So, im not without a microphone for the time being.

Aha, so it's indeed connected to a digital mic (0x17). Good to know.

Quoted 5 lines

I tried setting Port C,D,E,F (Port A and B are HP and internal speaker) to be microphone inputs in the nid configuration, however it still did not get any input audio. Would it have something to do with the jack detect pin on the microphone jack? What else may I have a look at?

I guess 0x0b is the mic input (although it's labelled as "Line"). You might have "Line In as Output Switch". This will change the I/O direction of the pin. There have been bugs regarding this switch in the recent version and it got fixed after 1.0.14 release. So, please use the latest ALSA HG version for debugging the problems.

thanks,

Takashi