Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Feb 2015 23:41:51 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 197773] [snd_hda][patch] Sending a devctl notifications when headphones are connected/disconnected
Message-ID:  <bug-197773-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197773

            Bug ID: 197773
           Summary: [snd_hda][patch] Sending a devctl notifications when
                    headphones are connected/disconnected
           Product: Base System
           Version: 10.1-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: ebfe@inbox.ru

It would be nice to have devctl/devd notifications when headphones are
connected/disconnected.

E.g.,
cat /var/run/devd.pipe
!system=SND_HDA subsystem=headphones type=connection state=disconnected
!system=SND_HDA subsystem=headphones type=connection state=connected

So, with some devd.conf-magic one could easily preserve and restore mixer (or
hw.snd.default_unit) settings.

Maybe, something like this:
Index: /usr/src/sys/dev/sound/pci/hda/hdaa.c
===================================================================
*** /usr/src/sys/dev/sound/pci/hda/hdaa.c    (revision 278924)
--- /usr/src/sys/dev/sound/pci/hda/hdaa.c    (working copy)
***************
*** 381,394 ****
--- 381,397 ----
      struct hdaa_devinfo *devinfo = w->devinfo;
      struct hdaa_audio_as *as = &devinfo->as[w->bindas];
      struct hdaa_widget *w1;
      struct hdaa_audio_ctl *ctl;
      uint32_t val;
      int j, connected = w->wclass.pin.connected;

+     devctl_notify("SND_HDA", "headphones", "connection", 
+         connected ? "state=connected" : "state=disconnected");
+ 
      HDA_BOOTVERBOSE(
          device_printf((as->pdevinfo && as->pdevinfo->dev) ?
              as->pdevinfo->dev : devinfo->dev,
              "Redirect output to: %s\n",
              connected ? "headphones": "main");
      );
      /* (Un)Mute headphone pin. */

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-197773-8>