linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.55k stars 741 forks source link

Can't control PC speaker volume #10361

Open canslaughter opened 3 years ago

canslaughter commented 3 years ago

Issue

My computer has a built-in speaker that produces a beep sound with adjustable volume and pitch. I know this because I can enable it in the tty by running:

$ sudo modprobe pcspkr

and in gnome-terminal by additionally enabling bell sounds in the preferences. This sound is not being produced by the speakers because it can still be heard when I plug in the headphones, which disables the speakers at the hardware level.

With xset, under gnome-terminal, I can set the pitch and duration of the bell/beep. But when I try to set the volume, the duration is changed instead.

I tried using amixer to change the volume. The beep setting can be updated but it doesn't change the volume.

The reason I think this issue is related to Cinnamon is that amixer starts working if cinnamon-settings sound is running at the same time, allowing me to change the bell volume.

Also, setting to 0 or muting the volume with amixer does not fully mute the bell. It turns it down to a minimum, but you can still hear it. The only way to mute the bell completely is to disable it with modprobe.

Steps to reproduce

In gnome-terminal:

$ printf \\a # no beep
$ sudo modprobe pcspkr ; sudo -k
$ # enable terminal bell in preferences
$ printf \\a # beep
$ cinnamon-settings sound &
[1] 4451
$ Using PAM module (python3-pam)
/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py:427: DeprecationWarning: Gtk.Window.set_wmclass is deprecated
  self.window.set_wmclass(wm_class, wm_class)
Loading Sound module

$ amixer set Beep 7
Simple mixer control 'Beep',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 7
  Mono: Playback 7 [100%] [0.00dB] [on]
$ printf \\a # loud beep
$ kill 4451
$ amixer set Beep 0 # amixer doesn't work anymore
Simple mixer control 'Beep',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 7
  Mono: Playback 0 [0%] [-28.00dB] [on]
$ printf \\a # still a loud beep

Expected behaviour

Either add a beep slider in cinnamon-settings sound or don't interfere with other sound tools trying to set the volume.

System info

System:    Kernel: 5.4.0-72-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: Cinnamon 5.0.5 
           wm: muffin dm: LightDM Distro: Linux Mint 20.2 Uma base: Ubuntu 20.04 focal 
Machine:   Type: Laptop System: LENOVO product: 20150 v: Lenovo G480 serial: <filter> Chassis: 
           type: 10 v: Lenovo G480 serial: <filter> 
           Mobo: LENOVO model: INVALID v: 31900004WIN8 STD SGL serial: <filter> 
           UEFI [Legacy]: LENOVO v: 5ECN95WW(V9.00) date: 12/19/2012 
CPU:       Topology: Dual Core model: Intel Celeron 1000M bits: 64 type: MCP arch: Ivy Bridge 
           rev: 9 L2 cache: 2048 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 7183 
           Speed: 1514 MHz min/max: 1200/1800 MHz Core speeds (MHz): 1: 1497 2: 1497 
Audio:     Device-1: Intel 7 Series/C216 Family High Definition Audio vendor: Lenovo 
           driver: snd_hda_intel v: kernel bus ID: 00:1b.0 chip ID: 8086:1e20 
           Sound Server: ALSA v: k5.4.0-72-generic 

~/.xsession-errors:

