How can I reset sound in Plasma without logging out?

Recently I have problems with VLC using ALSA that output only in stereo https://forum.manjaro.org/t/vlc-problem-with-ac-3-sound-in-videos/176960

To reset the sound to play surround I had to log out and log in. Is there a way to reset the sound staying in the session, so I do not have to reopen all programs etc. ?

I tried killall pipewire , but that did not bring the sound back even though pipewire and pipewire-pulse processes restarted. I had to restart the PC to bring everything in order.

Which command can I run to reset the sound?

$ sudo systemctl restart pipewire-session-manager
Failed to restart pipewire-session-manager.service: Unit pipewire-session-manager.service not found.

$ sudo systemctl restart pipewire
Failed to restart pipewire.service: Unit pipewire.service not found.
$ inxi -zv8
System:
  Kernel: 6.14.0-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
    clocksource: tsc avail: hpet,acpi_pm
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.14-x86_64
    root=UUID=c967ec04-7002-4176-a843-d0269a60e2e9 rw nowatchdog
    mitigations=off security=none udev.log_priority=3 noresume nohibernate
  Desktop: KDE Plasma v: 6.3.4 tk: Qt v: N/A info: frameworks v: 6.12.0
    wm: kwin_x11 with: krunner vt: 2 dm: SDDM Distro: Manjaro base: Arch Linux
Machine:
  Type: Desktop Mobo: ASUSTeK model: PRIME B450-PLUS v: Rev X.0x
    serial: <superuser required> part-nu: SKU uuid: <superuser required>
    BIOS: American Megatrends v: 4631 date: 01/14/2025
Battery:
  Device-1: hidpp_battery_0 model: Logitech M215 serial: <filter>
    charge: 55% (should be ignored) rechargeable: yes status: discharging
Memory:
  System RAM: total: 16 GiB available: 15.53 GiB used: 2.46 GiB (15.8%)
  Message: For most reliable report, use superuser + dmidecode.
  Array-1: capacity: 128 GiB slots: 4 modules: 1 EC: None
    max-module-size: 32 GiB note: est.
  Device-1: DIMM_A1 type: no module installed
  Device-2: DIMM_A2 type: DDR4 detail: synchronous unbuffered (unregistered)
    size: 16 GiB speed: 3000 MT/s volts: note: check curr: 1 min: 1 max: 1
    width (bits): data: 64 total: 64 manufacturer: G Skill Intl
    part-no: F4-3000C16-16GISB serial: N/A
  Device-3: DIMM_B1 type: no module installed
  Device-4: DIMM_B2 type: no module installed
