Volume control broken for rear channels (getting sound right on HP Envy x360)

I've recently installed Manjaro Linux on my HP Envy 13" x360 laptop. It requires some additional sound configuration, because out of the box only 2 out of 4 speakers are playing. Fortunately, the remaining speakers can be enabled using hdajackretask as described in this Ask Ubuntu thread: https://askubuntu.com/questions/1231326/hp-envy-x360-amd-ryzen-sound-setup

To have sound coming from all speakers output profile needs to be set to "Audio Surround 4.0 Output". That, however, causes a problem with volume control. Changing system volume now only affects "front" speakers while "rear" play with constant volume (unless the volume is set to 0, because then all channels are muted).

Adjusting volume of each channel separately in pavucontrol-qt yields very interesting results.
It seems that front/rear channels' volume levels are somehow adjusted relative to each other. In other words, entire volume range of a rear channel is mapped to [0%; front channel volume]. That also explains why rear speakers always play at full volume when volumes are locked together.

Changing volume with alsamixer confirms these findings.

In summary, I'm looking for a way to properly control my rear audio channels or to make them more independent. It would also be great if the front/rear fading could be permanently set. I suppose that's just a matter of a proper Pulseaudio configuration, but since I know next to nothing about it, I don't really know where to start.

Thank you!


Not sure if it's useful in this case, but here is output of inxi -Fxxxz:

System:    Host: envy Kernel: 5.7.9-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.1.0 Desktop: KDE Plasma 5.19.3 
           tk: Qt 5.15.0 wm: kwin_x11 dm: SDDM Distro: Manjaro Linux 
Machine:   Type: Convertible System: HP product: HP ENVY x360 Convertible 13-ar0xxx v: N/A serial: <filter> Chassis: 
           type: 31 serial: <filter> 
           Mobo: HP model: 85DE v: 41.36 serial: <filter> UEFI: AMI v: F.19 date: 12/26/2019 
Battery:   ID-1: BAT0 charge: 52.9 Wh condition: 52.9/52.9 Wh (100%) volts: 17.5/15.4 model: 333-2B-49-A KC04053XL 
           type: Li-ion serial: <filter> status: Full 
CPU:       Topology: Quad Core model: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx bits: 64 type: MT MCP arch: Zen+ 
           rev: 1 L2 cache: 2048 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 33551 
           Speed: 1222 MHz min/max: 1400/2100 MHz boost: enabled Core speeds (MHz): 1: 1226 2: 1226 3: 1225 4: 1222 
           5: 1223 6: 1229 7: 1561 8: 2494 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Picasso vendor: Hewlett-Packard driver: amdgpu v: kernel 
           bus ID: 04:00.0 chip ID: 1002:15d8 
           Display: x11 server: X.Org 1.20.8 driver: amdgpu FAILED: ati unloaded: modesetting alternate: fbdev,vesa 
           compositor: kwin_x11 resolution: 1920x1080~60Hz 
           OpenGL: renderer: AMD RAVEN (DRM 3.37.0 5.7.9-1-MANJARO LLVM 10.0.0) v: 4.6 Mesa 20.1.3 
           direct render: Yes 
Audio:     Device-1: Advanced Micro Devices [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio vendor: Hewlett-Packard 
           driver: snd_hda_intel v: kernel bus ID: 04:00.1 chip ID: 1002:15de 
           Device-2: Advanced Micro Devices [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor 
           vendor: Hewlett-Packard driver: N/A bus ID: 04:00.5 chip ID: 1022:15e2 
           Device-3: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: Hewlett-Packard driver: snd_hda_intel 
           v: kernel bus ID: 04:00.6 chip ID: 1022:15e3 
           Sound Server: ALSA v: k5.7.9-1-MANJARO 
Network:   Device-1: Realtek RTL8822BE 802.11a/b/g/n/ac WiFi adapter vendor: Hewlett-Packard driver: rtw_pci v: N/A 
           port: f000 bus ID: 02:00.0 chip ID: 10ec:b822 
           IF: wlan0 state: up mac: <filter> 
Drives:    Local Storage: total: 476.94 GiB used: 53.06 GiB (11.1%) 
           ID-1: /dev/nvme0n1 model: KBG30ZMV512G KIOXIA size: 476.94 GiB speed: 15.8 Gb/s lanes: 2 serial: <filter> 
           rev: ADHA0102 scheme: GPT 
Partition: ID-1: / size: 255.08 GiB used: 25.26 GiB (9.9%) fs: ext4 dev: /dev/nvme0n1p5 
           ID-2: swap-1 size: 16.00 GiB used: 72.0 MiB (0.4%) fs: swap dev: /dev/nvme0n1p6 
Sensors:   System Temperatures: cpu: 59.1 C mobo: 45.0 C gpu: amdgpu temp: 59 C 
           Fan Speeds (RPM): N/A 
Info:      Processes: 267 Uptime: 3h 42m Memory: 5.74 GiB used: 3.78 GiB (65.8%) Init: systemd v: 245 Compilers: 
           gcc: 10.1.0 clang: 10.0.0 Shell: bash v: 5.0.18 running in: konsole inxi: 3.0.37 

~/.config/pulse/default.pa:

#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif

### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

### Load several protocols
load-module module-dbus-protocol
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif


### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
load-module module-role-cork

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

### Make some devices default
#set-default-sink output
#set-default-source input

Alright, I figured it out! The key observation was that changing Master volume in alsamixer would cause the rear/front channels to become unbalanced while changing PCM volume behaved correctly. A solution for a similar problem was earlier proposed here: https://ubuntuforums.org/showthread.php?t=2414755 and works in this case too.

In short, you need to add following code:

[Element Master]
switch = mute
volume = ignore

above the line containing [Element PCM] in file /usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common

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

Forum kindly sponsored by