Volume at login

I would be sure that volume at login is quite low to not disturb.
I opened bug 2080 and waiting for a permanent solution I’d try a workaround. I would create a script to set volume but I don’t know which instruction I can use to set volume say at 20% in Pulse Audio.
Any suggestion?

Disclaimer: Although I’m kind of “living archive:stuck_out_tongue: it happens that I remember also a lot of things that might have become obsolete now.
Don’t know then if this topic could help (some posts there).

Topic is quite old and it seems not working for Pulse Audio that’s used in OMA Lx3. At that time you could set audio at login in KDE and it worked in Mandriva too.

But I’m testing a solution that’s seems working. Here’s what I did:

  1. create a script (a small text file) with this text inside:

#!/bin/sh amixer -D pulse sset Master 20%

  1. change properties of this file to “executable”

  2. in systemsettings -> Startup and Shutdown -> Auto start -> add this script and execute it at logout

It set volume at 20 % at logout and this will be volume at next login.

You may interact with PulseAuvio directly from CLI or script using pactl command. For example:

set-sink-volume SINK 20%

‘Sink’ is the name of output devices for PulseAudio. In the command abode SINK is the number of your output devices (e.g. speakers). You may get it using

pactl list sinks

or pactl list short sinks for shorter output.

I get lost. Which name I’ve to use for speakers, may be “analog-output-speaker” ?

$ pactl list sinks
Sink #0
Stato: RUNNING
Nome: alsa_output.pci-0000_00_1f.3.analog-stereo
Descrizione: Built-in Audio Analog Stereo
Driver: module-alsa-card.c
Specifica di campionamento: s16le ch 2 44100 Hz
Mappa dei canali: front-left,front-right
Modulo di appartenenza: 6
Muto: no
Volume: front-left: 65536 / 100% / 0,00 dB, front-right: 65536 / 100% / 0,00 dB
bilanciamento 0,00
Volume base: 65536 / 100% / 0,00 dB
Monitor della sorgente: alsa_output.pci-0000_00_1f.3.analog-stereo.monitor
Latenza: 63192 usec, configurata 66000 usec
Flag: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
Proprietà:
alsa.resolution_bits = “16”
device.api = “alsa”
device.class = “sound”
alsa.class = “generic”
alsa.subclass = “generic-mix”
alsa.name = “ALC3227 Analog”
alsa.id = “ALC3227 Analog”
alsa.subdevice = “0”
alsa.subdevice_name = “subdevice #0
alsa.device = “0”
alsa.card = “0”
alsa.card_name = “HDA Intel PCH”
alsa.long_card_name = “HDA Intel PCH at 0xa1428000 irq 127”
alsa.driver_name = “snd_hda_intel”
device.bus_path = “pci-0000:00:1f.3”
sysfs.path = “/devices/pci0000:00/0000:00:1f.3/sound/card0”
device.bus = “pci”
device.vendor.id = “8086”
device.vendor.name = “Intel Corporation”
device.product.id = “9d70”
device.product.name = “Sunrise Point-LP HD Audio”
device.form_factor = “internal”
device.string = “front:0”
device.buffering.buffer_size = “352800”
device.buffering.fragment_size = “176400”
device.access_mode = “mmap+timer”
device.profile.name = “analog-stereo”
device.profile.description = “Analog Stereo”
device.description = “Built-in Audio Analog Stereo”
alsa.mixer_name = “Realtek ALC3227”
alsa.components = “HDA:10ec0282,103c8136,00100003 HDA:80862809,80860101,00100000”
module-udev-detect.discovered = “1”
device.icon_name = “audio-card-pci”
Porte:
analog-output-speaker: Speakers (priority: 10000)
analog-output-headphones: Headphones (priority: 9000, not available)
Porta attiva: analog-output-speaker
Formati:
pcm

$ pactl list short sinks
0 alsa_output.pci-0000_00_1f.3.analog-stereo module-alsa-card.c s16le ch 2 44100 Hz RUNNING

Try:

$ pactl set-sink-volume 0 20%

got that from:

$ pactl list sinks
Sink #0
3 Likes

Yes, PulseAudio names interfaces with number, so use 0 in you case.

Tanks @ben79 fox the fix.

[quote=“ben79, post:6, topic:1054”]
Try:

$ pactl set-sink-volume 0 20%
[/quote]This command works in script too. Then I have two possibilities:

pactl set-sink-volume 0 20%

or

amixer -D pulse sset Master 20%.

Thanks to all.