# [SOLVED] constant ACPI events (how to prevent?)

## vose

/var/log/messages is flooded with ACPI events

Jan  7 13:47:57 greybox root[31568]: ACPI event unhandled: jack/headphone HEADPHONE unplug

Jan  7 13:47:57 greybox root[31570]: ACPI event unhandled: jack/headphone HEADPHONE plug

I would like to understand and disable whatever is generating these events (rather than create a handler to prevent the messages).

I imagine there is a bug or configuration error someplace, because I find it hard to believe that generating zillions of such events could possibly make sense.

Linux 4.1.12-gentoo #4 SMP Thu Jan 7 13:02:06 EST 2016 x86_64 Intel(R) Xeon(R) CPU E3-1270 v3 @ 3.50GHz GenuineIntel GNU/Linux

UPDATE: 

I should have mentioned that nothing is plugging or unplugging anything whatsoever... but these events are being generated anyhow!

Ill rebuild the kernel with SND_HDA_INPUT_JACK [=n] and see if that turns off the generation of these messages... but even if that "works", it would not fix the real issue which is that I would rather the events be generated only if something is actually plugged or unplugged (as apposed to their constant mysterious generation for no apparent reason).Last edited by vose on Fri Jan 08, 2016 12:21 pm; edited 2 times in total

----------

## khayyam

 *vose wrote:*   

> 
> 
> ```
> Jan  7 13:47:57 greybox root[31568]: ACPI event unhandled: jack/headphone HEADPHONE unplug
> ```
> ...

 

vose ... it's not a bug, its a feature ;) ... or more precisely how acpid is configured:

```
log_unhandled() {

   logger "ACPI event unhandled: $*"

}
```

... and then as a catchall for 'case $foo in' log_unhandled is set.

Edit that file and replace log_unhandled with a null command for whatever $group is triggering logger.

HTH & best ... khay

----------

## vose

Setting SND_HDA_INPUT_JACK [=n] results in a kernel panic after several lines of:

ahci 0000:04:00.0 failed to stop engine (-5)

Don't know if my SIIG SC-SA0E12-S1 SATA 3.0 PCI-Express 2.0 could be involved, I'll remove it and reboot.

UPDATE:

I had a missmatch between the kernel and the initramfs which presumably was behind the kernel panic.   :Confused: 

Anyhow, SND_HDA_INPUT_JACK [=n] turns the messages off (acpi_listen reports nothing) so I suppose I should be happy... yet I remain puzzled by what could have been generating all those jack/headphone events given that nothing was plugging or unplugging anything whatsoever.   :Shocked: 

UPDATE:

I'll call this closed since the kernel now stops the messages, but I remain curious as to what was the root cause of the flood of messages.

----------

## Prcek

I have also this problem. Every minute or so there is this couple of plug/unplug events:

```

Apr 21 21:50:59 holly root[15184]: ACPI event unhandled: jack/headphone HEADPHONE plug

Apr 21 21:50:59 holly root[15188]: ACPI event unhandled: jack/headphone HEADPHONE unplug

Apr 21 21:51:01 holly root[15195]: ACPI event unhandled: jack/headphone HEADPHONE plug

Apr 21 21:51:01 holly root[15197]: ACPI event unhandled: jack/headphone HEADPHONE unplug

Apr 21 21:51:21 holly root[15233]: ACPI event unhandled: jack/headphone HEADPHONE plug

Apr 21 21:51:21 holly root[15238]: ACPI event unhandled: jack/headphone HEADPHONE unplug

Apr 21 21:52:44 holly root[15395]: ACPI event unhandled: jack/headphone HEADPHONE plug

Apr 21 21:52:44 holly root[15398]: ACPI event unhandled: jack/headphone HEADPHONE unplug

Apr 21 21:52:55 holly root[15504]: ACPI event unhandled: jack/headphone HEADPHONE plug

Apr 21 21:52:55 holly root[15508]: ACPI event unhandled: jack/headphone HEADPHONE unplug

```

A suppose these events are somehow generated by hardware (maybe some spikes in voltage or something like that, I don't know).

My problem is, that pulseaudio is detecting these events. When I have muted sound, this plug event unmutes sound for a very brief moment. Then the unplug event returns pulseaudio to the muted state. But if there is some sound playing on the background during this brief moment, you can hear it in the speakers. It's really annoying.

I don't have this SND_HDA_INPUT_JACK option in my kernel config (I'm using menuconfig), just CONFIG_SND_JACK=y and CONFIG_SND_JACK_INPUT_DEV=y, but I cannot find them in the menuconfig, they are probably automatically enabled by selecting CONFIG_SND_HDA. I will try to disable them manually in the .config file.

----------

## Hu

 *Prcek wrote:*   

> I have also this problem.

 Then disable SND_HDA_INPUT_JACK. *Prcek wrote:*   

> I don't have this SND_HDA_INPUT_JACK option in my kernel config (I'm using menuconfig)

 Is the option enabled and not shown, or not enabled at all?  Are you sure this is the same problem, if the fix for the original poster does not work for you? *Prcek wrote:*   

> I cannot find them in the menuconfig, they are probably automatically enabled by selecting CONFIG_SND_HDA.

 What if you search for them? *Prcek wrote:*   

> I will try to disable them manually in the .config file.

 Do not do that.  Editing the configuration file by hand is strongly discouraged, and for good reason.

----------

## Ant P.

As a temporary workaround, you could comment out "load-module module-switch-on-port-available" in the pulseaudio config file.

----------

## Prcek

Hi Hu, thanks for the reply.

 *Quote:*   

> Is the option enabled and not shown, or not enabled at all? Are you sure this is the same problem, if the fix for the original poster does not work for you?

 

I think the kernel changed over the years and now the config options are slightly different. I can't see any JACK related options when going through the menuconfig. I'm sure the problem is the same, but I can't use the fix which worked for vose.

 *Quote:*   

> What if you search for them?

 

If I search for the word JACK in the menuconfig, it gives me this output:

```

Symbol: SND_JACK [=y]

Type  : bool

Defined at sound/core/Kconfig:32

  Depends on: SOUND [=y] && !UML && SND [=y]

Selected by [y]:

  - SND_HDA [=y] && SOUND [=y] && !UML && SND [=y]

Selected by [n]:

  - SND_SOC [=n] && SOUND [=y] && !UML && SND [=y]

  - SND_VIRTUOSO [=n] && SOUND [=y] && !UML && SND [=y] && SND_PCI [=y]

Symbol: SND_JACK_INPUT_DEV [=y]

Type  : bool

Defined at sound/core/Kconfig:36

  Depends on: SOUND [=y] && !UML && SND [=y] && SND_JACK [=y]

```

If I do zcat /proc/config.gz | grep JACK

then the ouput is following:

```

CONFIG_SND_JACK=y

CONFIG_SND_JACK_INPUT_DEV=y

```

That's why I wanted to edit my .config manually. I know that after such change I won't be probably able to detect my headphones plugged in, but I can live with that. What's bothering me is that it's just a workaround, the real problem stays the same - there are acpi plug/unplug events generated even if nothing was really plugged or unplugged  :Sad: .

----------

## Prcek

OK, I tried to disable CONFIG_SND_JACK and CONFIG_SND_JACK_INPUT_DEV in my .config file and compile the kernel, but it has no effect. The new running kernel has these options enabled regardless of what I put in the .config file.

----------

