From owner-freebsd-questions@FreeBSD.ORG Wed Oct 31 16:24:26 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 9E9D0397; Wed, 31 Oct 2012 16:24:26 +0000 (UTC) (envelope-from init.py@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 B047F8FC12; Wed, 31 Oct 2012 16:24:25 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so1519107lbd.13 for ; Wed, 31 Oct 2012 09:24:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=GO8FO/ga63AfPhCU/gSUtu2JqasR2xbRAMYAtnXCD1w=; b=l0jGdL1qh/gwnCn2Jj+NAKhjnctYCYrFbCZPrFwoOupu8Rz9DEIGCmCKOSDIFmsB/2 5qzbWDC03wrwJbg5S4RgdUD929Vw7/NbEyBt4eohYiOWlrYuuzdWDBHfhxXe1srFbqIJ M2Med4Q+Xou7m+GjFzkVKkGLw6HMp1k58OajUmSpEyHuOhs6QBZdTPBJ7u2RN+WHXP2p gMOnQcYLGZfp+I/VXplJuM/lJyMVZ+EmA4NJd2xaEnTyG73lK7LB6R+G1CMLWN4qGOyN sEah6heEpSeKLS4hJNl3KvuGpx0W8VReEL1pYoIde71ANibJBwV+mkyLTobdSva17aLT wKjg== MIME-Version: 1.0 Received: by 10.112.45.231 with SMTP id q7mr14833196lbm.133.1351700664464; Wed, 31 Oct 2012 09:24:24 -0700 (PDT) Received: by 10.114.60.114 with HTTP; Wed, 31 Oct 2012 09:24:24 -0700 (PDT) In-Reply-To: <5090E2DF.1040506@FreeBSD.org> 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> <5090E2DF.1040506@FreeBSD.org> Date: Wed, 31 Oct 2012 17:24:24 +0100 Message-ID: Subject: Re: No sound from speaker, using Realtek ALC269 and snd_hda From: Big Yuuta To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 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 16:24:26 -0000 Hi Alexander, No, that patch didn't do the trick for the simple reason that my actual subid was 0x84371043 and not 0x1043837 -you spot my mistake? ;-) So here's the one that finally got me sound with my Asus EeePC 1001px on the internal speaker: --- hdaa_patches.c +++ hdaa_patches.c @@ -541,6 +541,21 @@ 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 == 0x84371043) { + 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: Now I can have a good nap thinking that somehow I contributed a tiny little bit to my favorite OS. Thank you so much, Alexander! Not only you helped me solve this problem that I had for several months, but you also got me interested in FreeBSD's internal code! On Wed, Oct 31, 2012 at 9:35 AM, Alexander Motin wrote: > 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