0

This is similar question as Set volume from terminal but I want to set system sound volume (libcanbera system sounds) that is at 0 when I've first installed Fedora (the same was on Xubuntu).

Is it possible to set it to 100 from command line, the output of amixer scontrols is:

Simple mixer control 'Master',0
Simple mixer control 'Capture',0

no system

jcubic
  • 9,932

1 Answers1

2

ALSA only, no pulseaudio: There is no "system sound volume", all you can do is set the hardware volume that applies to all sounds. First, find the correct card with aplay -l. Say you are using card 2. Then,

amixer -c2 set Master 100%

will set the master hardware volume to 100%. You can also increase or decrease it:

amixer -c2 set Master 2%+
amixer -c2 set Master 2%+

If you are running Pulseaudio (very likely if you have "system sounds"): You can set the volume both for "sinks" (something that corresponds to some set of speakers, roughly the same as the ALSA Master volume), or for applications (confusingly, those are described as "sink-inputs" for volume control).

However, system sounds are very short, so the default volume for those comes from a database entry called sink-input-by-media-role:event in the stream database, which is in ~/.pulse/*-stream.tdb on my Debian system. This is a "trivial data base" format, and tdbtool from Samba can be used to manipulate it from the commandline. However, the key content is in binary (18 bytes), so the next step would be to find out the format (guess or read pavucontrol source), which I didn't do. Then you can use something similar to

tdbtool ~/.pulse/*-stream.tdb store sink-input-by-media-role:event binary_data

to change it.

dirkt
  • 32,309
  • Did you manage to figure out the format? – pts Oct 13 '20 at 23:36
  • 1
    @pts I didn't spend time on it, feel free to do so and add comments or another answer. – dirkt Oct 14 '20 at 06:41
  • What even is "System Sounds" as reported by the PulseAudio GUI, anyway? It always seems to be muted by default on any system I've touched so far, and I haven't really noticed anything new with it unmuted. – Mona the Monad Oct 14 '20 at 15:11
  • @MonatheMonad It's for streams tagged with the media.role=even property, that are supposed to represent sounds emitted by the "system" (desktop) for events (e.g. receiving mail). Not that it gets used much ... – dirkt Oct 14 '20 at 16:52