Score:0

How to disable the internal speaker through blacklist?

mx flag

I'm running the microsoft-teams-for-linux app and works fine for chat. For VoIP the mic works fine.

Sound seems to be routed to the internal speaker rather than to the headset (I had the volume low as adjusted in the GNOME desktop volume control but the sound was clearly from the internal speaker rather than the headset).

My inclination is to simply disable the internal speaker altogether as there's no circumstance I'd use it in any event.

In switching between the options I briefly had sound, but wasn't able to replicate this. The speaker test works fine. (This headset only has a single speaker.)

How do I disable the internal speaker through modprobe?

nicholas@mordor:~$ 
nicholas@mordor:~$ sudo modprobe -r pcspkr
nicholas@mordor:~$ 
nicholas@mordor:~$ lsmod | grep sound
soundwire_intel        40960  1 snd_intel_dspcfg
soundwire_generic_allocation    16384  1 soundwire_intel
soundwire_cadence      32768  1 soundwire_intel
soundwire_bus          77824  3 soundwire_intel,soundwire_generic_allocation,soundwire_cadence
snd_soc_core          294912  1 soundwire_intel
snd_pcm               118784  11 snd_hda_codec_hdmi,snd_hda_intel,snd_usb_audio,snd_hda_codec,soundwire_intel,snd_compress,snd_soc_core,snd_hda_core,snd_pcm_dmaengine
soundcore              16384  1 snd
nicholas@mordor:~$ 
nicholas@mordor:~$ lsmod | grep speaker
nicholas@mordor:~$ 
nicholas@mordor:~$ lsmod | grep spk
nicholas@mordor:~$ 
nicholas@mordor:~$ lsmod | grep audio
snd_usb_audio         299008  3
snd_usbmidi_lib        36864  1 snd_usb_audio
mc                     57344  1 snd_usb_audio
ledtrig_audio          16384  1 snd_hda_codec_generic
snd_hwdep              16384  2 snd_usb_audio,snd_hda_codec
snd_pcm               118784  11 snd_hda_codec_hdmi,snd_hda_intel,snd_usb_audio,snd_hda_codec,soundwire_intel,snd_compress,snd_soc_core,snd_hda_core,snd_pcm_dmaengine
snd                    94208  31 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_usb_audio,snd_usbmidi_lib,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_compress,snd_soc_core,snd_pcm,snd_rawmidi
nicholas@mordor:~$ 
nicholas@mordor:~$ uname -a
Linux mordor 5.11.0-25-generic #27-Ubuntu SMP Fri Jul 9 23:06:29 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
nicholas@mordor:~$ 

Sound from youtube is played through the headset fine, or as selected through the settings GUI will play on the internal speaker.

Incidentally, these modules would seem to be disabled already, as:

nicholas@mordor:~$ 
nicholas@mordor:~$ cat /etc/modprobe.d/blacklist.conf | grep pcsp
blacklist snd_pcsp
blacklist pcspkr
nicholas@mordor:~$ 

so I would expect(?) that a new(er) module is controlling internal speakers. Were these modules deprecated, perhaps, for more recent Ubuntu versions?

to confirm:

nicholas@mordor:~$ 
nicholas@mordor:~$ lsmod | grep pcspkr
nicholas@mordor:~$ 
nicholas@mordor:~$ 
nicholas@mordor:~$ lsmod | grep snd
snd_usb_audio         299008  3
snd_usbmidi_lib        36864  1 snd_usb_audio
mc                     57344  1 snd_usb_audio
snd_hda_codec_hdmi     65536  1
snd_hda_codec_realtek   143360  1
snd_hda_codec_generic    81920  1 snd_hda_codec_realtek
ledtrig_audio          16384  1 snd_hda_codec_generic
snd_hda_intel          53248  6
snd_intel_dspcfg       28672  1 snd_hda_intel
soundwire_intel        40960  1 snd_intel_dspcfg
snd_hda_codec         147456  4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek
snd_hda_core           94208  5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
snd_hwdep              16384  2 snd_usb_audio,snd_hda_codec
snd_soc_core          294912  1 soundwire_intel
snd_compress           28672  1 snd_soc_core
ac97_bus               16384  1 snd_soc_core
snd_pcm_dmaengine      16384  1 snd_soc_core
snd_pcm               118784  11 snd_hda_codec_hdmi,snd_hda_intel,snd_usb_audio,snd_hda_codec,soundwire_intel,snd_compress,snd_soc_core,snd_hda_core,snd_pcm_dmaengine
snd_seq_midi           20480  0
snd_seq_midi_event     16384  1 snd_seq_midi
snd_rawmidi            36864  2 snd_seq_midi,snd_usbmidi_lib
snd_seq                73728  2 snd_seq_midi,snd_seq_midi_event
snd_seq_device         16384  3 snd_seq,snd_seq_midi,snd_rawmidi
snd_timer              40960  2 snd_seq,snd_pcm
snd                    94208  31 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_usb_audio,snd_usbmidi_lib,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_compress,snd_soc_core,snd_pcm,snd_rawmidi
soundcore              16384  1 snd
nicholas@mordor:~$ 

and yet youtube audio, or just beeps, will play through the system speaker (if so configured thorugh sound settings).

Score:0
mx flag
blacklist snd-hda-intel

blacklist snd-hda-codec

thanks to damo22 on IRC.

I would still be curious as to how to do that either from alsa or from pulseaudio whilst leaving the drivers intact.

The other drivers, as suggested in other answers, were already disabled as described in the question.

Would be interested to know how, as the drivers were disabled, why the speaker was still enabled until the removal of these specific drivers disabled it.

alternate answers welcomed, and explanations.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.