Pulseaudio issue

I always have to switch the audio device from analog output to analog output + mono input to get the sound work even if it was analog output + mono input , plus its a 5.1 headset i cant get it working.

am using pulseaudio and alsa

System:
Kernel: 6.6.10-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
clocksource: tsc available: hpet,acpi_pm
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=7758260e-7fbd-481e-9819-5335b028eb3f rw rootflags=subvol=@
mem_sleep_default=s2idle ibt=off
Desktop: KDE Plasma v: 5.27.10 tk: Qt v: 5.15.12 info: latte-dock
wm: kwin_x11 vt: 2 dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
Type: Desktop System: Hewlett-Packard product: HP Z220 CMT Workstation
v: N/A serial: <superuser required> Chassis: type: 6
serial: <superuser required>
Mobo: Hewlett-Packard model: 1790 serial: <superuser required>
UEFI: Hewlett-Packard v: K51 v01.61 date: 05/16/2013
CPU:
Info: model: Intel Core i7-3770 bits: 64 type: MT MCP arch: Ivy Bridge
gen: core 3 level: v2 built: 2012-15 process: Intel 22nm family: 6
model-id: 0x3A (58) stepping: 9 microcode: 0x21
Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB
L3: 8 MiB desc: 1x8 MiB
Speed (MHz): avg: 3564 high: 3900 min/max: 1600/3900 scaling:
driver: intel_cpufreq governor: performance cores: 1: 3900 2: 3900 3: 3900
4: 3900 5: 3900 6: 3112 7: 3900 8: 2007 bogomips: 54279
Flags: avx ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Vulnerabilities: <filter>
Graphics:
Device-1: NVIDIA GM107 [GeForce GTX 750 Ti] vendor: ZOTAC driver: nvidia
v: 545.29.06 alternate: nouveau,nvidia_drm non-free: 545.xx+ status: current
(as of 2023-10; EOL~2026-12-xx) arch: Maxwell code: GMxxx
process: TSMC 28nm built: 2014-2019 pcie: gen: 3 speed: 8 GT/s lanes: 8
link-max: lanes: 16 ports: active: none off: HDMI-A-1 empty: DVI-D-1,VGA-1
bus-ID: 01:00.0 chip-ID: 10de:1380 class-ID: 0300
Display: x11 server: X.Org v: 21.1.10 with: Xwayland v: 23.2.3
compositor: kwin_x11 driver: X: loaded: nvidia unloaded: modesetting
alternate: fbdev,nouveau,nv,vesa gpu: nvidia,nvidia-nvswitch
display-ID: :0 screens: 1
Screen-1: 0 s-res: 1920x1200 s-dpi: 93 s-size: 524x321mm (20.63x12.64")
s-diag: 615mm (24.19")
Monitor-1: HDMI-A-1 mapped: HDMI-0 note: disabled
model: Lenovo LEN LT2452pwC serial: <filter> built: 2014 res: 1920x1200
hz: 60 dpi: 94 gamma: 1.2 size: 518x324mm (20.39x12.76")
diag: 611mm (24.1") ratio: 16:10 modes: max: 1920x1200 min: 640x480
API: EGL v: 1.5 hw: drv: nvidia platforms: device: 0 drv: nvidia device: 2
drv: swrast gbm: drv: nvidia surfaceless: drv: nvidia x11: drv: nvidia
inactive: wayland,device-1
API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia mesa v: 545.29.06
glx-v: 1.4 direct-render: yes renderer: NVIDIA GeForce GTX 750 Ti/PCIe/SSE2
memory: 1.95 GiB
API: Vulkan v: 1.3.274 layers: 7 device: 0 type: discrete-gpu name: NVIDIA
GeForce GTX 750 Ti driver: nvidia v: 545.29.06 device-ID: 10de:1380
surfaces: xcb,xlib
Audio:
Device-1: Intel 7 Series/C216 Family High Definition Audio
vendor: Hewlett-Packard 7 driver: snd_hda_intel v: kernel bus-ID: 00:1b.0
chip-ID: 8086:1e20 class-ID: 0403
Device-2: NVIDIA GM107 High Definition Audio [GeForce 940MX] vendor: ZOTAC
driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 8
link-max: lanes: 16 bus-ID: 01:00.1 chip-ID: 10de:0fbc class-ID: 0403
Device-3: C-Media USB Audio Device
driver: hid-generic,snd-usb-audio,usbhid type: USB rev: 1.1 speed: 12 Mb/s
lanes: 1 mode: 1.1 bus-ID: 3-2:3 chip-ID: 0d8c:0012 class-ID: 0300
API: ALSA v: k6.6.10-zen1-1-zen status: kernel-api with: aoss
type: oss-emulator tools: alsactl,alsamixer,amixer
Server-1: PipeWire v: 1.0.0 status: active with: 1: wireplumber
status: active 2: pw-jack type: plugin tools: pw-cat,pw-cli,wpctl
Server-2: PulseAudio v: 16.1 status: active with: 1: pulseaudio-alsa
type: plugin 2: pulseaudio-jack type: module tools: pacat,pactl,pavucontrol
Network:
Device-1: Intel 82579LM Gigabit Network vendor: Hewlett-Packard
driver: e1000e v: kernel port: f040 bus-ID: 00:19.0 chip-ID: 8086:1502
class-ID: 0200
IF: eno1 state: up speed: 100 Mbps duplex: full mac: <filter>
Bluetooth:
Device-1: Cambridge Silicon Radio Bluetooth Dongle (HCI mode) driver: btusb
v: 0.8 type: USB rev: 2.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 3-1:2
chip-ID: 0a12:0001 class-ID: e001
Report: btmgmt ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 4.0
lmp-v: 6 status: discoverable: no pairing: no class-ID: 7c0104
RAID:
Hardware-1: Intel SATA Controller [RAID mode] driver: ahci v: 3.0 port: f020
bus-ID: 00:1f.2 chip-ID: 8086:2822 rev: N/A class-ID: 0104
Drives:
Local Storage: total: 1.02 TiB used: 851.41 GiB (81.6%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/sda maj-min: 8:0 vendor: Hikvision model: HS-SSD-C100 120G
size: 111.79 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
tech: SSD serial: <filter> fw-rev: 979 scheme: GPT
ID-2: /dev/sdb maj-min: 8:16 vendor: Western Digital
model: WD10EARS-00Y5B1 size: 931.51 GiB block-size: physical: 512 B
logical: 512 B speed: 3.0 Gb/s tech: N/A serial: <filter> fw-rev: 0A80
scheme: GPT
Partition:
ID-1: / raw-size: 111.49 GiB size: 111.49 GiB (100.00%)
used: 24.53 GiB (22.0%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 584 KiB (0.2%) fs: vfat dev: /dev/sda1 maj-min: 8:1
ID-3: /home raw-size: 111.49 GiB size: 111.49 GiB (100.00%)
used: 24.53 GiB (22.0%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
ID-4: /var/log raw-size: 111.49 GiB size: 111.49 GiB (100.00%)
used: 24.53 GiB (22.0%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
ID-5: /var/tmp raw-size: 111.49 GiB size: 111.49 GiB (100.00%)
used: 24.53 GiB (22.0%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
ID-1: swap-1 type: zram size: 11.62 GiB used: 590.8 MiB (5.0%)
priority: 100 comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 8
dev: /dev/zram0
Sensors:
System Temperatures: cpu: 48.0 C mobo: N/A gpu: nvidia temp: 35 C
Fan Speeds (rpm): N/A gpu: nvidia fan: 33%
Info:
Processes: 337 Uptime: 1h 53m wakeups: 0 Memory: total: 12 GiB
available: 11.63 GiB used: 6.6 GiB (56.8%) Init: systemd v: 255
default: graphical tool: systemctl Compilers: gcc: 13.2.1 Packages:
pm: pacman pkgs: 1853 libs: 531 tools: octopi,paru Shell: fish v: 3.7.0
running-in: konsole inxi: 3.3.31
Garuda (2.6.22-1):
System install date:     2024-01-07
Last full system update: 2024-01-08 ↻
Is partially upgraded:   No
Relevant software:       snapper NetworkManager dracut nvidia-dkms
Windows dual boot:       No/Undetected
Failed units:

keep in mind that i searched a lot

But did you read it all?

  • Format terminal output (including your garuda-inxi) as a code block by clicking the preformatted text button (</>) , or put three tildes (~) above and below the text

can you help me what should i replace there?

# audio sink name printed in notification
SpeakerNiceName = 'PreSonus AudioBox'
HeadsetNiceName = 'Logitech G535 Headset'
NewSinkNiceName = None

# regexes for audio sink names from pactl
SpeakerSinkRe = re.compile('(.*PreSonus_AudioBox.*)')
HeadsetSinkRe = re.compile('(.*Logitech_G535.*)')
DefaultSinkRe = re.compile('Default Sink: (.*)$')
pactl list short sinks
0       alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo      module-alsa-card.c   s16le 2ch 44100Hz        RUNNING
1       alsa_output.pci-0000_00_1b.0.analog-stereo      module-alsa-card.c      s16le 2ch 44100Hz       SUSPENDED
5       ladspa_output.mbeq_1197.mbeq    module-ladspa-sink.c    float32le 2ch 44100Hz   RUNNING

You can change the strings and regexes to match the sinks on your machine - get them with

pactl list short sinks
pactl list sinks

in terminal, or maybe the author can help you.

Hi @gamerlord - hopefully this script helps you if you decide to use it!

Short answer:

SpeakerNiceName = 'Speakers'
HeadsetNiceName = 'Headset'

# keep in mind I don't know which of these is a headset or speakers; this will just accomplish a swap between the devices
SpeakerSinkRe = re.compile('(.*mbeq_1197.*)')
HeadsetSinkRe = re.compile('(.*Media_Electronics.*)')

I’m just taking a guess at which of the sinks are the ones you want to swap between. I think the third is your video card, just guessing by “pci” in the sink name, and I’m assuming you don’t want that one.

Long answer:
The “NiceName” variables are just the names that will be printed in the desktop notification that is sent after the swap. They are just for your benefit so you can put whatever you want there.

The “Re” variables are regular expressions which are used to match against the list of sinks that the script scans. Honestly regexes aren’t even necessary; you could just compare against the full sink name instead.

Also, since your stated problem has an input device as one of the components, I’m not sure if this script will fully solve it for you since this just switches output devices.

If you want to correlate a sink name with your current output device, you can run “pactl info” and look for the “Default Sink:” line. Then switch your device with the GUI and run “pactl info” again.

2 Likes

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