Audio volume resets to zero on startup

Message
Author
skallal
Posts: 258
Joined: Fri Jul 28, 2023 12:47 pm

Audio volume resets to zero on startup

#1 Post by skallal »

My volume always resets to zero on wake up from a suspended state. Not certain about boot up but probably the same. I have another machine a laptop also with MX 23 XCFE that retains the previous volume after wake up and boot up. So I can only assume this is a bug on my main machine.

Here's my QSI:

Code: Select all

System:
  Kernel: 6.1.0-16-amd64 [6.1.67-1] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.0-16-amd64 root=UUID=<filter> ro quiet splash
  Desktop: Xfce v: 4.18.1 tk: Gtk v: 3.24.36 info: xfce4-panel wm: xfwm v: 4.18.0 vt: 7
    dm: LightDM v: 1.26.0 Distro: MX-23.1_x64 Libretto July 24  2023 base: Debian GNU/Linux 12
    (bookworm)
Machine:
  Type: Desktop Mobo: Gateway model: DX4850 serial: <superuser required> BIOS: American Megatrends
    v: P01-A3 date: 02/11/2011
CPU:
  Info: model: Intel Core i5-2300 bits: 64 type: MCP arch: Sandy Bridge gen: core 2 level: v2
    built: 2010-12 process: Intel 32nm family: 6 model-id: 0x2A (42) stepping: 7 microcode: 0x2F
  Topology: cpus: 1x cores: 4 smt: <unsupported> cache: L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB
    L2: 1024 KiB desc: 4x256 KiB L3: 6 MiB desc: 1x6 MiB
  Speed (MHz): avg: 2602 high: 2731 min/max: 1600/3100 scaling: driver: intel_cpufreq
    governor: ondemand cores: 1: 2441 2: 2731 3: 2611 4: 2625 bogomips: 22347
  Flags: avx ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT disabled
  Type: mds mitigation: Clear CPU buffers; SMT disabled
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data status: Unknown: No mitigations
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW, STIBP: disabled, RSB
    filling, PBRSB-eIBRS: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics
    vendor: Acer Incorporated ALI driver: i915 v: kernel arch: Gen-6 code: Sandybridge
    process: Intel 32nm built: 2011 ports: active: VGA-1 empty: DP-1,HDMI-A-1 bus-ID: 00:02.0
    chip-ID: 8086:0102 class-ID: 0300
  Display: x11 server: X.Org v: 1.21.1.7 compositor: xfwm v: 4.18.0 driver: X:
    loaded: modesetting unloaded: fbdev,vesa dri: crocus gpu: i915 display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22") s-diag: 582mm (22.93")
  Monitor-1: VGA-1 model: Asus VE278 serial: <filter> built: 2012 res: 1920x1080 hz: 60 dpi: 82
    gamma: 1.2 size: 598x336mm (23.54x13.23") diag: 686mm (27") ratio: 16:9 modes: max: 1920x1080
    min: 720x400
  API: OpenGL v: 3.3 Mesa 22.3.6 renderer: Mesa Intel HD Graphics 2000 (SNB GT1)
    direct-render: Yes
Audio:
  Device-1: Intel 6 Series/C200 Series Family High Definition Audio vendor: Acer Incorporated ALI 6
    driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:1c20 class-ID: 0403
  API: ALSA v: k6.1.0-16-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel 82579V Gigabit Network vendor: Acer Incorporated ALI driver: e1000e v: kernel
    port: f080 bus-ID: 00:19.0 chip-ID: 8086:1503 class-ID: 0200
  IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IF-ID-1: virbr0 state: down mac: <filter>
