Re: [PATCH] ALSA: pcsp: Only autoload if the pcspkr input driver is disabled

From: Takashi Iwai

Date: Fri Nov 20 2026 - 12:07:56 EST


On Fri, 20 Nov 2026 13:03:04 +0100,
Paul Menzel wrote:
>
> The input driver pcspkr and snd-pcsp both register a platform driver
> named "pcspkr" for the platform device of the same name, and both
> declare the module alias platform:pcspkr. With both built as modules,
> as distribution configurations do, udev loads both for the device, and
> the second one fails to register its driver on every boot. On a Dell
> XPS 13 9310 with Linux 7.4-rc1 and the Debian configuration:
>
> [ 0.793761] input: PC Speaker as /devices/platform/pcspkr/input/input7
> [ 0.813617] Error: Driver 'pcspkr' is already registered, aborting...
>
> Which driver ends up handling the beeps depends on the module load
> order. The help text of SND_PCSP already says that the driver is not
> needed for beeps, and that it may become the default sound card. Debian
> therefore removes the alias since 2014 [1], and Ubuntu blacklists
> snd_pcsp. With pcspkr built in, snd-pcsp cannot register its driver at
> all, so the alias is useless there, too.
>
> Only declare the alias if INPUT_PCSPKR is disabled. Then snd-pcsp is
> loaded automatically and takes over the beeps as before. Otherwise only
> pcspkr is loaded automatically, and users wanting PCM sound from the PC
> speaker keep pcspkr from loading and load snd-pcsp explicitly, which is
> already needed today for a deterministic result. Document it in the
> Kconfig help text.
>
> Tested on the Dell XPS 13 9310 with Linux 7.4-rc1 and the Debian
> configuration (INPUT_PCSPKR=m, SND_PCSP=m), with snd-pcsp not
> blacklisted: without this change, the error above is logged; with it,
> only pcspkr is loaded and provides the PC Speaker input device, and after
> `rmmod pcspkr`, `modprobe snd-pcsp` binds snd-pcsp and creates its sound
> card. In QEMU with x86_64_defconfig, kvm_guest.config and SND_PCSP=m,
> with systemd-udevd loading the modules, the same holds for
> INPUT_PCSPKR=m, and with INPUT_PCSPKR=n, snd-pcsp is still loaded
> automatically, binds the device, and creates its sound card and PC
> Speaker input device.
>
> [1]: https://bugs.debian.org/697709
>
> Signed-off-by: Paul Menzel <pmenzel@xxxxxxxxxxxxx>

Applied to for-next branch now.


thanks,

Takashi