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
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"

Reply via email to