Drives:
  Local Storage: total: 694.85 GiB used: 209.04 GiB (30.1%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 840 Series size: 232.89 GiB block-size:
    physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 6B0Q scheme: MBR
  ID-2: /dev/sdb maj-min: 8:16 vendor: Crucial model: CT480BX500SSD1 size: 447.13 GiB block-size:
    physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 054 scheme: MBR
  ID-3: /dev/sdh maj-min: 8:112 type: USB vendor: Generic model: SD Card size: 14.84 GiB
    block-size: physical: 512 B logical: 512 B type: N/A serial: <filter> rev: 1.00 scheme: MBR
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
Partition:
  ID-1: / raw-size: 447.13 GiB size: 439.04 GiB (98.19%) used: 204.34 GiB (46.5%) fs: ext4
    dev: /dev/sdb1 maj-min: 8:17
Swap:
  Kernel: swappiness: 45 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 4 GiB used: 101.8 MiB (2.5%) priority: -2 file: /swap/swap
Sensors:
  System Temperatures: cpu: 54.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Repos:
  Packages: 3334 pm: dpkg pkgs: 3314 libs: 1864 tools: apt,apt-get,aptitude,nala,synaptic pm: rpm
    pkgs: 0 pm: flatpak pkgs: 20
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list
    1: deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ bullseye main
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
    1: deb http://la.mirrors.clouvider.net/debian bookworm-updates main contrib non-free
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://la.mirrors.clouvider.net/debian bookworm main contrib non-free non-free-firmware
    2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free
    3: deb http://deb.debian.org/debian bookworm main contrib
    4: deb http://deb.debian.org/debian bookworm-updates main contrib
  Active apt repos in: /etc/apt/sources.list.d/google-chrome.list
    1: deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main
  Active apt repos in: /etc/apt/sources.list.d/google-earth-pro.list
    1: deb [arch=amd64] http://dl.google.com/linux/earth/deb/ stable main
  Active apt repos in: /etc/apt/sources.list.d/microsoft-edge.list
    1: deb [arch=amd64] https://packages.microsoft.com/repos/edge/ stable main
  Active apt repos in: /etc/apt/sources.list.d/microsoft-prod.list
    1: deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/debian/11/prod bullseye main
  Active apt repos in: /etc/apt/sources.list.d/mono-official-vs.list
    1: deb https://download.mono-project.com/repo/debian vs-buster main
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb http://la.mxrepo.com/mx/repo/ bookworm main non-free
  Active apt repos in: /etc/apt/sources.list.d/ookla_speedtest-cli.list
    1: deb [signed-by=/etc/apt/keyrings/ookla_speedtest-cli-archive-keyring.gpg] https://packagecloud.io/ookla/speedtest-cli/debian/ bookworm main
    2: deb-src [signed-by=/etc/apt/keyrings/ookla_speedtest-cli-archive-keyring.gpg] https://packagecloud.io/ookla/speedtest-cli/debian/ bookworm main
  Active apt repos in: /etc/apt/sources.list.d/scootersoftware.list
    1: deb [signed-by=/usr/share/keyrings/scootersoftware-keyring.gpg] https://www.scootersoftware.com/ bcompare4 non-free
  Active apt repos in: /etc/apt/sources.list.d/vivaldi.list
    1: deb [arch=amd64] https://repo.vivaldi.com/stable/deb/ stable main
  Active apt repos in: /etc/apt/sources.list.d/vscode.list
    1: deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main
  Active apt repos in: /etc/apt/sources.list.d/winehq-bookworm.sources
    1: deb [arch=amd64 i386] https://dl.winehq.org/wine-builds/debian bookworm main
Info:
  Processes: 334 Uptime: 5d 22h 17m wakeups: 60 Memory: 15.53 GiB used: 5.4 GiB (34.7%)
  Init: systemd v: 252 target: graphical (5) default: graphical tool: systemctl Compilers:
  gcc: 12.2.0 alt: 12 Client: shell wrapper v: 5.2.15-release inxi: 3.3.26
Boot Mode: BIOS (legacy, CSM, MBR)

Jakob77
Posts: 653
Joined: Thu Feb 09, 2023 3:09 am

Re: Audio volume resets to zero on startup

#2 Post by Jakob77 »

Maybe there is a bug that needs a fix.

I don't know if it can satisfy you, I just want to share this command that I am very happy about:

Code: Select all

amixer -D pulse sset Master 65%
If it works on your computer it should be possible to put it in as a session start command connected to login.

User avatar
j2mcgreg
Global Moderator
Posts: 6824
Joined: Tue Oct 23, 2007 12:04 pm

Re: Audio volume resets to zero on startup

#3 Post by j2mcgreg »

Gateway is Acer's bargain brand and corners were cut to keep the price down but this also made them pretty glitchy. My advice is that if the computer is otherwise working well, to just live with it. Otherwise, if this is really annoying, go on Ebay or Amazon to source out a used SoundBlaster card, install it in your desktop and disable the onboard sound card in the bios.
HP 15; ryzen 3 5300U APU; 500 Gb SSD; 8GB ram
HP 17; ryzen 3 3200; 500 GB SSD; 12 GB ram
Idea Center 3; 12 gen i5; 256 GB ssd;

In Linux, newer isn't always better. The best solution is the one that works.

User avatar
siamhie
Global Moderator
Posts: 3372
Joined: Fri Aug 20, 2021 5:45 pm

Re: Audio volume resets to zero on startup

#4 Post by siamhie »

Code: Select all

Init: systemd

Can you replicate this if you boot to sys-v?

I have an issue on my computer where the volume resets to default value when logging out of my desktop and back in while booted to systemd.
It doesn't happen when I boot to sys-v.
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

User avatar
CharlesV
Global Moderator
Posts: 7392
Joined: Sun Jul 07, 2019 5:11 pm

Re: Audio volume resets to zero on startup

#5 Post by CharlesV »

+1 on Jakob77's answer. A login script with that command (or the volume of your choice should set this working correctly.

Also, I believe that was an issue that was fixed in a later pulse or pipewire fix ? You might try updating pipewire from the MX Package Installer Test repo.
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

skallal
Posts: 258
Joined: Fri Jul 28, 2023 12:47 pm

Re: Audio volume resets to zero on startup

#6 Post by skallal »

Jakob77 wrote: Sun Dec 24, 2023 8:25 am Maybe there is a bug that needs a fix.

I don't know if it can satisfy you, I just want to share this command that I am very happy about:

Code: Select all

amixer -D pulse sset Master 65%
If it works on your computer it should be possible to put it in as a session start command connected to login.
Yes the code snippet works! However I can't get it work in either .bashrc or .profile. Any ideas of where to run this script? It needs to run on login, both at boot up and wake up.

User avatar
l0dr3
Posts: 463
Joined: Wed Jun 28, 2023 11:06 am

Re: Audio volume resets to zero on startup

#7 Post by l0dr3 »

skallal wrote: Tue Dec 26, 2023 1:55 am Yes the code snippet works! However I can't get it work in either .bashrc or .profile. Any ideas of where to run this script? It needs to run on login, both at boot up and wake up.
@boot-up: create a 'Session and Startup|Application Autostart' launcher

@wake-up/resume from suspend/sleep .. there are three locations, IIRC, where to put such 'hook' scripts:

/etc/pm/sleep.d and/or: /lib/pm-utils/sleep.d
and/or:
/lib/systemd/system-sleep

see: 'man 8 pm-action', the 'FILES' section ..

Two reference postings, from which i derived a solution for me on MINT/Ubuntu-Una, to re-establish a rclone connection after wake-up-from suspend.
https://askubuntu.com/questions/1313479 ... 82#1318782
https://askubuntu.com/questions/1313395 ... 53#1313453

HTH l0dr3

Charlie Brown

Re: Audio volume resets to zero on startup

#8 Post by Charlie Brown »

Shortly:

  • Code: Select all

    sh -c 'amixer -D pulse sset Master 65%'
    in Session and Startup - Autostart (If still not working add some delay: sh -c 'sleep 2 ; amixer -D pulse sset Master 65%' )
  • Code: Select all

    sudo tee /etc/pm/sleep.d/99-Volume <<!
    #!/bin/sh
    
    PATH=/sbin:/usr/sbin:/bin:/usr/bin
    
    case "$1" in
        post)
            sleep 2 && amixer -D pulse sset Master 65%
            ;;
    esac
    !
    (Copy-Paste-Enter in a terminal and it'll be created. Click "paste" though it warns you, that warning is normal)
  • Code: Select all

    sudo chmod +x /etc/pm/sleep.d/99-Volume
Reboot

Jakob77
Posts: 653
Joined: Thu Feb 09, 2023 3:09 am

Re: Audio volume resets to zero on startup

#9 Post by Jakob77 »

skallal wrote: Tue Dec 26, 2023 1:55 am
Jakob77 wrote: Sun Dec 24, 2023 8:25 am Maybe there is a bug that needs a fix.

I don't know if it can satisfy you, I just want to share this command that I am very happy about:

Code: Select all

amixer -D pulse sset Master 65%
If it works on your computer it should be possible to put it in as a session start command connected to login.
Yes the code snippet works! However I can't get it work in either .bashrc or .profile. Any ideas of where to run this script? It needs to run on login, both at boot up and wake up.
Maybe you already got what you need.?

I have a Danish menu so I might confuse you.
If I go into Whisker and write "session" it offers me "Session and start up"

There I can choose tab >> Autostart Programs
And there I can add a command and with the button just below I can connect it to login (I guess that also covers boot up) or hibernation and a few others.
So maybe you need to add it more than one time to cover all the contexts you want it to work in.

That is just a command you add. If it doesn't work I would recommend trying a script but that is a little more complicated.
I have it in a script for session start login, and that works. I also have it in a script for starting the vlc player because it is always too loud or too silent when I have been on youtube or other places.

Post Reply

Return to “Hardware /Configuration”