Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Oct 2012 11:26:47 +0200
From:      Alexander Motin <mav@FreeBSD.org>
To:        Big Yuuta <init.py@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: No sound from speaker, using Realtek ALC269 and snd_hda
Message-ID:  <508F9D57.7030004@FreeBSD.org>
In-Reply-To: <CAN5iB8S_BQfRMgjYqzY6QDP6UnXPgCst49iJ9=su3CMuWZzUpg@mail.gmail.com>
References:  <CAN5iB8RJe=JY2zsDG40gtCwcf4uJBt0+txiSSuHqnZ1Ob6=HZg@mail.gmail.com> <508D8755.1080501@FreeBSD.org> <CAN5iB8T9RySw4h5HaM=pCA_G8n4yVa+Awdz4_YO8yr-FFk3iZg@mail.gmail.com> <508D98C9.30603@FreeBSD.org> <CAN5iB8QMm80VWzRFMsD=_vDN0HNLCoU2tb-Bt6n5qjUOcLHDXA@mail.gmail.com> <CAN5iB8R--Jm5o57u3_xKwN_5Cd=3zSXEWj42DdxakXptBiYqKQ@mail.gmail.com> <508DA4D0.8040604@FreeBSD.org> <CAN5iB8ShL+BbSHDXhX65_DwiMjAjUpgO273-=VpUYicD_hDjcA@mail.gmail.com> <508EA9B0.2070501@FreeBSD.org> <CAN5iB8SxZqbZqxa6R0Ywr-iFbV9_0Y--ZcUNu271nFT-Cog41g@mail.gmail.com> <508EB2F7.2000303@FreeBSD.org> <CAN5iB8RQSk7+F3EhgrJMr4kpWhZ8hEjfmuW3LmXJLf_JTPoFfQ@mail.gmail.com> <CAN5iB8S_BQfRMgjYqzY6QDP6UnXPgCst49iJ9=su3CMuWZzUpg@mail.gmail.com>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On 30.10.2012 09:17, Big Yuuta wrote:
> Hi Alexander,
>
> I got the sound out of that speaker!! :)
>
> I actually started to read your code, and I'm still trying to understand
> the stuff in it (I never wrote a device driver)
>
> Anyway, so I did a little hack'ish modification (just to test) in function
>
> 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;
>
>      // Do not mute, even if asked for. Test to be removed of course
>      lmute = 0;
>      rmute = 0;
>
>
> I know, this is absolutely NOT the way to do it, but I wanted to see
> if the speaker wasn't muted (or the mixer that controls it)
> and it -actually- WAS muted!
>
> Now, I guess I'll have to read the whole code, try to understand its
> internals, and I hope to be able to write a patch to add to hdaa_patches.c

Speaker should be muted on headphones connection. That is one of two 
ways of handling playback redirection. But it should be unmuted on 
disconnection. You may try to set sysctl hw.snd.verbose=4 and 
connect/disconnect headphones. It should report which controls are 
affected and how.

You may try this hack to use pin controls instead of muters for redirection:
--- hdaa.c      (revision 242315)
+++ hdaa.c      (working copy)
@@ -260,7 +260,7 @@
         /* (Un)Mute headphone pin. */
         ctl = hdaa_audio_ctl_amp_get(devinfo,
             w->nid, HDAA_CTL_IN, -1, 1);
-       if (ctl != NULL && ctl->mute) {
+       if (ctl != NULL && ctl->mute && 0) {
                 /* If pin has muter - use it. */
                 val = connected ? 0 : 1;
                 if (val != ctl->forcemute) {
@@ -290,7 +290,7 @@ hdaa_hpredir_handler(struct hdaa_widget *w)
                         continue;
                 ctl = hdaa_audio_ctl_amp_get(devinfo,
                     as->pins[j], HDAA_CTL_IN, -1, 1);
-               if (ctl != NULL && ctl->mute) {
+               if (ctl != NULL && ctl->mute && 0) {
                         /* If pin has muter - use it. */
                         val = connected ? 1 : 0;
                         if (val == ctl->forcemute)


-- 
Alexander Motin



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?508F9D57.7030004>