From owner-svn-src-all@FreeBSD.ORG Sun Jul 27 09:50:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 677029D0; Sun, 27 Jul 2014 09:50:48 +0000 (UTC) Received: from mail-qa0-x231.google.com (mail-qa0-x231.google.com [IPv6:2607:f8b0:400d:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D375E29FD; Sun, 27 Jul 2014 09:50:47 +0000 (UTC) Received: by mail-qa0-f49.google.com with SMTP id dc16so6428364qab.8 for ; Sun, 27 Jul 2014 02:50:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=K9jDfX2TuktsP8V/kj1Dsa/4WpOWNRKtzV2uofVJS24=; b=rJkH3Z+o7fYbHx1IzpIkir9qKLPjJD5WIDPZmDpJa5xhRe7WzCLxv/ba6NH7cHC11g mPc7V06n8eb+qIr6nQS4Nzr5iHJEE7OVcTI6To2aIZZVr6fjCeOFBqU5kt3jaXaFFY19 23b6lOdn+KBvpUHkck1WksXtqE3/uCct7z+UUyA7G2jXS1cCGEQH6RYQyWRNx/z4jWRE ebDaRDjIrJ1pm6FCvOQT1shVSxqi8sVboNBn9AImkGkqWEzuqb+nFktdTf0If9IrtATl g2wkkltEFJMjQy3qkKOSLg52ML0RmatePc3CGUcDtJ2GAPVcAJ5MmsE3+leY07gzOotY qEvA== MIME-Version: 1.0 X-Received: by 10.224.97.65 with SMTP id k1mr46478866qan.28.1406454646990; Sun, 27 Jul 2014 02:50:46 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Sun, 27 Jul 2014 02:50:46 -0700 (PDT) In-Reply-To: <53D4BDF4.3040207@FreeBSD.org> References: <201407131031.s6DAVTja093433@svn.freebsd.org> <53C335EF.2090606@FreeBSD.org> <53D4BA51.7070505@FreeBSD.org> <53D4BDF4.3040207@FreeBSD.org> Date: Sun, 27 Jul 2014 02:50:46 -0700 X-Google-Sender-Auth: lBPr0AbiCrXYJ08LE1P_NtfCWRM Message-ID: Subject: Re: svn commit: r268584 - head/sys/dev/sound/pci/hda From: Adrian Chadd To: Alexander Motin Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Mark Johnston , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jul 2014 09:50:48 -0000 Ok, I'll test this out and commit a fix to what's in -HEAD. Thanks! -a On 27 July 2014 01:53, Alexander Motin wrote: > On 27.07.2014 11:42, Adrian Chadd wrote: >> ... aaand it worked. Woo! > > It worked for playback, but completely broke recording. I've missed that > your CODEC does not support input switching in hardware, while driver > does not support that in software. For playback software switching is > supported by the driver, so it worked. Patch below should give you > automatic switching on playback, but still two separate recording devices. > >> So how'd it actually map the correct selection between headphones and >> speaker? That's now cutting back and forth correctly as I plug in and >> out the headphone jack. > > It tells the driver that those two inputs should be parts of one output > device, and driver following HDA specifications reads jack presence > information from respective CODEC pins. Sound actually played to both > outputs, but driver mutes one of them, depending on jack presence. > > Lenovo engineers configured the CODEC to report each pin as separate > audio device, but the problem that our sound(4) does not support > automatic switching between them. :( > >> On 27 July 2014 01:40, Adrian Chadd wrote: >>> ok, with that it looks like: >>> >>> hdaa0: 2 associations found: >>> hdaa0: Association 0 (1) out: >>> hdaa0: Pin nid=26 seq=0 >>> hdaa0: Pin nid=22 seq=15 >>> hdaa0: Association 1 (2) in: >>> hdaa0: Pin nid=29 seq=0 >>> hdaa0: Pin nid=24 seq=14 >>> hdaa0: Tracing association 0 (1) >>> hdaa0: Pin 26 traced to DAC 16 >>> hdaa0: Pin 22 traced to DAC 16 and hpredir 0 >>> hdaa0: Association 0 (1) trace succeeded >>> hdaa0: Tracing association 1 (2) >>> hdaa0: Pin 29 traced to ADC 20 >>> hdaa0: Unable to trace pin 24 to ADC 20, undo traces >>> hdaa0: Unable to trace pin 29 to ADC 21, undo traces >>> hdaa0: Association 1 (2) trace failed > > Index: hdaa_patches.c > =================================================================== > --- hdaa_patches.c (revision 269151) > +++ hdaa_patches.c (working copy) > @@ -346,6 +346,16 @@ hdac_pin_patch(struct hdaa_widget *w) > patch = "as=1 seq=15"; > break; > } > + } else if (id == HDA_CODEC_CX20561 && > + subid == LENOVO_ZZZ_SUBVENDOR) { > + switch (nid) { > + case 22: > + patch = "as=1 seq=15"; > + break; > + case 26: > + patch = "as=1 seq=0"; > + break; > + } > } else if (id == HDA_CODEC_CX20590 && > (subid == LENOVO_X1_SUBVENDOR || > subid == LENOVO_X220_SUBVENDOR || > 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) > > > -- > Alexander Motin