Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Jarosław Janik" <jaroslaw.janik@gmail.com>
Cc: Takashi Iwai <tiwai@suse.de>, Takashi Iwai <tiwai@suse.com>,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 0/2] Fix beep notifications by Thinkpad's ACPI firmware
Date: Sat, 02 Nov 2024 09:27:31 +0100	[thread overview]
Message-ID: <871pzuujkc.wl-tiwai@suse.de> (raw)
In-Reply-To: <74e49336-4552-4224-9b14-204d4264d647@gmail.com>

On Sat, 02 Nov 2024 00:15:24 +0100,
Jarosław Janik wrote:
> 
> On 11/1/24 09:18, Takashi Iwai wrote:
> 
> >> Well, to what I recall - my (current) Thinkpad has never beeped on
> >> shutdown, other than that - without your "extra muting" patch - yes -
> >> beeping in every other circumstances works no matter if HDA controller
> >> is in PM suspend or not; this is what I've got used to for many years of
> >> using Thinkpads.
> > 
> > Do you mean about the beep emitted via thinkpad_acpi stuff or the
> > normal beep via terminal etc?  The latter must work even with the
> > patch, but the question is only about the former.  And that's the case
> > for the shutdown beep tone.
> 
> Yes, I meant beeps emitted by ACPI firmware and I'm not confusing them
> with beeps generated by linux console - as you said - the latter work
> fine no matter if your patch is applied or not, the former only work
> fine if that patch is reverted.

OK.

> BTW. The ACPI beeps we are talking about are not emitted by
> thinkapd_acpi module, but by ACPI firmware; you can take a look at how
> thinpad_acpi handles writes to /proc/acpi/ibm/beep - it doesn't make any
> beep itself, it just injects some "fake" ACPI event - and beep is
> generated by laptop's firmware in response to that event (the
> terminology here might not be too good, because my knowledge of ACPI is
> rather modest).
> 
> Anyway - with that being said - when it comes to the lack of beep on
> shutdown on *my* laptop - this must be because of *my* laptop's APCI
> firmware just doesn't  emit beep for this specific event.

Yes, it seems like that. 

> > You can pass snd_hda_intel.beep_mode=0 option to disable HD-audio
> > beep, verify the device being runtime-suspended, and check whether the
> > beep via thinkpad_acpi still works (after reverting).
> 
> Yes, that works.
> I've even had another test - with patch applied I increased power_save
> param in this module to 3 seconds and now:
> - when I unplug AC - there is no beep, because device is PM suspended
> - now I hit Tab in bash on linux console, kernel emits beep and keeps
> device awaken for 3 more seconds - so I quickly unplug AC - there is a
> beep, then wait ~3 seconds and plug it back - no beep now. That shall
> prove that our understanding of what's going on is OK.

For checking the runtime-suspend, at best check the sysfs file entry.
e.g. cat /sys/bus/hdaudio/devices/hdaudioC0D0/power/runtime_status

And, I see that Conexant codec doesn't have the beep generator but
it's only passthrough.  Then beep_mode option doesn't change
anything, but the "Beep" mixer volume/switch may influence on the
behavior; not only the beep volume but also the runtime-suspend
behavior.  You can try adjusting the volume/switch if it influences on
anything.

In anyway, you can try unload pcspkr module as well.  This is the
Linux input device for the beep in your case.  (For Realtek codecs,
there can be additional beep input device driven by HD-audio codec
itself, and that's managed via beep_mode module option).

Without pcspkr, the beep from the terminal shouldn't work -- unless
it's handled by the sound server like pulesaudio.  And, if I
understand correctly from your description, even without pcspkr, the
firmware beep should keep working.

As you see, the simple beeping stuff is really complex due to its
history.  Although it's a legacy feature, a few people still love it,
hence it can't go away soon :)


Takashi

  reply	other threads:[~2024-11-02  8:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-30 17:18 [PATCH 0/2] Fix beep notifications by Thinkpad's ACPI firmware Jarosław Janik
2024-10-30 17:18 ` [PATCH 1/2] Revert "ALSA: hda/conexant: Mute speakers at suspend / shutdown" Jarosław Janik
2024-10-30 17:18 ` [PATCH 2/2] Revert "ALSA: hda/generic: Add a helper to mute speakers at suspend/shutdown" Jarosław Janik
2024-10-31  9:15 ` [PATCH 0/2] Fix beep notifications by Thinkpad's ACPI firmware Takashi Iwai
2024-10-31 16:12   ` Jarosław Janik
2024-10-31 16:21     ` Takashi Iwai
2024-10-31 16:43       ` Jarosław Janik
2024-11-01  8:18         ` Takashi Iwai
2024-11-01 23:15           ` Jarosław Janik
2024-11-02  8:27             ` Takashi Iwai [this message]
2024-11-02 22:45               ` Jarosław Janik
2024-11-08 14:17                 ` Takashi Iwai
2024-11-14  0:04                   ` Jarosław Janik
2024-11-14 13:42                     ` Takashi Iwai
2024-11-15  4:34                       ` Jarosław Janik
2024-11-19 15:21                         ` Takashi Iwai
2024-11-20  1:29                           ` Jarosław Janik
2024-11-20  7:04                             ` Takashi Iwai
2024-11-20 15:00                               ` Jarosław Janik
2024-11-20 15:09                                 ` Takashi Iwai
2024-11-21  1:15                                   ` Jarosław Janik
2024-11-21 15:39                                     ` Takashi Iwai
2024-10-31 18:53   ` Thorsten Leemhuis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871pzuujkc.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=jaroslaw.janik@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox