[alsa-devel] Mic detection on Mackbook Pro 12,1 (CS4208)
Hi,
After reporting the issue on bugzilla (https://bugzilla.kernel.org/show_bug.cgi?id=155601) I felt I could do more in order to try to get a patch to fix the issue.
Basically when I plug an headset(mic+headphone), it only detects the headphone not the mic.
Since I assumed the "memory address" of the 0x18 pin is wrong, I've tried to change some values in order to get it working. I have tries both ways:
1. By changing the kernel souce(sound/pci/hda/patch_cirrus): in the function static void cs4208_fixup_mac(struct hda_codec *codec, const struct hda_fixup *fix, int action)
I've added an configuration to set the address of the 0x18.
Then create a script to remove the module, compile, load and test via arecord if it's working.
2. use the user_pin_configs basically I've iterated for the range of memory addresses found in the card config and try to apply them:
for (( num=0x002b4020; num <= 0x90a60100; num+=1 )) do pulseaudio -k ADDRESS=$(printf "0x%08x\n" $num) echo "0x18 $ADDRESS" | sudo tee /sys/class/sound/hwC1D0/user_pin_configs echo "0x1c 0x400000f0" | sudo tee /sys/class/sound/hwC1D0/user_pin_configs echo 1 | sudo tee /sys/class/sound/hwC1D0/reconfig pulseaudio -D arecord -d 5 -vvv -f dat /dev/null 2>&1 | grep -Po " 1\d+%" done
but since I need to use the computer, I'm doing this in batches.
Both address we're found by alsa-config as the pin addresses.
Now my question is, is there a better way (without brute force) to get the right address? Could be anything else, other than the address?
I also have MacOS installed, but from what I've found there's no way to know the address in MacOS, if there's a way, please point me ;)
Best regards,
Paulo Fidalgo
On Thu, 10 Nov 2016 22:52:52 +0100, Paulo Fidalgo wrote:
Hi,
After reporting the issue on bugzilla (https://bugzilla.kernel.org/show_bug.cgi?id=155601) I felt I could do more in order to try to get a patch to fix the issue.
Basically when I plug an headset(mic+headphone), it only detects the headphone not the mic.
Since I assumed the "memory address" of the 0x18 pin is wrong, I've tried to change some values in order to get it working.
The value you're referring to isn't a "memory address" at all. It's a "pin configuration" value, containing the information like the location, purpose, sequence number of the given pin, and it's encoded in 32bit integer. Basically it's merely a hint for drivers to configure the system properly.
Refer to the HD-audio specification document for more details.
Takashi
Thanks Takashi for point out, but that document is overwhelming. I understand that developing drivers for unknown hardware should be like running in the woods with our eyes covered, but I don't feel I have the enough knowledge and time to be able to do it.
If helps, when I connect the headset running hda-analyzer tool in monitor mode I only have events related to the OUTPUT:
Watching 2 cards ====================================== Diff for codec 1/0 (0x10134208): --- +++ @@ -7,17 +7,17 @@ No Modem Function Group found Default PCM: rates [0x0]: bits [0x0]: formats [0x0]: Default Amp-In caps: N/A Default Amp-Out caps: N/A GPIO: io=6, o=2, i=0, unsolicited=1, wake=1 - IO[0]: enable=1, dir=1, wake=0, sticky=0, data=1, unsol=0 + IO[0]: enable=1, dir=1, wake=0, sticky=0, data=0, unsol=0 IO[1]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 IO[2]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 IO[3]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 IO[4]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 IO[5]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 Node 0x02 [Audio Output] wcaps 0xd043d: Stereo Amp-Out Stripe Control: name="Headphone Playback Volume", index=0, device=0 ControlAmp: chs=3, dir=1, idx=0, ofs=0 @@ -225,26 +225,24 @@ Power: setting=D3, actual=D3 Connection: 1 0x02 Node 0x12 [Pin Complex] wcaps 0x400501: Stereo Pincap 0x00000050: OUT Balance Pin Default 0x90170011: [Fixed] Speaker at Int N/A Conn = Analog, Color = Unknown DefAssociation = 0x1, Sequence = 0x1 - Pin-ctls: 0x40: OUT Power: setting=D3, actual=D3 Connection: 1 0x03 Node 0x13 [Pin Complex] wcaps 0x400501: Stereo Pincap 0x00000050: OUT Balance Pin Default 0x90170012: [Fixed] Speaker at Int N/A Conn = Analog, Color = Unknown DefAssociation = 0x1, Sequence = 0x2 - Pin-ctls: 0x40: OUT Power: setting=D3, actual=D3 Connection: 1 0x04 Node 0x14 [Pin Complex] wcaps 0x400501: Stereo Pincap 0x00000050: OUT Balance Pin Default 0x90170014: [Fixed] Speaker at Int N/A Conn = Analog, Color = Unknown DefAssociation = 0x1, Sequence = 0x4
Is there any other info I can provide to help?
Kind regards,
Paulo Fidalgo
On 11 November 2016 at 20:34, Takashi Iwai tiwai@suse.de wrote:
On Thu, 10 Nov 2016 22:52:52 +0100, Paulo Fidalgo wrote:
Hi,
After reporting the issue on bugzilla (https://bugzilla.kernel.org/show_bug.cgi?id=155601) I felt I could do more in order to try to get a patch to fix the issue.
Basically when I plug an headset(mic+headphone), it only detects the headphone not the mic.
Since I assumed the "memory address" of the 0x18 pin is wrong, I've tried to change some values in order to get it working.
The value you're referring to isn't a "memory address" at all. It's a "pin configuration" value, containing the information like the location, purpose, sequence number of the given pin, and it's encoded in 32bit integer. Basically it's merely a hint for drivers to configure the system properly.
Refer to the HD-audio specification document for more details.
Takashi
@Takashi, can you confirm if the possible values we can set are the same the hdajackretask program uses on overrides?
On 14 November 2016 at 22:21, Paulo Fidalgo paulo.fidalgo.pt@gmail.com wrote:
Thanks Takashi for point out, but that document is overwhelming. I understand that developing drivers for unknown hardware should be like running in the woods with our eyes covered, but I don't feel I have the enough knowledge and time to be able to do it.
If helps, when I connect the headset running hda-analyzer tool in monitor mode I only have events related to the OUTPUT:
Watching 2 cards
Diff for codec 1/0 (0x10134208):
+++ @@ -7,17 +7,17 @@ No Modem Function Group found Default PCM: rates [0x0]: bits [0x0]: formats [0x0]: Default Amp-In caps: N/A Default Amp-Out caps: N/A GPIO: io=6, o=2, i=0, unsolicited=1, wake=1
- IO[0]: enable=1, dir=1, wake=0, sticky=0, data=1, unsol=0
- IO[0]: enable=1, dir=1, wake=0, sticky=0, data=0, unsol=0 IO[1]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 IO[2]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 IO[3]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 IO[4]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 IO[5]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
Node 0x02 [Audio Output] wcaps 0xd043d: Stereo Amp-Out Stripe Control: name="Headphone Playback Volume", index=0, device=0 ControlAmp: chs=3, dir=1, idx=0, ofs=0 @@ -225,26 +225,24 @@ Power: setting=D3, actual=D3 Connection: 1 0x02 Node 0x12 [Pin Complex] wcaps 0x400501: Stereo Pincap 0x00000050: OUT Balance Pin Default 0x90170011: [Fixed] Speaker at Int N/A Conn = Analog, Color = Unknown DefAssociation = 0x1, Sequence = 0x1
- Pin-ctls: 0x40: OUT Power: setting=D3, actual=D3 Connection: 1 0x03
Node 0x13 [Pin Complex] wcaps 0x400501: Stereo Pincap 0x00000050: OUT Balance Pin Default 0x90170012: [Fixed] Speaker at Int N/A Conn = Analog, Color = Unknown DefAssociation = 0x1, Sequence = 0x2
- Pin-ctls: 0x40: OUT Power: setting=D3, actual=D3 Connection: 1 0x04
Node 0x14 [Pin Complex] wcaps 0x400501: Stereo Pincap 0x00000050: OUT Balance Pin Default 0x90170014: [Fixed] Speaker at Int N/A Conn = Analog, Color = Unknown DefAssociation = 0x1, Sequence = 0x4
Is there any other info I can provide to help?
Kind regards,
Paulo Fidalgo
On 11 November 2016 at 20:34, Takashi Iwai tiwai@suse.de wrote:
On Thu, 10 Nov 2016 22:52:52 +0100, Paulo Fidalgo wrote:
Hi,
After reporting the issue on bugzilla (https://bugzilla.kernel.org/show_bug.cgi?id=155601) I felt I could do more in order to try to get a patch to fix the issue.
Basically when I plug an headset(mic+headphone), it only detects the headphone not the mic.
Since I assumed the "memory address" of the 0x18 pin is wrong, I've tried to change some values in order to get it working.
The value you're referring to isn't a "memory address" at all. It's a "pin configuration" value, containing the information like the location, purpose, sequence number of the given pin, and it's encoded in 32bit integer. Basically it's merely a hint for drivers to configure the system properly.
Refer to the HD-audio specification document for more details.
Takashi
On Thu, 17 Nov 2016 11:30:15 +0100, Paulo Fidalgo wrote:
@Takashi, can you confirm if the possible values we can set are the same the hdajackretask program uses on overrides?
Yes, hdajackretask allows you to set the pin configuration encoded in the expected format.
Takashi
On 14 November 2016 at 22:21, Paulo Fidalgo paulo.fidalgo.pt@gmail.com wrote:
Thanks Takashi for point out, but that document is overwhelming. I understand that developing drivers for unknown hardware should be like running in the woods with our eyes covered, but I don't feel I have the enough knowledge and time to be able to do it.
If helps, when I connect the headset running hda-analyzer tool in monitor mode I only have events related to the OUTPUT:
Watching 2 cards
Diff for codec 1/0 (0x10134208):
+++ @@ -7,17 +7,17 @@ No Modem Function Group found Default PCM: rates [0x0]: bits [0x0]: formats [0x0]: Default Amp-In caps: N/A Default Amp-Out caps: N/A GPIO: io=6, o=2, i=0, unsolicited=1, wake=1
- IO[0]: enable=1, dir=1, wake=0, sticky=0, data=1, unsol=0
- IO[0]: enable=1, dir=1, wake=0, sticky=0, data=0, unsol=0 IO[1]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 IO[2]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 IO[3]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 IO[4]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 IO[5]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
Node 0x02 [Audio Output] wcaps 0xd043d: Stereo Amp-Out Stripe Control: name="Headphone Playback Volume", index=0, device=0 ControlAmp: chs=3, dir=1, idx=0, ofs=0 @@ -225,26 +225,24 @@ Power: setting=D3, actual=D3 Connection: 1 0x02 Node 0x12 [Pin Complex] wcaps 0x400501: Stereo Pincap 0x00000050: OUT Balance Pin Default 0x90170011: [Fixed] Speaker at Int N/A Conn = Analog, Color = Unknown DefAssociation = 0x1, Sequence = 0x1
- Pin-ctls: 0x40: OUT Power: setting=D3, actual=D3 Connection: 1 0x03
Node 0x13 [Pin Complex] wcaps 0x400501: Stereo Pincap 0x00000050: OUT Balance Pin Default 0x90170012: [Fixed] Speaker at Int N/A Conn = Analog, Color = Unknown DefAssociation = 0x1, Sequence = 0x2
- Pin-ctls: 0x40: OUT Power: setting=D3, actual=D3 Connection: 1 0x04
Node 0x14 [Pin Complex] wcaps 0x400501: Stereo Pincap 0x00000050: OUT Balance Pin Default 0x90170014: [Fixed] Speaker at Int N/A Conn = Analog, Color = Unknown DefAssociation = 0x1, Sequence = 0x4
Is there any other info I can provide to help?
Kind regards,
Paulo Fidalgo
On 11 November 2016 at 20:34, Takashi Iwai tiwai@suse.de wrote:
On Thu, 10 Nov 2016 22:52:52 +0100, Paulo Fidalgo wrote:
Hi,
After reporting the issue on bugzilla (https://bugzilla.kernel.org/show_bug.cgi?id=155601) I felt I could do more in order to try to get a patch to fix the issue.
Basically when I plug an headset(mic+headphone), it only detects the headphone not the mic.
Since I assumed the "memory address" of the 0x18 pin is wrong, I've tried to change some values in order to get it working.
The value you're referring to isn't a "memory address" at all. It's a "pin configuration" value, containing the information like the location, purpose, sequence number of the given pin, and it's encoded in 32bit integer. Basically it's merely a hint for drivers to configure the system properly.
Refer to the HD-audio specification document for more details.
Takashi
participants (2)
-
Paulo Fidalgo
-
Takashi Iwai