dbus-update-activation-environment: setting DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
dbus-update-activation-environment: setting DISPLAY=:0
dbus-update-activation-environment: setting XAUTHORITY=/home/canslaughter/.Xauthority
dbus-update-activation-environment: setting GTK_MODULES=gail:atk-bridge
dbus-update-activation-environment: setting QT_ACCESSIBILITY=1
dbus-update-activation-environment: setting SHELL=/bin/bash
dbus-update-activation-environment: setting QT_ACCESSIBILITY=1
dbus-update-activation-environment: setting XDG_CONFIG_DIRS=/etc/xdg/xdg-cinnamon:/etc/xdg
dbus-update-activation-environment: setting XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
dbus-update-activation-environment: setting LANGUAGE=es_AR:es
dbus-update-activation-environment: setting MANDATORY_PATH=/usr/share/gconf/cinnamon.mandatory.path
dbus-update-activation-environment: setting DESKTOP_SESSION=cinnamon
dbus-update-activation-environment: setting GTK_MODULES=gail:atk-bridge
dbus-update-activation-environment: setting PWD=/home/canslaughter
dbus-update-activation-environment: setting XDG_SESSION_DESKTOP=cinnamon
dbus-update-activation-environment: setting LOGNAME=canslaughter
dbus-update-activation-environment: setting XDG_SESSION_TYPE=x11
dbus-update-activation-environment: setting GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
dbus-update-activation-environment: setting XAUTHORITY=/home/canslaughter/.Xauthority
dbus-update-activation-environment: setting XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/canslaughter
dbus-update-activation-environment: setting GDM_LANG=es_AR
dbus-update-activation-environment: setting HOME=/home/canslaughter
dbus-update-activation-environment: setting IM_CONFIG_PHASE=1
dbus-update-activation-environment: setting LANG=es_AR.UTF-8
dbus-update-activation-environment: setting XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
dbus-update-activation-environment: setting XDG_SESSION_CLASS=user
dbus-update-activation-environment: setting DEFAULTS_PATH=/usr/share/gconf/cinnamon.default.path
dbus-update-activation-environment: setting USER=canslaughter
dbus-update-activation-environment: setting DISPLAY=:0
dbus-update-activation-environment: setting SHLVL=1
dbus-update-activation-environment: setting XDG_RUNTIME_DIR=/run/user/1000
dbus-update-activation-environment: setting GTK3_MODULES=xapp-gtk3-module
dbus-update-activation-environment: setting XDG_DATA_DIRS=/usr/share/cinnamon:/usr/share/gnome:/home/canslaughter/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
dbus-update-activation-environment: setting PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
dbus-update-activation-environment: setting GDMSESSION=cinnamon
dbus-update-activation-environment: setting DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
dbus-update-activation-environment: setting _=/usr/bin/dbus-update-activation-environment
** Message: 19:46:00.622: Existing monitor config (/home/canslaughter/.config/cinnamon-monitors.xml) not found at startup. Looking for legacy configuration (monitors.xml)
[cinnamon-settings-daemon-smartcard] Failed to start: no se ha podido encontrar un controlador de tarjetas inteligentes adecuado
[cinnamon-settings-daemon-smartcard] Failed to start: no se ha podido encontrar un controlador de tarjetas inteligentes adecuado
Cjs-Message: 19:46:04.836: Profiler is disabled. Not setting up signals.
Clutter-Message: 19:46:05.033: Sync method: PRESENTATION TIME
cinnamon-session[1037]: WARNING: t+5,92654s: Failed to start app: Unable to start application: Falló al ejecutar el proceso hijo «/usr/libexec/tracker-extract» (No such file or directory)
cinnamon-session[1037]: WARNING: t+6,73489s: Failed to start app: Unable to start application: Falló al ejecutar el proceso hijo «/usr/libexec/tracker-miner-fs» (No such file or directory)

(nm-applet:1347): libnotify-WARNING **: 19:46:06.043: Failed to connect to proxy

(nm-applet:1347): nm-applet-WARNING **: 19:46:06.060: Failed to show notification: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.Notifications” on object at path /org/freedesktop/Notifications
Cjs-Message: 19:46:09.072: JS LOG: About to start Cinnamon
cinnamon-session[1037]: WARNING: t+11,42741s: Detected that screensaver has appeared on the bus
** Message: 19:46:11.697: nemo-desktop: session is cinnamon, establishing proxy
Cjs-Message: 19:46:13.979: JS LOG: [LookingGlass/info] Cinnamon.AppSystem.get_default() started in 4783 ms
Cjs-Message: 19:46:14.018: JS LOG: [LookingGlass/info] loading user theme: /usr/share/themes/Mint-Y-Dark/cinnamon/cinnamon.css
Cjs-Message: 19:46:14.112: JS LOG: [LookingGlass/info] added icon directory: /usr/share/themes/Mint-Y-Dark/cinnamon
Cjs-Message: 19:46:15.406: JS LOG: [LookingGlass/info] loaded at Wed Sep 29 2021 19:46:15 GMT-0300 (hora estándar de Argentina)
Cjs-Message: 19:46:15.406: JS LOG: Cinnamon started at Wed Sep 29 2021 19:46:15 GMT-0300 (hora estándar de Argentina)
Cjs-Message: 19:46:15.482: JS LOG: [LookingGlass/info] ExtensionSystem started in 3 ms
Cjs-Message: 19:46:15.483: JS LOG: [LookingGlass/info] NaNms
Cjs-Message: 19:46:15.483: JS LOG: [LookingGlass/info] SearchProviderManager started in 3 ms
openGL version 4.2 detected (GL3 Cogl Driver)
MetaSyncRing disabled: couldn't find required GL extensions, or the minimum safe openGL version was not met
Cjs-Message: 19:46:15.740: JS LOG: [LookingGlass/info] Loaded applet favorites@cinnamon.org in 126 ms
Cjs-Message: 19:46:15.762: JS LOG: [LookingGlass/info] Upgrading settings for calendar@cinnamon.org
Cjs-Message: 19:46:15.763: JS LOG: [LookingGlass/info] Settings successfully upgraded for calendar@cinnamon.org
Cjs-Message: 19:46:15.894: JS LOG: [LookingGlass/info] Loaded applet calendar@cinnamon.org in 154 ms
Cjs-Message: 19:46:15.940: JS LOG: [LookingGlass/info] Role locked: notifications
Cjs-Message: 19:46:16.002: JS LOG: [LookingGlass/info] Loaded applet notifications@cinnamon.org in 108 ms
Cjs-Message: 19:46:16.042: JS LOG: [LookingGlass/info] Loaded applet workspace-switcher@cinnamon.org in 40 ms
Cjs-Message: 19:46:16.059: JS LOG: [LookingGlass/info] Loaded applet removable-drives@cinnamon.org in 17 ms
St-Message: 19:46:16.062: cogl npot texture sizes SUPPORTED
Cjs-Message: 19:46:16.087: JS LOG: [LookingGlass/info] Loaded applet keyboard@cinnamon.org in 28 ms
Cjs-Message: 19:46:16.288: JS LOG: [LookingGlass/info] Loaded applet power@cinnamon.org in 33 ms
Cjs-Message: 19:46:16.368: JS LOG: [LookingGlass/info] Upgrading settings for grouped-window-list@cinnamon.org
Cjs-Message: 19:46:16.369: JS LOG: [LookingGlass/info] Settings successfully upgraded for grouped-window-list@cinnamon.org
Cjs-Message: 19:46:16.466: JS LOG: [LookingGlass/info] Role locked: panellauncher
Cjs-Message: 19:46:16.472: JS LOG: [LookingGlass/info] Loaded applet grouped-window-list@cinnamon.org in 183 ms
Cjs-Message: 19:46:16.482: JS LOG: [LookingGlass/info] Loaded applet xapp-status@cinnamon.org in 10 ms
Cjs-Message: 19:46:16.554: JS LOG: [LookingGlass/info] Upgrading settings for show-desktop@cinnamon.org
Cjs-Message: 19:46:16.554: JS LOG: [LookingGlass/info] Settings successfully upgraded for show-desktop@cinnamon.org
Cjs-Message: 19:46:16.681: JS LOG: [LookingGlass/info] Loaded applet show-desktop@cinnamon.org in 199 ms

