From owner-svn-src-all@FreeBSD.ORG Sun Jul 27 08:53:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F719B34; Sun, 27 Jul 2014 08:53:14 +0000 (UTC) Received: from mail-wg0-x230.google.com (mail-wg0-x230.google.com [IPv6:2a00:1450:400c:c00::230]) (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 0D53A2540; Sun, 27 Jul 2014 08:53:12 +0000 (UTC) Received: by mail-wg0-f48.google.com with SMTP id x13so5971710wgg.19 for ; Sun, 27 Jul 2014 01:53:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=GVhs0wQHhjswKgMGsiOwCZhpnLgm15PbEDQ3L23VyX4=; b=ZqWBc5NhltuH/ficZlBRjiprMdEGmtDUkiOZb3nRGkwtMuGJ6/o4dYAIzShpNZmBkX uwpwCSjdk7LAumSYSsThI1b0AEelLMnj9Dxdf1MCEvfbZyP6RPwwUdkcOC4Y2rFOGQmz b1ll76m43v2f4Yyihm5AoBMiBJRKWjPc8k0TrvFRqhbp8wD6/ftfTcsn/zS7vbvqcj/o Dth+om5O2zcEw/AojzFDH/WUcY/8sVlM4U9+KTZ0tTDDnzS3fiSbvfoQ3Ha5VNljrtU/ qzjYnOVtzRzdgL6RlMkj7IJCVww3soNjL2nGwa2vY3UB4UNNY1ogvSsvUsdUAyD1htH7 T1bQ== X-Received: by 10.194.84.69 with SMTP id w5mr10267711wjy.0.1406451191214; Sun, 27 Jul 2014 01:53:11 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id d12sm39938289wjx.0.2014.07.27.01.53.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 27 Jul 2014 01:53:10 -0700 (PDT) Sender: Alexander Motin Message-ID: <53D4BDF4.3040207@FreeBSD.org> Date: Sun, 27 Jul 2014 11:53:08 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r268584 - head/sys/dev/sound/pci/hda References: <201407131031.s6DAVTja093433@svn.freebsd.org> <53C335EF.2090606@FreeBSD.org> <53D4BA51.7070505@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 08:53:14 -0000 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