Re: [alsa-devel] Issues and/or possible bugs in alsa
Whoops, I didn't realize I sent that to you and you alone, Raymond.
I'm going to take a guess and conclude that there must be bugs in the interface patch written for the realtek codecs. I happened to test two other laptops and they worked just fine. (Intel...)
...I guess in should report a bug related to that realtek patch...
• Yomi On Mar 22, 2015 11:11 AM, "Yomi Ogunwumi" abyomi0@gmail.com wrote:
Is there anything I can do to resolve it?
On Sun, Mar 22, 2015 at 11:09 AM, Yomi Ogunwumi abyomi0@gmail.com wrote:
There is one log where that snippet looks correct.
https://gist.github.com/Yomi0/9bfc3e72588cf8a35811#file-alsainfo-headphones-...
https://gist.githubusercontent.com/Yomi0/9bfc3e72588cf8a35811/raw/77ff724d23...)
Codec: Realtek ALC269VB Address: 0 AFG Function Id: 0x1 (unsol 1) Vendor Id: 0x10ec0269 Subsystem Id: 0x1179fa22 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
On Sun, Mar 15, 2015 at 11:58 AM, Raymond Yau < superquad.vortex2@gmail.com> wrote:
Is there anything else I need to do?
Codec: Realtek ALC269VB Address: 0 AFG Function Id: 0x1 (unsol 1) Vendor Id: 0x10ec0269 Subsystem Id: 0x1179fa22 Revision Id: 0x100100 No Modem Function Group found Default PCM: N/A Default Amp-In caps: N/A Default Amp-Out caps: N/A State of AFG node 0x01: Power: setting=UNKNOWN, actual=UNKNOWN, Error, Clock-stop-OK, Setting-reset Invalid AFG subtree
Your problem seem related to power
-- *Yomi*
-- *Yomi*
I'm going to take a guess and conclude that there must be bugs in the
interface patch written for the realtek codecs. I happened to test two other laptops and they worked just fine. (Intel...)
...I guess in should report a bug related to that realtek patch...
•
Is there anything else I need to do?
Codec: Realtek ALC269VB Address: 0 AFG Function Id: 0x1 (unsol 1) Vendor Id: 0x10ec0269 Subsystem Id: 0x1179fa22 Revision Id: 0x100100 No Modem Function Group found Default PCM: N/A Default Amp-In caps: N/A Default Amp-Out caps: N/A State of AFG node 0x01: Power: setting=UNKNOWN, actual=UNKNOWN, Error, Clock-stop-OK,
Setting-reset
Invalid AFG subtree
You need to find out what value return snd_hda_param_read() in snd_hda_get_sub_nodes ()
and value of pwr return by snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_POWER_STATE, 0);
int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid, hda_nid_t *start_id) { unsigned int parm;
parm = snd_hda_param_read(codec, nid, AC_PAR_NODE_COUNT); if (parm == -1) { *start_id = 0 return 0; } *start_id = (parm >> 16) & 0x7fff; return (int)(parm & 0x7fff); } nodes = snd_hda_get_sub_nodes(codec, fg, &nid); if (! nid || nodes < 0) { snd_iprintf(buffer, "Invalid AFG subtree\n"); snd_hda_power_down(codec); return; }
Power: setting=UNKNOWN, actual=UNKNOWN, Error, Clock-stop-OK, Setting-reset
static const char *get_pwr_state(u32 state) { static const char * const buf[] = { "D0", "D1", "D2", "D3", "D3cold" }; if (state < ARRAY_SIZE(buf)) return buf[state]; return "UNKNOWN"; }
int sup = snd_hda_param_read(codec, nid, AC_PAR_POWER_STATE); int pwr = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_POWER_STATE, 0); if (sup != -1) snd_iprintf(buffer, " Power states: %s\n", bits_names(sup, names, ARRAY_SIZE(names)));
snd_iprintf(buffer, " Power: setting=%s, actual=%s", get_pwr_state(pwr & AC_PWRST_SETTING), get_pwr_state((pwr & AC_PWRST_ACTUAL) >> AC_PWRST_ACTUAL_SHIFT)); if (pwr & AC_PWRST_ERROR) snd_iprintf(buffer, ", Error"); if (pwr & AC_PWRST_CLK_STOP_OK) snd_iprintf(buffer, ", Clock-stop-OK"); if (pwr & AC_PWRST_SETTING_RESET) snd_iprintf(buffer, ", Setting-reset"); snd_iprintf(buffer, "\n");
Can you send me a modified sound/pci/hda/hda_proc.c, with the changes you included in last email?
• Yomi On Apr 3, 2015 11:10 AM, "Raymond Yau" superquad.vortex2@gmail.com wrote:
I'm going to take a guess and conclude that there must be bugs in the
interface patch written for the realtek codecs. I happened to test two other laptops and they worked just fine. (Intel...)
...I guess in should report a bug related to that realtek patch...
•
Is there anything else I need to do?
Codec: Realtek ALC269VB Address: 0 AFG Function Id: 0x1 (unsol 1) Vendor Id: 0x10ec0269 Subsystem Id: 0x1179fa22 Revision Id: 0x100100 No Modem Function Group found Default PCM: N/A Default Amp-In caps: N/A Default Amp-Out caps: N/A State of AFG node 0x01: Power: setting=UNKNOWN, actual=UNKNOWN, Error, Clock-stop-OK,
Setting-reset
Invalid AFG subtree
You need to find out what value return snd_hda_param_read() in snd_hda_get_sub_nodes ()
and value of pwr return by snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_POWER_STATE, 0);
int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid, hda_nid_t *start_id) { unsigned int parm;
parm = snd_hda_param_read(codec, nid, AC_PAR_NODE_COUNT); if (parm == -1) { *start_id = 0 return 0; } *start_id = (parm >> 16) & 0x7fff; return (int)(parm & 0x7fff);
} nodes = snd_hda_get_sub_nodes(codec, fg, &nid); if (! nid || nodes < 0) { snd_iprintf(buffer, "Invalid AFG subtree\n"); snd_hda_power_down(codec); return; }
Power: setting=UNKNOWN, actual=UNKNOWN, Error, Clock-stop-OK, Setting-reset
static const char *get_pwr_state(u32 state) { static const char * const buf[] = { "D0", "D1", "D2", "D3", "D3cold" }; if (state < ARRAY_SIZE(buf)) return buf[state]; return "UNKNOWN"; }
int sup = snd_hda_param_read(codec, nid, AC_PAR_POWER_STATE); int pwr = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_POWER_STATE, 0); if (sup != -1) snd_iprintf(buffer, " Power states: %s\n", bits_names(sup, names, ARRAY_SIZE(names)));
snd_iprintf(buffer, " Power: setting=%s, actual=%s", get_pwr_state(pwr & AC_PWRST_SETTING), get_pwr_state((pwr & AC_PWRST_ACTUAL) >> AC_PWRST_ACTUAL_SHIFT)); if (pwr & AC_PWRST_ERROR) snd_iprintf(buffer, ", Error"); if (pwr & AC_PWRST_CLK_STOP_OK) snd_iprintf(buffer, ", Clock-stop-OK"); if (pwr & AC_PWRST_SETTING_RESET) snd_iprintf(buffer, ", Setting-reset"); snd_iprintf(buffer, "\n");
Can you send me a modified sound/pci/hda/hda_proc.c, with the changes you
included in last email?
Just change two lines to dump nid, nodes and pwr
snd_iprintf(buffer, "Invalid AFG subtree nid=%x nodes=%x\n", nid, nodes);
snd_iprintf(buffer, " Power: %x setting=%s, actual=%s", pwr, get_pwr_state(pwr & AC_PWRST_SETTING), get_pwr_state((pwr & AC_PWRST_ACTUAL) >> AC_PWRST_ACTUAL_SHIFT));
I'm going to take a guess and conclude that there must be bugs in the
interface patch written for the realtek codecs. I happened to test two other laptops and they worked just fine. (Intel...)
...I guess in should report a bug related to that realtek patch...
•
> > Is there anything else I need to do?
Codec: Realtek ALC269VB Address: 0 AFG Function Id: 0x1 (unsol 1) Vendor Id: 0x10ec0269 Subsystem Id: 0x1179fa22 Revision Id: 0x100100 No Modem Function Group found Default PCM: N/A Default Amp-In caps: N/A Default Amp-Out caps: N/A State of AFG node 0x01: Power: setting=UNKNOWN, actual=UNKNOWN, Error, Clock-stop-OK,
Setting-reset
Invalid AFG subtree
Okay, I added those lines to a clone of tiwai's repo. Output of alsa-info.sh : https://gist.github.com/Yomi0/f4059fe45d960f141b33#file-rpatch
On Thu, Apr 9, 2015 at 9:20 PM, Raymond Yau superquad.vortex2@gmail.com wrote:
Can you send me a modified sound/pci/hda/hda_proc.c, with the changes
you included in last email?
Just change two lines to dump nid, nodes and pwr
snd_iprintf(buffer, "Invalid AFG subtree nid=%x nodes=%x\n", nid, nodes);
snd_iprintf(buffer, " Power: %x setting=%s, actual=%s", pwr, get_pwr_state(pwr & AC_PWRST_SETTING), get_pwr_state((pwr & AC_PWRST_ACTUAL) >> AC_PWRST_ACTUAL_SHIFT));
I'm going to take a guess and conclude that there must be bugs in the
interface patch written for the realtek codecs. I happened to test two other laptops and they worked just fine. (Intel...)
...I guess in should report a bug related to that realtek patch...
•
> > > > Is there anything else I need to do? > > Codec: Realtek ALC269VB > Address: 0 > AFG Function Id: 0x1 (unsol 1) > Vendor Id: 0x10ec0269 > Subsystem Id: 0x1179fa22 > Revision Id: 0x100100 > No Modem Function Group found > Default PCM: > N/A > Default Amp-In caps: N/A > Default Amp-Out caps: N/A > State of AFG node 0x01: > Power: setting=UNKNOWN, actual=UNKNOWN, Error, Clock-stop-OK,
Setting-reset
> Invalid AFG subtree
Okay, I added those lines to a clone of tiwai's repo. Output of alsa-info.sh :
https://gist.github.com/Yomi0/f4059fe45d960f141b33#file-rpatch
Try hdajacksensetest -a when you plugged and unplugged HP and mic
Did headphone playback volume change to minimum when you plug and unplug ?
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/log/sound/pci/h...
Seem no specifc hack used by other toshiba
Simple mixer control 'Headphone',0 Capabilities: pvolume pswitch Playback channels: Front Left - Front Right Limits: Playback 0 - 87 Mono: Front Left: Playback 0 [0%] [-65.25dB] [off] Front Right: Playback 0 [0%] [-65.25dB] [off]
control.14 { iface CARD name 'Mic Jack' value true comment { access read type BOOLEAN count 1 } }
control.16 { iface CARD name 'Headphone Jack' value false comment { access read type BOOLEAN count 1 } }
Nothing changes when I plug in or unplug my headphones. The output of hdajacksensetest stays the same. However, in alsamixer, the level of Internal Mic Boost goes from 20 to zero, and Mic Boost goes to 20.
Output of hdajacksensetest:
Pin 0x03 ( Digital Out, HDMI): present = No Pin 0x05 (Not connected): present = No Pin 0x07 (Not connected): present = No
On Fri, Apr 10, 2015 at 9:18 AM, Raymond Yau superquad.vortex2@gmail.com wrote:
Okay, I added those lines to a clone of tiwai's repo. Output of alsa-info.sh :
https://gist.github.com/Yomi0/f4059fe45d960f141b33#file-rpatch
Try hdajacksensetest -a when you plugged and unplugged HP and mic
Did headphone playback volume change to minimum when you plug and unplug ?
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/log/sound/pci/h...
Seem no specifc hack used by other toshiba
Simple mixer control 'Headphone',0 Capabilities: pvolume pswitch Playback channels: Front Left - Front Right Limits: Playback 0 - 87 Mono: Front Left: Playback 0 [0%] [-65.25dB] [off] Front Right: Playback 0 [0%] [-65.25dB] [off]
control.14 { iface CARD name 'Mic Jack' value true comment { access read type BOOLEAN count 1 } }
control.16 { iface CARD name 'Headphone Jack' value false comment { access read type BOOLEAN count 1 } }
Nothing changes when I plug in or unplug my headphones. The output of
hdajacksensetest stays the same.
However, in alsamixer, the level of Internal Mic Boost goes from 20 to
zero, and Mic Boost goes to 20.
Output of hdajacksensetest:
Pin 0x03 ( Digital Out, HDMI): present = No Pin 0x05 (Not connected): present = No Pin 0x07 (Not connected): present = No
This seem to be your HDMI codec
You need to specify card 1 when you run hdajacksensetest since option "-a" just mean all pin complex instead of all cards
hdaudioC1D0: autoconfig for ALC269VB: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker hdaudioC1D0: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0) hdaudioC1D0: hp_outs=1 (0x21/0x0/0x0/0x0/0x0) hdaudioC1D0: mono: mono_out=0x0 hdaudioC1D0: inputs: hdaudioC1D0: Mic=0x18 hdaudioC1D0: Internal Mic=0x12
You have to post three outputs: no jacks plugged, headphone plugged and mic jack plugged
On Fri, Apr 10, 2015 at 9:18 AM, Raymond Yau superquad.vortex2@gmail.com
wrote:
Okay, I added those lines to a clone of tiwai's repo. Output of alsa-info.sh :
https://gist.github.com/Yomi0/f4059fe45d960f141b33#file-rpatch
Try hdajacksensetest -a when you plugged and unplugged HP and mic
Did headphone playback volume change to minimum when you plug and unplug
?
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/log/sound/pci/h...
Seem no specifc hack used by other toshiba
Simple mixer control 'Headphone',0 Capabilities: pvolume pswitch Playback channels: Front Left - Front Right Limits: Playback 0 - 87 Mono: Front Left: Playback 0 [0%] [-65.25dB] [off] Front Right: Playback 0 [0%] [-65.25dB] [off]
control.14 { iface CARD name 'Mic Jack' value true comment { access read type BOOLEAN count 1 } }
control.16 { iface CARD name 'Headphone Jack' value false comment { access read type BOOLEAN count 1 } }
Nothing changes when I plug in or unplug my headphones. The output of
hdajacksensetest stays the same.
However, in alsamixer, the level of Internal Mic Boost goes from 20 to
zero, and Mic Boost goes to 20.
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pc...
May be HP need to connect to DAC at node 0x03 for alc269vb
Okay, I added those lines to a clone of tiwai's repo. Output of alsa-info.sh :
https://gist.github.com/Yomi0/f4059fe45d960f141b33#file-rpatch
If the problem still exist but the jack state are correct after you run hdajacksensetest
You need to specify spec->primary_hp=0 for those alc269vb which force the driver to assign dac 0x02 to speaker first and dac 0x03 to headphone since it was hardcoded in this patch
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pc...
Headphones unplugged. [11:10:44 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo ./hdajacksensetest -c 1 [sudo] password for yomi: Pin 0x18 (Black Mic, Right side): present = No Pin 0x21 (Black Headphone, Right side): present = No
Headphones plugged in. [11:10:50 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo ./hdajacksensetest -c 1 Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = No
That's odd. It seems to detect my headphones as being plugged into the Mic jack. It isn't. It is plugged into the headphone jack. I checked. Haha. If I plug my headphones into the Mic Jack...alsamixer correctly mutes the speakers and raises the volume of the headphones output.
Headphones plugged into Mic Jack. [11:11:08 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo ./hdajacksensetest -c 1 [sudo] password for yomi: Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = Yes
On Sat, Apr 11, 2015 at 3:07 AM, Raymond Yau superquad.vortex2@gmail.com wrote:
Okay, I added those lines to a clone of tiwai's repo. Output of alsa-info.sh :
https://gist.github.com/Yomi0/f4059fe45d960f141b33#file-rpatch
If the problem still exist but the jack state are correct after you run hdajacksensetest
You need to specify spec->primary_hp=0 for those alc269vb which force the driver to assign dac 0x02 to speaker first and dac 0x03 to headphone since it was hardcoded in this patch
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pc...
Headphones unplugged. [11:10:44 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
[sudo] password for yomi: Pin 0x18 (Black Mic, Right side): present = No Pin 0x21 (Black Headphone, Right side): present = No
Headphones plugged in. [11:10:50 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = No
That's odd. It seems to detect my headphones as being plugged into the
Mic jack. It isn't. It is plugged into the headphone jack. I checked.
Haha. If I plug my headphones into the Mic Jack...alsamixer correctly
mutes the speakers and raises the volume of the headphones output.
Headphones plugged into Mic Jack. [11:11:08 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
[sudo] password for yomi: Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = Yes
It is quite strange that jack state are exchanged since pincap of 0x18 does not support HP and node 0x21 does not support IN , you cannot exchange the usage of these two jacks by retasking
Did your laptop sound work with previous version or other os ?
How about disable jack detect using hint jack_detect=0 ?
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/Documentat...
you have to select mic jack using capture source and manually mute the speaket
Headphones unplugged. [11:10:44 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
[sudo] password for yomi: Pin 0x18 (Black Mic, Right side): present = No Pin 0x21 (Black Headphone, Right side): present = No
Headphones plugged in. [11:10:50 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = No
That's odd. It seems to detect my headphones as being plugged into the
Mic jack. It isn't. It is plugged into the headphone jack. I checked.
Haha. If I plug my headphones into the Mic Jack...alsamixer correctly
mutes the speakers and raises the volume of the headphones output.
Headphones plugged into Mic Jack. [11:11:08 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
[sudo] password for yomi: Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = Yes
Do you mean headphone and mic work as expected only when both are plugged and always fail when headphone or mic is plugged ?
Look like jack sense circuit of hp and mic are swapped
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/pci/...
The current implementation assume kctl return jack state of the corresponding pin complex
Can two pins use the other pin as the gated jack at same time ? snd_hda_jack_set_gating_jack()
ALSA: hda - Allow jack state to depend on another jack
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pc...
your case seem not just need to swap the result return by read_pin_sense()
switch(nid){ case 0x18: val = snd_hda_codec_read(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0); break; case 0x21 val = snd_hda_codec_read(codec, 0x18, 0, AC_VERB_GET_PIN_SENSE, 0); break; default: val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0); break; }
but also swap the unsolicited event tag on those two pin complex since the driver use jack->tag to determine pin complex
snd_hda_codec_write_cache(codec, nid, 0, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | jack->tag);
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 Control: name="Mic Jack", index=0, device=0 Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x2f, mute=0 Amp-In vals: [0x01 0x01] 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 0x04a11030: [Jack] Mic at Ext Right Conn = 1/8, Color = Black DefAssociation = 0x3, Sequence = 0x0 Pin-ctls: 0x24: IN VREF_80 Unsolicited: tag=02, enabled=1 Connection: 1 0x0d
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 Control: name="Headphone Jack", index=0, device=0 Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80] Pincap 0x0000001c: OUT HP Detect Pin Default 0x04211020: [Jack] HP Out at Ext Right Conn = 1/8, Color = Black DefAssociation = 0x2, Sequence = 0x0 Pin-ctls: 0xc0: OUT HP Unsolicited: tag=01, enabled=1 Connection: 2 0x0c* 0x0dp
I should have elaborated a bit more on the result of the last case.
No, when I plug in the headphones into the Microphone jack, the headphones do not work at all. (which makes sense, because it's a mic jack...it would be expecting a mic, right?)
While alsamixer will correctly raise the headphone output and mute the speakers (when I plugged the headphones into the mic jack) — no sound comes through the headphones.
Just to avoid any possible confusion...
Are those more changes I should make to the code?
Headphones unplugged. Pin 0x18 (Black Mic, Right side): present = No Pin 0x21 (Black Headphone, Right side): present = No
Headphones plugged into Headphone port. Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = No
Headphones plugged into Mic port. Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = Yes
On Mon, Apr 13, 2015 at 9:20 PM, Raymond Yau superquad.vortex2@gmail.com wrote:
Headphones unplugged. [11:10:44 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
[sudo] password for yomi: Pin 0x18 (Black Mic, Right side): present = No Pin 0x21 (Black Headphone, Right side): present = No
Headphones plugged in. [11:10:50 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = No
That's odd. It seems to detect my headphones as being plugged into the
Mic jack. It isn't. It is plugged into the headphone jack. I checked.
Haha. If I plug my headphones into the Mic Jack...alsamixer correctly
mutes the speakers and raises the volume of the headphones output.
Headphones plugged into Mic Jack. [11:11:08 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
[sudo] password for yomi: Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = Yes
Do you mean headphone and mic work as expected only when both are plugged and always fail when headphone or mic is plugged ?
Look like jack sense circuit of hp and mic are swapped
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/pci/...
The current implementation assume kctl return jack state of the corresponding pin complex
Can two pins use the other pin as the gated jack at same time ? snd_hda_jack_set_gating_jack()
ALSA: hda - Allow jack state to depend on another jack
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pc...
your case seem not just need to swap the result return by read_pin_sense()
switch(nid){ case 0x18: val = snd_hda_codec_read(codec, 0x21, 0,
AC_VERB_GET_PIN_SENSE, 0); break; case 0x21 val = snd_hda_codec_read(codec, 0x18, 0, AC_VERB_GET_PIN_SENSE, 0); break; default: val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0); break; }
but also swap the unsolicited event tag on those two pin complex since the driver use jack->tag to determine pin complex
snd_hda_codec_write_cache(codec, nid, 0, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | jack->tag);
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 Control: name="Mic Jack", index=0, device=0 Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x2f, mute=0 Amp-In vals: [0x01 0x01] 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 0x04a11030: [Jack] Mic at Ext Right Conn = 1/8, Color = Black DefAssociation = 0x3, Sequence = 0x0 Pin-ctls: 0x24: IN VREF_80 Unsolicited: tag=02, enabled=1 Connection: 1 0x0d
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 Control: name="Headphone Jack", index=0, device=0 Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80] Pincap 0x0000001c: OUT HP Detect Pin Default 0x04211020: [Jack] HP Out at Ext Right Conn = 1/8, Color = Black DefAssociation = 0x2, Sequence = 0x0 Pin-ctls: 0xc0: OUT HP Unsolicited: tag=01, enabled=1 Connection: 2 0x0c* 0x0dp
What exactly am I changing here?
switch(nid){ case 0x18: val = snd_hda_codec_read(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0); break; case 0x21 val = snd_hda_codec_read(codec, 0x18, 0, AC_VERB_GET_PIN_SENSE, 0); break; default: val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0); break; } On Apr 13, 2015 9:36 PM, "Yomi Ogunwumi" abyomi0@gmail.com wrote:
I should have elaborated a bit more on the result of the last case.
No, when I plug in the headphones into the Microphone jack, the headphones do not work at all. (which makes sense, because it's a mic jack...it would be expecting a mic, right?)
While alsamixer will correctly raise the headphone output and mute the speakers (when I plugged the headphones into the mic jack) — no sound comes through the headphones.
Just to avoid any possible confusion...
Are those more changes I should make to the code?
Headphones unplugged. Pin 0x18 (Black Mic, Right side): present = No Pin 0x21 (Black Headphone, Right side): present = No
Headphones plugged into Headphone port. Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = No
Headphones plugged into Mic port. Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = Yes
On Mon, Apr 13, 2015 at 9:20 PM, Raymond Yau superquad.vortex2@gmail.com wrote:
Headphones unplugged. [11:10:44 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
[sudo] password for yomi: Pin 0x18 (Black Mic, Right side): present = No Pin 0x21 (Black Headphone, Right side): present = No
Headphones plugged in. [11:10:50 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = No
That's odd. It seems to detect my headphones as being plugged into the
Mic jack. It isn't. It is plugged into the headphone jack. I checked.
Haha. If I plug my headphones into the Mic Jack...alsamixer correctly
mutes the speakers and raises the volume of the headphones output.
Headphones plugged into Mic Jack. [11:11:08 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
[sudo] password for yomi: Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = Yes
Do you mean headphone and mic work as expected only when both are plugged and always fail when headphone or mic is plugged ?
Look like jack sense circuit of hp and mic are swapped
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/pci/...
The current implementation assume kctl return jack state of the corresponding pin complex
Can two pins use the other pin as the gated jack at same time ? snd_hda_jack_set_gating_jack()
ALSA: hda - Allow jack state to depend on another jack
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pc...
your case seem not just need to swap the result return by read_pin_sense()
switch(nid){ case 0x18: val = snd_hda_codec_read(codec, 0x21, 0,
AC_VERB_GET_PIN_SENSE, 0); break; case 0x21 val = snd_hda_codec_read(codec, 0x18, 0, AC_VERB_GET_PIN_SENSE, 0); break; default: val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0); break; }
but also swap the unsolicited event tag on those two pin complex since the driver use jack->tag to determine pin complex
snd_hda_codec_write_cache(codec, nid, 0, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | jack->tag);
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 Control: name="Mic Jack", index=0, device=0 Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x2f, mute=0 Amp-In vals: [0x01 0x01] 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 0x04a11030: [Jack] Mic at Ext Right Conn = 1/8, Color = Black DefAssociation = 0x3, Sequence = 0x0 Pin-ctls: 0x24: IN VREF_80 Unsolicited: tag=02, enabled=1 Connection: 1 0x0d
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 Control: name="Headphone Jack", index=0, device=0 Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80] Pincap 0x0000001c: OUT HP Detect Pin Default 0x04211020: [Jack] HP Out at Ext Right Conn = 1/8, Color = Black DefAssociation = 0x2, Sequence = 0x0 Pin-ctls: 0xc0: OUT HP Unsolicited: tag=01, enabled=1 Connection: 2 0x0c* 0x0dp
-- *Yomi*
What exactly am I changing in hda_jack.c ?
switch(nid){ case 0x18: val = snd_hda_codec_read(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0); break; case 0x21 val = snd_hda_codec_read(codec, 0x18, 0, AC_VERB_GET_PIN_SENSE, 0); break; default: val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0); break; }
snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | jack->tag);
On Mon, May 11, 2015 at 10:22 AM, Yomi Ogunwumi abyomi0@gmail.com wrote:
What exactly am I changing here?
switch(nid){ case 0x18: val = snd_hda_codec_read(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0); break; case 0x21 val = snd_hda_codec_read(codec, 0x18, 0, AC_VERB_GET_PIN_SENSE, 0); break; default: val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0); break; } On Apr 13, 2015 9:36 PM, "Yomi Ogunwumi" abyomi0@gmail.com wrote:
I should have elaborated a bit more on the result of the last case.
No, when I plug in the headphones into the Microphone jack, the headphones do not work at all. (which makes sense, because it's a mic jack...it would be expecting a mic, right?)
While alsamixer will correctly raise the headphone output and mute the speakers (when I plugged the headphones into the mic jack) — no sound comes through the headphones.
Just to avoid any possible confusion...
Are those more changes I should make to the code?
Headphones unplugged. Pin 0x18 (Black Mic, Right side): present = No Pin 0x21 (Black Headphone, Right side): present = No
Headphones plugged into Headphone port. Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = No
Headphones plugged into Mic port. Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = Yes
On Mon, Apr 13, 2015 at 9:20 PM, Raymond Yau <superquad.vortex2@gmail.com
wrote:
Headphones unplugged. [11:10:44 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
[sudo] password for yomi: Pin 0x18 (Black Mic, Right side): present = No Pin 0x21 (Black Headphone, Right side): present = No
Headphones plugged in. [11:10:50 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = No
That's odd. It seems to detect my headphones as being plugged into the
Mic jack. It isn't. It is plugged into the headphone jack. I checked.
Haha. If I plug my headphones into the Mic Jack...alsamixer correctly
mutes the speakers and raises the volume of the headphones output.
Headphones plugged into Mic Jack. [11:11:08 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
[sudo] password for yomi: Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = Yes
Do you mean headphone and mic work as expected only when both are plugged and always fail when headphone or mic is plugged ?
Look like jack sense circuit of hp and mic are swapped
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/pci/...
The current implementation assume kctl return jack state of the corresponding pin complex
Can two pins use the other pin as the gated jack at same time ? snd_hda_jack_set_gating_jack()
ALSA: hda - Allow jack state to depend on another jack
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pc...
your case seem not just need to swap the result return by read_pin_sense()
switch(nid){ case 0x18: val = snd_hda_codec_read(codec, 0x21, 0,
AC_VERB_GET_PIN_SENSE, 0); break; case 0x21 val = snd_hda_codec_read(codec, 0x18, 0, AC_VERB_GET_PIN_SENSE, 0); break; default: val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0); break; }
but also swap the unsolicited event tag on those two pin complex since the driver use jack->tag to determine pin complex
snd_hda_codec_write_cache(codec, nid, 0, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | jack->tag);
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 Control: name="Mic Jack", index=0, device=0 Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x2f, mute=0 Amp-In vals: [0x01 0x01] 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 0x04a11030: [Jack] Mic at Ext Right Conn = 1/8, Color = Black DefAssociation = 0x3, Sequence = 0x0 Pin-ctls: 0x24: IN VREF_80 Unsolicited: tag=02, enabled=1 Connection: 1 0x0d
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 Control: name="Headphone Jack", index=0, device=0 Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80] Pincap 0x0000001c: OUT HP Detect Pin Default 0x04211020: [Jack] HP Out at Ext Right Conn = 1/8, Color = Black DefAssociation = 0x2, Sequence = 0x0 Pin-ctls: 0xc0: OUT HP Unsolicited: tag=01, enabled=1 Connection: 2 0x0c* 0x0dp
-- *Yomi*
I know I've been silent for awhile, finals came around the same time I was also attempting to get help resolving this. It wasn't that I lost interest, I just had other things to focus on. I understand that it probably wasn't in my best interest to go silent if I wanted to fix this. I'm still interested in fixing this. Is anyone still willing to help?
On Tue, May 19, 2015 at 8:57 PM, Yomi Ogunwumi abyomi0@gmail.com wrote:
What exactly am I changing in hda_jack.c ?
switch(nid){ case 0x18: val = snd_hda_codec_read(codec, 0x21, 0,
AC_VERB_GET_PIN_SENSE, 0); break; case 0x21 val = snd_hda_codec_read(codec, 0x18, 0, AC_VERB_GET_PIN_SENSE, 0); break; default: val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0); break; }
snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | jack->tag);
On Mon, May 11, 2015 at 10:22 AM, Yomi Ogunwumi abyomi0@gmail.com wrote:
What exactly am I changing here?
switch(nid){ case 0x18: val = snd_hda_codec_read(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0); break; case 0x21 val = snd_hda_codec_read(codec, 0x18, 0, AC_VERB_GET_PIN_SENSE, 0); break; default: val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0); break; } On Apr 13, 2015 9:36 PM, "Yomi Ogunwumi" abyomi0@gmail.com wrote:
I should have elaborated a bit more on the result of the last case.
No, when I plug in the headphones into the Microphone jack, the headphones do not work at all. (which makes sense, because it's a mic jack...it would be expecting a mic, right?)
While alsamixer will correctly raise the headphone output and mute the speakers (when I plugged the headphones into the mic jack) — no sound comes through the headphones.
Just to avoid any possible confusion...
Are those more changes I should make to the code?
Headphones unplugged. Pin 0x18 (Black Mic, Right side): present = No Pin 0x21 (Black Headphone, Right side): present = No
Headphones plugged into Headphone port. Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = No
Headphones plugged into Mic port. Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = Yes
On Mon, Apr 13, 2015 at 9:20 PM, Raymond Yau < superquad.vortex2@gmail.com> wrote:
Headphones unplugged. [11:10:44 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
[sudo] password for yomi: Pin 0x18 (Black Mic, Right side): present = No Pin 0x21 (Black Headphone, Right side): present = No
Headphones plugged in. [11:10:50 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = No
That's odd. It seems to detect my headphones as being plugged into
the Mic jack. It isn't. It is plugged into the headphone jack. I checked.
Haha. If I plug my headphones into the Mic Jack...alsamixer correctly
mutes the speakers and raises the volume of the headphones output.
Headphones plugged into Mic Jack. [11:11:08 | yomi@xana ~/software/alsa-tools/hdajacksensetest] » sudo
./hdajacksensetest -c 1
[sudo] password for yomi: Pin 0x18 (Black Mic, Right side): present = Yes Pin 0x21 (Black Headphone, Right side): present = Yes
Do you mean headphone and mic work as expected only when both are plugged and always fail when headphone or mic is plugged ?
Look like jack sense circuit of hp and mic are swapped
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/pci/...
The current implementation assume kctl return jack state of the corresponding pin complex
Can two pins use the other pin as the gated jack at same time ? snd_hda_jack_set_gating_jack()
ALSA: hda - Allow jack state to depend on another jack
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pc...
your case seem not just need to swap the result return by read_pin_sense()
switch(nid){ case 0x18: val = snd_hda_codec_read(codec, 0x21, 0,
AC_VERB_GET_PIN_SENSE, 0); break; case 0x21 val = snd_hda_codec_read(codec, 0x18, 0, AC_VERB_GET_PIN_SENSE, 0); break; default: val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0); break; }
but also swap the unsolicited event tag on those two pin complex since the driver use jack->tag to determine pin complex
snd_hda_codec_write_cache(codec, nid, 0, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | jack->tag);
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 Control: name="Mic Jack", index=0, device=0 Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x2f, mute=0 Amp-In vals: [0x01 0x01] 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 0x04a11030: [Jack] Mic at Ext Right Conn = 1/8, Color = Black DefAssociation = 0x3, Sequence = 0x0 Pin-ctls: 0x24: IN VREF_80 Unsolicited: tag=02, enabled=1 Connection: 1 0x0d
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 Control: name="Headphone Jack", index=0, device=0 Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80] Pincap 0x0000001c: OUT HP Detect Pin Default 0x04211020: [Jack] HP Out at Ext Right Conn = 1/8, Color = Black DefAssociation = 0x2, Sequence = 0x0 Pin-ctls: 0xc0: OUT HP Unsolicited: tag=01, enabled=1 Connection: 2 0x0c* 0x0dp
-- *Yomi*
-- *Yomi*
participants (2)
-
Raymond Yau
-
Yomi Ogunwumi