PCI Slots:
  Permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: AMD Ryzen 5 3600 bits: 64 type: MT MCP arch: Zen 2 gen: 2
    level: v3 note: check built: 2020-22 process: TSMC n7 (7nm)
    family: 0x17 (23) model-id: 0x71 (113) stepping: 0 microcode: 0x8701035
  Topology: cpus: 1x dies: 1 clusters: 1 cores: 6 threads: 12 tpc: 2
    smt: enabled cache: L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 3 MiB
    desc: 6x512 KiB L3: 32 MiB desc: 2x16 MiB
  Speed (MHz): avg: 1723 min/max: 550/4208 boost: enabled scaling:
    driver: amd-pstate-epp governor: powersave cores: 1: 1723 2: 1723 3: 1723
    4: 1723 5: 1723 6: 1723 7: 1723 8: 1723 9: 1723 10: 1723 11: 1723 12: 1723
    bogomips: 86398
  Flags: 3dnowprefetch abm adx aes aperfmperf apic arat avic avx avx2 bmi1
    bmi2 bpext cat_l3 cdp_l3 clflush clflushopt clwb clzero cmov cmp_legacy
    constant_tsc cpb cpuid cqm cqm_llc cqm_mbm_local cqm_mbm_total
    cqm_occup_llc cr8_legacy cx16 cx8 de decodeassists extapic extd_apicid
    f16c flushbyasid fma fpu fsgsbase fxsr fxsr_opt ht hw_pstate ibpb ibs
    irperf lahf_lm lbrv lm mba mca mce misalignsse mmx mmxext monitor movbe
    msr mtrr mwaitx nonstop_tsc nopl npt nrip_save nx osvw overflow_recov pae
    pat pausefilter pclmulqdq pdpe1gb perfctr_core perfctr_llc perfctr_nb
    pfthreshold pge pni popcnt pse pse36 rapl rdpid rdpru rdrand rdseed rdt_a
    rdtscp rep_good sep sev sev_es sha_ni skinit smap smca smep ssbd sse sse2
    sse4_1 sse4_2 sse4a ssse3 stibp succor svm svm_lock syscall tce topoext
    tsc tsc_scale umip v_spec_ctrl v_vmsave_vmload vgif vmcb_clean vme
    vmmcall wbnoinvd wdt x2apic xgetbv1 xsave xsavec xsaveerptr xsaveopt
    xtopology
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: ghostwrite status: Not affected
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed status: Vulnerable
  Type: spec_rstack_overflow status: Vulnerable
  Type: spec_store_bypass status: Vulnerable
  Type: spectre_v1 status: Vulnerable: __user pointer sanitization and
    usercopy barriers only; no swapgs barriers
  Type: spectre_v2 status: Vulnerable; IBPB: disabled; STIBP: disabled;
    PBRSB-eIBRS: Not affected; BHI: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Advanced Micro Devices [AMD/ATI] Ellesmere [Radeon RX
    470/480/570/570X/580/580X/590] vendor: Gigabyte driver: amdgpu v: kernel
    arch: GCN-4 code: Arctic Islands process: GF 14nm built: 2016-20 pcie:
    gen: 3 speed: 8 GT/s lanes: 16 ports: active: DP-3,HDMI-A-1
    empty: DP-1,DP-2,DVI-D-1 bus-ID: 08:00.0 chip-ID: 1002:67df class-ID: 0300
    temp: 49.0 C
  Display: x11 server: X.Org v: 21.1.16 with: Xwayland v: 24.1.6
    compositor: kwin_x11 driver: X: loaded: modesetting alternate: fbdev,vesa
    dri: radeonsi gpu: amdgpu display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3840x2160 s-dpi: 96 s-size: 1013x570mm (39.88x22.44")
    s-diag: 1162mm (45.76")
  Monitor-1: DP-3 model: Denon DENON-AVR serial: <filter> built: 2014 res:
    mode: 1920x1080 hz: 60 scale: 100% (1) dpi: 69 gamma: 1.2 chroma: red:
    x: 0.627 y: 0.341 green: x: 0.278 y: 0.596 blue: x: 0.153 y: 0.071 white:
    x: 0.282 y: 0.298 size: 708x398mm (27.87x15.67") diag: 918mm (36.1")
    ratio: 16:9 modes: 1920x1080, 2880x576, 2880x480, 1280x720, 1440x576,
    1440x480, 720x576, 720x480, 640x480
  Monitor-2: HDMI-A-1 mapped: HDMI-1 pos: primary model: Philips FTV
    serial: <filter> built: 2017 res: mode: 3840x2160 hz: 60 scale: 100% (1)
    dpi: 68 gamma: 1.2 chroma: red: x: 0.651 y: 0.333 green: x: 0.325 y: 0.588
    blue: x: 0.145 y: 0.051 white: x: 0.278 y: 0.290
    size: 1440x810mm (56.69x31.89") diag: 1652mm (65") ratio: 16:9
    modes: 1920x1080, 3840x2160, 1600x1200, 1680x1050, 1400x1050, 1280x1024,
    1440x900, 1280x960, 1280x800, 1280x720, 1024x768, 800x600, 720x576,
    720x480, 640x480
  EDID-Warnings: 1: parse_edid: unhandled CEA mode 97 2: parse_edid:
    unhandled CEA mode 96 3: parse_edid: unhandled CEA mode 95 4: parse_edid:
    unhandled CEA mode 94 5: parse_edid: unhandled CEA mode 93
  API: EGL v: 1.5 hw: drv: amd radeonsi platforms: device: 0 drv: radeonsi
    device: 1 drv: swrast gbm: drv: kms_swrast surfaceless: drv: radeonsi x11:
    drv: radeonsi inactive: wayland
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 25.0.3-arch1.1
    glx-v: 1.4 direct-render: yes renderer: AMD Radeon RX 590 Series (radeonsi
    polaris10 ACO DRM 3.61 6.14.0-1-MANJARO) device-ID: 1002:67df
    memory: 7.81 GiB unified: no
  API: Vulkan v: 1.4.309 layers: 5 device: 0 type: discrete-gpu name: AMD
    Radeon RX 590 Series (RADV POLARIS10) driver: mesa radv v: 25.0.3-arch1.1
    device-ID: 1002:67df surfaces: xcb,xlib device: 1 type: cpu name: llvmpipe
    (LLVM 19.1.7 256 bits) driver: mesa llvmpipe v: 25.0.3-arch1.1 (LLVM
    19.1.7) device-ID: 10005:0000 surfaces: xcb,xlib
  Info: Tools: api: clinfo, eglinfo, glxinfo, vulkaninfo
    de: kscreen-console,kscreen-doctor wl: wayland-info
    x11: xdpyinfo, xprop, xrandr
Audio:
  Device-1: Advanced Micro Devices [AMD/ATI] Ellesmere HDMI Audio [Radeon RX
    470/480 / 570/580/590] vendor: Gigabyte driver: snd_hda_intel v: kernel
    pcie: gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 08:00.1 chip-ID: 1002:aaf0
    class-ID: 0403
  Device-2: Advanced Micro Devices [AMD] Starship/Matisse HD Audio
    vendor: ASUSTeK driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s
    lanes: 16 bus-ID: 0a:00.4 chip-ID: 1022:1487 class-ID: 0403
  API: ALSA v: k6.14.0-1-MANJARO status: kernel-api with: aoss
    type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: JACK v: 1.9.22 status: off tools: N/A
  Server-2: PipeWire v: 1.4.1 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    vendor: ASUSTeK RTL8111H driver: r8169 v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 port: f000 bus-ID: 03:00.0 chip-ID: 10ec:8168
    class-ID: 0200
  IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  Info: services: NetworkManager, sshd, systemd-timesyncd
  WAN IP: <filter>
Bluetooth:
  Message: No bluetooth data found.
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 2.52 TiB used: 423.8 GiB (16.4%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/sda maj-min: 8:0 vendor: Western Digital model: WD10EADS-00L5B1
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 3.0 Gb/s
    tech: N/A serial: <filter> fw-rev: 1A01 scheme: GPT
  ID-2: /dev/sdb maj-min: 8:16 vendor: Western Digital
    model: WD10EADS-00L5B1 size: 931.51 GiB block-size: physical: 512 B
    logical: 512 B speed: 3.0 Gb/s tech: N/A serial: <filter> fw-rev: 1A01
    scheme: MBR
  ID-3: /dev/sdc maj-min: 8:32 vendor: Micron model: MTFDDAK256MAY-1AH12ABHA
    size: 238.47 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    tech: SSD serial: <filter> fw-rev: M5T4 scheme: MBR
  ID-4: /dev/sdd maj-min: 8:48 vendor: A-Data model: SU800NS38
    size: 476.94 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    tech: SSD serial: <filter> fw-rev: 8B scheme: MBR
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 476.93 GiB size: 468.38 GiB (98.21%)
    used: 42.43 GiB (9.1%) fs: ext4 dev: /dev/sdd1 maj-min: 8:49 label: statroot
    uuid: c967ec04-7002-4176-a843-d0269a60e2e9
  ID-2: /data/ssd200 raw-size: 238.47 GiB size: 233.67 GiB (97.99%)
    used: 16.45 GiB (7.0%) fs: ext4 dev: /dev/sdc1 maj-min: 8:33 label: ssd200
    uuid: f94e8a24-3ec4-4edb-b49f-0d26ab9fef52
  ID-3: /data/swdisk raw-size: 923.5 GiB size: 907.93 GiB (98.31%)
    used: 364.53 GiB (40.1%) fs: ext4 dev: /dev/sda1 maj-min: 8:1 label: swdisk
    uuid: ed96f3d3-edea-43bc-8418-2223e4ec312d
  ID-4: /home/<filter>/cryptomount.fredox.vol raw-size: 600 MiB
    size: 573.7 MiB (95.62%) used: 405.4 MiB (70.7%) fs: ext4 dev: /dev/dm-1
    maj-min: 253:1 mapped: loop0 label: N/A uuid: N/A
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default) zswap: yes
    compressor: zstd max-pool: 20%
  ID-1: swap-1 type: partition size: 8.01 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/dm-0 maj-min: 253:0 mapped: swap label: swap
    uuid: be412c02-951e-41a3-b8d0-9ae75cdd1778
Unmounted:
  ID-1: /dev/sda2 maj-min: 8:2 size: 8.01 GiB fs: ext2 label: cryptswap
    uuid: 51aca7eb-b9ff-40c3-81eb-05ac432f2d87
  ID-2: /dev/sdb1 maj-min: 8:17 size: 931.51 GiB fs: ext4 label: hd1Tb
    uuid: a0f67169-c4c3-48e9-bafe-a73dc0983560
USB:
  Hub-1: 1-0:1 info: hi-speed hub with single TT ports: 10 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Device-1: 1-7:2 info: Jing-Mold Enterprise 2.4G Dongle
    type: keyboard,mouse,HID driver: hid-generic,usbhid interfaces: 3 rev: 2.0
    speed: 12 Mb/s (1.4 MiB/s) lanes: 1 mode: 1.1 power: 100mA
    chip-ID: 05af:0906 class-ID: 0301
  Device-2: 1-9:3 info: NZXT Smart Device V2 type: HID
    driver: nzxt-smart2,usbhid interfaces: 1 rev: 2.0 speed: 12 Mb/s (1.4 MiB/s)
    lanes: 1 mode: 1.1 power: 100mA chip-ID: 1e71:2006 class-ID: 0300
    serial: <filter>
  Device-3: 1-10:4 info: Logitech Nano Receiver type: mouse,HID
    driver: logitech-djreceiver,usbhid interfaces: 2 rev: 2.0
    speed: 12 Mb/s (1.4 MiB/s) lanes: 1 mode: 1.1 power: 98mA
    chip-ID: 046d:c52f class-ID: 0300
  Hub-2: 2-0:1 info: super-speed hub ports: 4 rev: 3.1
    speed: 10 Gb/s (1.16 GiB/s) lanes: 1 mode: 3.2 gen-2x1 chip-ID: 1d6b:0003
    class-ID: 0900
  Hub-3: 3-0:1 info: hi-speed hub with single TT ports: 4 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Hub-4: 3-1:2 info: Genesys Logic Hub ports: 4 rev: 2.1
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 power: 100mA
    chip-ID: 05e3:0610 class-ID: 0900
  Hub-5: 4-0:1 info: super-speed hub ports: 4 rev: 3.1
    speed: 10 Gb/s (1.16 GiB/s) lanes: 1 mode: 3.2 gen-2x1 chip-ID: 1d6b:0003
    class-ID: 0900
  Hub-6: 4-1:2 info: Genesys Logic USB3.0 Hub ports: 4 rev: 3.0
    speed: 5 Gb/s (596.0 MiB/s) lanes: 1 mode: 3.2 gen-1x1 chip-ID: 05e3:0617
    class-ID: 0900
Sensors:
  System Temperatures: cpu: 50.5 C mobo: N/A gpu: amdgpu temp: 49.0 C
  Fan Speeds (rpm): N/A gpu: amdgpu fan: 770
Repos:
  Packages: pm: pacman pkgs: 1163 libs: 280 tools: pamac
  Active pacman repo servers in: /etc/pacman.d/mirrorlist
    1: https://mirrors.dotsrc.org/manjaro/stable/$repo/$arch
Processes:
  CPU top: 5 of 325
  1: cpu: 2.6% command: firefox pid: 34130 mem: 541.6 MiB (3.4%)
  2: cpu: 1.8% command: firefox pid: 34538 mem: 296.7 MiB (1.8%)
  3: cpu: 0.7% command: Xorg pid: 746 mem: 134.7 MiB (0.8%)
  4: cpu: 0.7% command: firefox pid: 34531 mem: 248.9 MiB (1.5%)
  5: cpu: 0.5% command: kwin_x11 pid: 990 mem: 240.7 MiB (1.5%)
  Memory top: 5 of 325
  1: mem: 541.6 MiB (3.4%) command: firefox pid: 34130 cpu: 2.6%
  2: mem: 381.6 MiB (2.4%) command: plasmashell pid: 1044 cpu: 0.2%
  3: mem: 314.7 MiB (1.9%) command: doublecmd pid: 3278 cpu: 0.4%
  4: mem: 296.7 MiB (1.8%) command: firefox pid: 34538 cpu: 1.8%
  5: mem: 254.2 MiB (1.5%) command: konsole pid: 4342 cpu: 0.0%
Info:
  Processes: 325 Power: uptime: 6h 17m states: freeze,mem suspend: deep
    avail: s2idle wakeups: 0 hibernate: disabled image: 6.17 GiB
    services: org_kde_powerdevil, power-profiles-daemon, upowerd Init: systemd
    v: 257 default: graphical tool: systemctl
  Compilers: clang: 19.1.7 gcc: 14.2.1 Shell: Bash v: 5.2.37
    running-in: konsole inxi: 3.3.38
1 Like

To restart pipewire-pulse audio server

systemctl --user restart pipewire-pulse

To initialise ALSA audio devices to default state

sudo alsactl init

You can als save the sound settings
alsactl --file ~/.config/asound.state store
and also restore them
alsactl --file ~/.config/asound.state restore

You can ov course choose where to save the file.

1 Like

I have a keyboard shortcut which connects my phone.

Normally I want each channel to do it’s own thing, but when I’m listening to podcasts I like to switch to 4 channel quadrophonic… so what we really want is a simple TOGGLE. The same goes for when I walk in and out of the room, I don’t want my phone permanently blaring out of one room’s speakers when I go to the bathroom.

To this end, I have set my (email) and (Home Key) shortcuts… so if I first activate Fn_F10 I will see and hear a notification that confirms my phone (via bluetooth) is connected.

Pressing Fn_F (Mail) will play a butchered Ubuntu sound file - sending drums either to all speakers, or to individual speakers, for an audible confirmation of it’s switch.

I made two scripts (to suit my hardware):

1. Set safe volume and connect A15 phone with notifications
#!/bin/bash
# For toggling A15 Bluetooth connection with KDE Plasma notifications

DEVICE_MAC="08:A5:DF:D7:41:36"
DEVICE_NAME="Samsung A15"
CONNECT_SOUND="/home/ben/Audio/Sounds/00 Ravers/en-message-sent-instant.ogg"
DISCONNECT_SOUND="/home/ben/Audio/Sounds/00 Ravers/en message-new-instant.ogg"

# Function to get the current system volume
get_current_volume() {
    amixer get Master | grep -oP '\[\d+%\]' | head -n 1 | tr -d '[]%'
}

# Function to show KDE notification
notify() {
    local title="$1"
    local message="$2"
    notify-send -u normal -i "audio-volume-high" "$title" "$message"
}

# Function to check if the device is connected
is_device_connected() {
    bluetoothctl info "$DEVICE_MAC" | grep -q "Connected: yes"
}

# Function to show KDE notification and play sound
notify() {
    local title="$1"
    local message="$2"
    local sound="$3"

    # Show KDE notification
    notify-send -u normal -i "bluetooth" "$title" "$message"

    # Play sound if available
    if [ -f "$sound" ]; then
        paplay "$sound" &
    fi
}

# Main script
if is_device_connected; then
    echo "Device $DEVICE_NAME ($DEVICE_MAC) is connected. Disconnecting..."
    disconnect_output=$(bluetoothctl disconnect "$DEVICE_MAC" 2>&1)

    if ! is_device_connected; then
        echo "Successfully disconnected."
        notify "Bluetooth Disconnected" "Samsung A15 was disconnected" "$DISCONNECT_SOUND"
    else
        echo "Failed to disconnect: $disconnect_output" >&2
        notify "Bluetooth Error" "Failed to disconnect Samsung A15 $DEVICE_NAME ($DEVICE_MAC)" "$DISCONNECT_SOUND"
        exit 1
    fi
else
    echo "Device $DEVICE_NAME ($DEVICE_MAC) is not connected. Attempting to connect..."
    notify "Bluetooth" "$DEVICE_NAME ($DEVICE_MAC) is not connected... Attempting to connect!" "$DISCONNECT_SOUND"

    # Ensure Bluetooth is powered on
    bluetoothctl power on >/dev/null 2>&1

    # Try to connect
    connect_output=$(bluetoothctl connect "$DEVICE_MAC" 2>&1)

    if is_device_connected; then
        # Get current volume
        current_volume=$(get_current_volume)

        # Get current volume
        current_volume=$(get_current_volume)

        # Set volume to 45%
        amixer set Master 45%

        # Send a single notification with the current and new volume levels
        notify "Volume Adjusted" "from $current_volume% to 45%."

        echo "Successfully connected."
        notify "Bluetooth Connected" "Samsung A15 was connected" "$CONNECT_SOUND"
    else
        echo "Failed to connect: $connect_output" >&2
        notify "Bluetooth Error" "Failed to connect to $DEVICE_NAME ($DEVICE_MAC)" "$DISCONNECT_SOUND"
        exit 1
    fi
fi

exit 0

2. set-audio.sh
#!/bin/bash

# Sound files (modify paths as needed)
# STEREO_SOUND="/usr/share/sounds/ocean/stereo/audio-volume-change.oga"
STEREO_SOUND="/home/ben/Audio/Ubuntu-tom-Rl-RR.flac"
# "/home/ben/Audio/Plasma-Overdose-master/sounds/stereo/device-added.ogg"
SURROUND_SOUND="/home/ben/Audio/Ubuntu-tom-stereo.flac"
# "/home/ben/Audio/Ubuntu-tom-question.wav"

# Get current default sink info
current_profile=$(pactl get-default-sink)

# Check if current profile contains "stereo" (case insensitive)
if [[ $current_profile == *"stereo"* ]] || [[ $current_profile == *"Stereo"* ]]; then
    # Switch to Surround 4.0
    pactl set-card-profile alsa_card.pci-0000_04_00.6 output:analog-surround-40
    new_profile=$(pactl get-default-sink)
    notify-send "Audio Mode Changed" "Switched to Surround 4.0\nSelected: $new_profile"
    # Play surround sound notification
    if [ -f "$SURROUND_SOUND" ]; then
        paplay "$SURROUND_SOUND" &
    fi
else
    # Switch to Stereo
    pactl set-card-profile alsa_card.pci-0000_04_00.6 output:analog-stereo
    new_profile=$(pactl get-default-sink)
    notify-send "Audio Mode Changed" "Switched to Stereo\nSelected: $new_profile"
    # Play stereo sound notification
    if [ -f "$STEREO_SOUND" ]; then
        paplay "$STEREO_SOUND" &
    fi
fi

I hope you can use them… and here’s a file to play to confirm rear channels are separate: https://www.dropbox.com/scl/fi/w4fyaxhc6q4tvn1qh3j0k/Ubuntu-tom-channel.flac?rlkey=2fqgt31ofyk4u0vqtnr2zglpi&dl=0

Thank you all

I made a script to reset the sound:

alsactl init
systemctl --user restart  pipewire pipewire-pulse

My reasoning is reset bottom up, alsa first because it is nearer to the hardware, then pipewire services.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.