Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Jul 2014 01:37:12 -0700
From:      Adrian Chadd <adrian@freebsd.org>
To:        Alexander Motin <mav@freebsd.org>
Cc:        "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, Mark Johnston <markj@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>
Subject:   Re: svn commit: r268584 - head/sys/dev/sound/pci/hda
Message-ID:  <CAJ-Vmok%2B9YdfM9sb_iD2uvGwAsHttQSoNqWP9e5Td9T7bUNbHg@mail.gmail.com>
In-Reply-To: <53D4B853.8040305@FreeBSD.org>
References:  <201407131031.s6DAVTja093433@svn.freebsd.org> <CAJ-Vmo=hsK6k6VPcig69srL%2BV_AO5yQo4z%2B2XycvGB6_fRwSGg@mail.gmail.com> <53C335EF.2090606@FreeBSD.org> <CAJ-VmomUm7JdNk-aX2UOKQMO9LhRh6LhPTNBQu8MCJ%2BPtnWLKw@mail.gmail.com> <53D4B853.8040305@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 27 July 2014 01:29, Alexander Motin <mav@freebsd.org> wrote:
> On 27.07.2014 11:20, Adrian Chadd wrote:
>> ok, so how do I figure out what the right patch should be?
>>
>> pcm0: <Conexant CX20561 (Hermosa) (Front Analog)> at nid 22 and 24 on hdaa0
>> pcm1: <Conexant CX20561 (Hermosa) (Internal Analog)> at nid 26 and 29 on hdaa0
>>
>> .. and
>>
>> hdac0@pci0:0:27:0: class=0x040300 card=0x20f217aa chip=0x293e8086
>> rev=0x03 hdr=0x00
>
> Technically there is not all of required info shown above, but assuming
> some likeness I would try this (just replace ZZZ with your model name):
>
> Index: hdaa_patches.c
> ===================================================================
> --- hdaa_patches.c      (revision 269151)
> +++ hdaa_patches.c      (working copy)
> @@ -340,7 +340,8 @@ hdac_pin_patch(struct hdaa_widget *w)
>                 }
>             }
>         } else if (id == HDA_CODEC_CX20561 &&
> -           subid == LENOVO_B450_SUBVENDOR) {
> +           (subid == LENOVO_B450_SUBVENDOR ||
> +           subid == LENOVO_ZZZ_SUBVENDOR)) {
>                 switch (nid) {
>                 case 22:
>                         patch = "as=1 seq=15";
> Index: hdac.h
> ===================================================================
> --- hdac.h      (revision 269151)
> +++ hdac.h      (working copy)
> @@ -236,6 +236,7 @@
>  #define        LENOVO_X1CRBN_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f9)
>  #define LENOVO_X220_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21da)
>  #define LENOVO_X300_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac)
> +#define LENOVO_ZZZ_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x20f2)
>  #define        LENOVO_T420_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce)
>  #define        LENOVO_T430_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21f3)
>  #define        LENOVO_T430S_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21fb)

So I have:

adrian@lucy-11i386:~/work/freebsd/head/src/sys/dev/sound/pci/hda % svn diff .
Index: hdaa_patches.c
===================================================================
--- hdaa_patches.c (revision 268931)
+++ hdaa_patches.c (working copy)
@@ -154,6 +154,8 @@
  id = hdaa_codec_id(w->devinfo);
  subid = hdaa_card_id(w->devinfo);

+ printf("%s: id=0x%08x; subid=0x%08x; nid=%d\n", __func__, id, subid, nid);
+
  /* XXX: Old patches require complete review.
  * Now they may create more problem then solve due to
  * incorrect associations.
@@ -340,9 +342,10 @@
  }
     }
  } else if (id == HDA_CODEC_CX20561 &&
-    subid == LENOVO_B450_SUBVENDOR) {
+    (subid == LENOVO_T400_SUBVENDOR ||
+    subid == LENOVO_B450_SUBVENDOR)) {
  switch (nid) {
- case 22:
+ case 22: /* headphones */
  patch = "as=1 seq=15";
  break;
  }
Index: hdac.h
===================================================================
--- hdac.h (revision 268931)
+++ hdac.h (working copy)
@@ -236,6 +236,7 @@
 #define LENOVO_X1CRBN_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f9)
 #define LENOVO_X220_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21da)
 #define LENOVO_X300_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac)
+#define LENOVO_T400_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20f2)
 #define LENOVO_T420_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce)
 #define LENOVO_T430_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f3)
 #define LENOVO_T430S_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21fb)
adrian@lucy-11i386:~/work/freebsd/head/src/sys/dev/sound/pci/hda %


But it still chooses the speakers as pcm0:

adrian@lucy-11i386:~/work/freebsd/head/src/sys/dev/sound/pci/hda % dmesg
pcm0: detached
pcm1: detached
hdaa0: detached
hdacc0: detached
hdac0: detached
pci0: <multimedia, HDA> at device 27.0 (no driver attached)
snd_unit_init() u=0x00ff8000 [512] d=0x00007c00 [32] c=0x000003ff [1024]
feeder_register: snd_unit=-1 snd_maxautovchans=16 latency=5
feeder_rate_min=1 feeder_rate_max=2016000 feeder_rate_round=25
pci0: driver added
found-> vendor=0x8086, dev=0x2a44, revid=0x07
domain=0, bus=0, slot=3, func=0
class=07-80-00, hdrtype=0x00, mfdev=1
cmdreg=0x0006, statreg=0x0010, cachelnsz=0 (dwords)
lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
intpin=a, irq=16
powerspec 3  supports D0 D3  current D0
MSI supports 1 message, 64 bit
pci0:0:3:0: reprobing on driver added
found-> vendor=0x8086, dev=0x293e, revid=0x03
domain=0, bus=0, slot=27, func=0
class=04-03-00, hdrtype=0x00, mfdev=0
cmdreg=0x0506, statreg=0x0010, cachelnsz=16 (dwords)
lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
intpin=b, irq=17
powerspec 2  supports D0 D3  current D0
MSI supports 1 message, 64 bit
pci0:0:27:0: reprobing on driver added
hdac0: <Intel 82801I HDA Controller> mem 0xfc020000-0xfc023fff irq 17
at device 27.0 on pci0
hdac0: PCI card vendor: 0x17aa, device: 0x20f2
hdac0: HDA Driver Revision: 20120126_0002
hdac0: Config options: on=0x00000000 off=0x00000000
hdac0: attempting to allocate 1 MSI vectors (1 supported)
msi: routing MSI IRQ 258 to local APIC 1 vector 54
hdac0: using IRQ 258 for MSI
hdac0: Caps: OSS 4, ISS 4, BSS 0, NSDO 1, 64bit, CORB 256, RIRB 256
found-> vendor=0x8086, dev=0x2930, revid=0x03
domain=0, bus=0, slot=31, func=3
class=0c-05-00, hdrtype=0x00, mfdev=0
cmdreg=0x0103, statreg=0x0280, cachelnsz=0 (dwords)
lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
intpin=a, irq=23
pci0:0:31:3: reprobing on driver added
pci2: driver added
pci3: driver added
pci5: driver added
pci13: driver added
pci21: driver added
found-> vendor=0x1180, dev=0x0832, revid=0x04
domain=0, bus=21, slot=0, func=1
class=0c-00-10, hdrtype=0x00, mfdev=1
cmdreg=0x0106, statreg=0x0210, cachelnsz=16 (dwords)
lattimer=0x20 (960 ns), mingnt=0x02 (500 ns), maxlat=0x04 (1000 ns)
intpin=b, irq=17
powerspec 2  supports D0 D1 D2 D3  current D0
pci0:21:0:1: reprobing on driver added
hdacc0: <Conexant CX20561 (Hermosa) HDA CODEC> at cad 0 on hdac0
hdaa0: <Conexant CX20561 (Hermosa) Audio Function Group> at nid 1 on hdacc0
hdaa0: Subsystem ID: 0x17aa211c
hdaa0: NumGPIO=4 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
hdaa0:  GPIO0: disabled
hdaa0:  GPIO1: disabled
hdaa0:  GPIO2: disabled
hdaa0:  GPIO3: disabled
hdaa0: Original pins configuration:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0: 22 022140f0 15 0  Headphones    Jack  1/8     Front      Green   0
hdaa0: 23 61a190f0 15 0  Mic           None  1/8     Ext-Rear   Pink    0
hdaa0: 24 02a190f0 15 0  Mic           Jack  1/8     Front      Pink    0
hdaa0: 25 40f000f0 15 0  Other         None  Unknown 0x00       Unknown 0
hdaa0: 26 901701f0 15 0  Speaker       Fixed Analog  Internal   Unknown 1
hdaa0: 27 40f001f0 15 0  Other         None  Unknown 0x00       Unknown 1
hdaa0: 28 40f001f0 15 0  Other         None  Unknown 0x00       Unknown 1
hdaa0: 29 90a601f0 15 0  Mic           Fixed Digital Internal   Unknown 1
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=22
hdaa0: Patching pin config nid=22 0x022140f0 -> 0x0221401f
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=23
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=24
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=25
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=26
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=27
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=28
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=29
hdaa0: Patched pins configuration:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0: 22 0221401f 1  15 Headphones    Jack  1/8     Front      Green   0
hdaa0: 23 61a190f0 15 0  Mic           None  1/8     Ext-Rear   Pink    0 DISA
hdaa0: 24 02a190f0 15 0  Mic           Jack  1/8     Front      Pink    0
hdaa0: 25 40f000f0 15 0  Other         None  Unknown 0x00       Unknown 0 DISA
hdaa0: 26 901701f0 15 0  Speaker       Fixed Analog  Internal   Unknown 1
hdaa0: 27 40f001f0 15 0  Other         None  Unknown 0x00       Unknown 1 DISA
hdaa0: 28 40f001f0 15 0  Other         None  Unknown 0x00       Unknown 1 DISA
hdaa0: 29 90a601f0 15 0  Mic           Fixed Digital Internal   Unknown 1
hdaa0: 4 associations found:
hdaa0: Association 0 (1) out:
hdaa0:  Pin nid=22 seq=15
hdaa0: Association 1 (15) in:
hdaa0:  Pin nid=24 seq=0
hdaa0: Association 2 (15) out:
hdaa0:  Pin nid=26 seq=0
hdaa0: Association 3 (15) in:
hdaa0:  Pin nid=29 seq=0
hdaa0: Tracing association 0 (1)
hdaa0:  Pin 22 traced to DAC 16
hdaa0: Association 0 (1) trace succeeded
hdaa0: Tracing association 1 (15)
hdaa0:  Unable to trace pin 24 to ADC 20, undo traces
hdaa0:  Pin 24 traced to ADC 21
hdaa0: Association 1 (15) trace succeeded
hdaa0: Tracing association 2 (15)
hdaa0:  Pin 26 traced to DAC 17
hdaa0: Association 2 (15) trace succeeded
hdaa0: Tracing association 3 (15)
hdaa0:  Pin 29 traced to ADC 20
hdaa0: Association 3 (15) trace succeeded
hdaa0: Looking for additional DAC for association 0 (1)
hdaa0: Looking for additional ADC for association 1 (15)
hdaa0: Looking for additional DAC for association 2 (15)
hdaa0: Looking for additional ADC for association 3 (15)
hdaa0: Tracing input monitor
hdaa0: Tracing other input monitors
hdaa0:  Tracing nid 24 to out
hdaa0:  Tracing nid 29 to out
hdaa0: Tracing beeper
hdaa0: FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivref
pcm0: <Conexant CX20561 (Hermosa) (Front Analog)> at nid 22 and 24 on hdaa0
pcm0: Playback:
pcm0:      Stream cap: 0x00000001 PCM
pcm0:         PCM cap: 0x000e0560 16 20 24 bits, 44 48 96 192 KHz
pcm0:             DAC: 16
pcm0:
pcm0:     nid=22 [pin: Headphones (Green Jack)]
pcm0:       + <- nid=16 [audio output] [src: pcm]
pcm0:
pcm0: Record:
pcm0:      Stream cap: 0x00000001 PCM
pcm0:         PCM cap: 0x000e0160 16 20 24 bits, 44 48 96 KHz
pcm0:             ADC: 21
pcm0:
pcm0:     nid=21 [audio input]
pcm0:       + <- nid=24 [pin: Mic (Pink Jack)] [src: mic]
pcm0:
pcm0: Master Volume (OSS: vol): -74/0dB
pcm0:    +- ctl  1 (nid  16 out):    -74/0dB (75 steps)
pcm0:
pcm0: PCM Volume (OSS: pcm): -74/0dB
pcm0:    +- ctl  1 (nid  16 out):    -74/0dB (75 steps)
pcm0:
pcm0: Microphone Volume (OSS: mic): 0/40dB
pcm0:    +- ctl  5 (nid  21 in   0): -74/6dB (81 steps)
pcm0:    +- ctl  7 (nid  24 out):    0/40dB (5 steps)
pcm0:
pcm0: Speaker/Beep Volume (OSS: speaker): -18/0dB
pcm0:    +- ctl  3 (nid  19 out):    -18/0dB (4 steps)
pcm0:
pcm0: Recording Level (OSS: rec): -74/6dB
pcm0:    +- ctl  5 (nid  21 in   0): -74/6dB (81 steps)
pcm0:    +- ctl  7 (nid  24 out):    0/40dB (5 steps)
pcm0:
pcm0: Mixer "vol":
pcm0: Mixer "pcm":
pcm0: Mixer "speaker":
pcm0: Mixer "mic":
pcm0: Mixer "rec":
pcm0: Playback channel matrix is: unknown, assuming 2.0 (disconnected)
pcm0: Recording channel set is: Front Left, Front Right,
pcm0: Recording channel matrix is: 2.0 (disconnected)
pcm1: <Conexant CX20561 (Hermosa) (Internal Analog)> at nid 26 and 29 on hdaa0
pcm1: Playback:
pcm1:      Stream cap: 0x00000001 PCM
pcm1:         PCM cap: 0x000e0560 16 20 24 bits, 44 48 96 192 KHz
pcm1:             DAC: 17
pcm1:
pcm1:     nid=26 [pin: Speaker (Fixed)]
pcm1:       + <- nid=17 [audio output] [src: pcm]
pcm1:
pcm1: Record:
pcm1:      Stream cap: 0x00000001 PCM
pcm1:         PCM cap: 0x000e0160 16 20 24 bits, 44 48 96 KHz
pcm1:             ADC: 20
pcm1:
pcm1:     nid=20 [audio input]
pcm1:       + <- nid=29 [pin: Mic (Fixed)] [src: monitor]
pcm1:
pcm1: Master Volume (OSS: vol): -74/0dB
pcm1:    +- ctl  2 (nid  17 out):    -74/0dB (75 steps)
pcm1:
pcm1: PCM Volume (OSS: pcm): -74/0dB
pcm1:    +- ctl  2 (nid  17 out):    -74/0dB (75 steps)
pcm1:
pcm1: Microphone2 Volume (OSS: monitor): 0/48dB
pcm1:    +- ctl  4 (nid  20 in   0): -74/6dB (81 steps)
pcm1:    +- ctl  8 (nid  29 out):    0/48dB (5 steps)
pcm1:
pcm1: Recording Level (OSS: rec): -74/6dB
pcm1:    +- ctl  4 (nid  20 in   0): -74/6dB (81 steps)
pcm1:    +- ctl  8 (nid  29 out):    0/48dB (5 steps)
pcm1:
pcm1: Mixer "vol":
pcm1: Mixer "pcm":
pcm1: Mixer "rec":
pcm1: Mixer "ogain":
pcm1: Mixer "monitor":
pcm1: Playback channel set is: Front Left, Front Right,
pcm1: Playback channel matrix is: 2.0 (unknown)
pcm1: Automatically set rec source to: monitor
pcm1: Recording channel set is: Front Left, Front Right,
pcm1: Recording channel matrix is: 2.0 (unknown)
unknown: <Conexant CX20561 (Hermosa) HDA CODEC Modem Function Group>
at nid 2 on hdacc0 (no driver attached)
hdacc0: Subsystem ID: 0xf250584c
adrian@lucy-11i386:~/work/freebsd/head/src/sys/dev/sound/pci/hda %



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmok%2B9YdfM9sb_iD2uvGwAsHttQSoNqWP9e5Td9T7bUNbHg>