From owner-freebsd-questions@FreeBSD.ORG Wed Oct 31 08:35:49 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E824A131 for ; Wed, 31 Oct 2012 08:35:49 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 56FDA8FC0C for ; Wed, 31 Oct 2012 08:35:49 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so1089385lbd.13 for ; Wed, 31 Oct 2012 01:35:48 -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=zR7cMbfz9NiuVOPr4UUGP44Q/vL35lcoKMSlpjDJLOI=; b=Yu78Hnmo8zoA7M+vbX3QbTPIsXxTieRB88qeltZ9ZFcb88tUlBYHwyg23KKeP4/ER1 7uPvBItDORJRYImjHdI/bO+5NDRln5w9ixbxupYfMX1iXiKeoSS4k6kIZjrfeqrJ+yXN 84fqLP4XcQq5BTWpUnsZj1yL3Ba8bbDLCw/u4ylaCeaETqoyVVhZAnry/YuTGsZMOlhz IcVNwpH21df8DRNFbXGKuz3YHLahXWjhjelWfwqmx7gI4N03Nb0ETgLtv9GJlFtX8e2C EM/jlbakuUcdDFuM/+h1OGUn1RjbRThUqDVNsISnu4/0okUh8hcbKg41xiCd2kpRAkit PL0g== Received: by 10.152.148.40 with SMTP id tp8mr32919263lab.30.1351672548302; Wed, 31 Oct 2012 01:35:48 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPS id e4sm1145556lby.12.2012.10.31.01.35.45 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 31 Oct 2012 01:35:47 -0700 (PDT) Sender: Alexander Motin Message-ID: <5090E2DF.1040506@FreeBSD.org> Date: Wed, 31 Oct 2012 10:35:43 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120628 Thunderbird/13.0.1 MIME-Version: 1.0 To: Big Yuuta Subject: Re: No sound from speaker, using Realtek ALC269 and snd_hda References: <508D8755.1080501@FreeBSD.org> <508D98C9.30603@FreeBSD.org> <508DA4D0.8040604@FreeBSD.org> <508EA9B0.2070501@FreeBSD.org> <508EB2F7.2000303@FreeBSD.org> <508F9D57.7030004@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 08:35:50 -0000 On 31.10.2012 03:00, Big Yuuta wrote: > Yes, actually I'm using sysctl hw.snd.verbose=4 to understand > what's happening inside. > > From my tests, it's not a sense redirection problem. Because, when > I unmute everything, and then I plug a headphone, the sound goes > to the headphone and the internal speaker is mutted, and when I unplug > it, the internal speaker gets the sound, and (nid 26: the headphone) > is mutted. > > So, anyway, I'm still debugging it and I found out that I don't have > to "unmute" everything, I just have to make sure that nid=15 is never > mutted. > > i.e. the test I wrote in my last email could be more precise like this: > > hdaa_audio_ctl_amp_set_internal(struct hdaa_devinfo *devinfo, nid_t nid, > int index, int lmute, int rmute, > int left, int right, int dir) > { > uint16_t v = 0; > > if(nid == 15){ //just don't mute nid15, and it works > lmute = 0; > rmute = 0; > } > > > Strange thing is from my dmesg here: http://dpaste.com/818967/plain/ > I thought that nid 15 wasn't used. > > hdaa0: nid: 15 [DISABLED] > hdaa0: Name: audio mixer > hdaa0: Widget cap: 0x0020010a > hdaa0: Input amp: 0x80000000 > hdaa0: mute=1 step=0 size=0 offset=0 > hdaa0: connections: 2 > hdaa0: | > hdaa0: + [DISABLED] <- nid=2 [audio output] > hdaa0: + [DISABLED] <- nid=11 [audio mixer] > > Maybe it's disabled because others were disabled for other reasons? > I honestly don't grok the whole thing yet. The driver reports as disabled all parts of the CODEC that are unused in specific configuration. It is quite usual to have half of CODEC unused. To avoid unexpected effects driver mutes all disabled controls. According to information reported by CODEC, this mixer is really unused. I see no problem from the driver side there. > We, IMVHO, probably just should add a patch inside hdaa_patches.c > for this case: > > case HDA_CODEC_ALC269: > if (subid == 0x10438437){ //0x10438437 is my subsystem id. > w = hdaa_widget_get(devinfo, 15); > if(w != NULL) > //some magic to unmute it ? > } > break; > > What do you think? I think Realtek engineers got crazy. They not only created several different CODECs sharing the same ID (my laptop also uses variant of ALC269, but it has no such problem), but also violated their own specs and information reported by CODEC. Patch below should hide problematic muter from the driver. Solution is far from perfect, but that is best I can propose without having more information. Please test it and report about results. --- hdaa_patches.c (revision 242352) +++ hdaa_patches.c (working copy) @@ -541,6 +541,21 @@ hdaa_patch(struct hdaa_devinfo *devinfo) if (w != NULL) w->connsenable[0] = 0; break; + case HDA_CODEC_ALC269: + /* + * ASUS EeePC 1001px has strange variant of ALC269 CODEC, + * that mutes speaker if unused mixer at NID 15 is muted. + * Probably CODEC incorrectly reports internal connections. + * Hide that muter from the driver. There are several CODECs + * sharing this ID and I have not enough information about + * them to implement more universal solution. + */ + if (subid == 0x10438437) { + w = hdaa_widget_get(devinfo, 15); + if (w != NULL) + w->param.inamp_cap = 0; + } + break; case HDA_CODEC_CX20582: case HDA_CODEC_CX20583: case HDA_CODEC_CX20584: -- Alexander Motin