** (csd-power:1154): CRITICAL **: 19:46:16.717: abs_to_percentage: assertion 'max > min' failed
Cjs-Message: 19:46:16.957: JS LOG: [LookingGlass/info] Loaded applet cinnamon-timer@jake1164 in 276 ms
Cjs-Message: 19:46:16.985: JS LOG: [LookingGlass/info] Adding XAppStatusIcon: nm-applet (:1.50/org/x/StatusIcon/Icon)
Cjs-Message: 19:46:16.993: JS LOG: [LookingGlass/info] Adding XAppStatusIcon: blueberry (:1.58/org/x/StatusIcon/Icon)
Cjs-Message: 19:46:17.026: JS LOG: [LookingGlass/info] Role locked: tray
Cjs-Message: 19:46:17.031: JS LOG: [LookingGlass/info] Loaded applet systray@cinnamon.org in 74 ms
Cjs-Message: 19:46:17.098: JS LOG: [LookingGlass/info] Upgrading settings for sound@cinnamon.org
Cjs-Message: 19:46:17.099: JS LOG: [LookingGlass/info] Settings successfully upgraded for sound@cinnamon.org
Cjs-Message: 19:46:17.207: JS LOG: [LookingGlass/info] Loaded applet sound@cinnamon.org in 176 ms
Cjs-Message: 19:46:17.273: JS LOG: [LookingGlass/info] Hiding XAppStatusIcon (we have an applet): nm-applet (:1.50/org/x/StatusIcon/Icon)
Cjs-Message: 19:46:17.315: JS LOG: [LookingGlass/info] Loaded applet network@cinnamon.org in 108 ms
Cjs-Message: 19:46:17.451: JS LOG: [LookingGlass/info] Upgrading settings for menu@cinnamon.org
Cjs-Message: 19:46:17.451: JS LOG: [LookingGlass/info] Settings successfully upgraded for menu@cinnamon.org
Cjs-Message: 19:46:17.747: JS LOG: [LookingGlass/info] Loaded applet menu@cinnamon.org in 431 ms
Cjs-Message: 19:46:17.748: JS LOG: [LookingGlass/info] AppletManager started in 2338 ms
Cjs-Message: 19:46:17.754: JS LOG: [LookingGlass/info] Cinnamon took 8682 ms to start
Cjs-Message: 19:46:17.782: JS LOG: Unknown network device type, is 14
cinnamon-session[1037]: WARNING: t+21,42694s: Detected that screensaver has left the bus
Cjs-Message: 19:46:28.633: JS LOG: [LookingGlass/info] Adding XAppStatusIcon: mintUpdate.py (:1.69/org/x/StatusIcon/Icon)
Cjs-Message: 19:46:57.888: JS LOG: [LookingGlass/info] Adding XAppStatusIcon: mintreport (:1.79/org/x/StatusIcon/Icon)
/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py:427: DeprecationWarning: Gtk.Window.set_wmclass is deprecated
  self.window.set_wmclass(wm_class, wm_class)
leigh123linux commented 3 years ago

Are you sure it's a cinnamon issue?, it's more likely to be pulseaudio.