No sound from speaker, using Realtek ALC269 and snd_hda
Big Yuuta
init.py at gmail.com
Wed Oct 31 16:24:26 UTC 2012
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 <mav at freebsd.org> 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
More information about the freebsd-questions
mailing list