You are not logged in.

#1 2023-12-26 10:45:49

Lynntricate
Member
Registered: 2023-12-26
Posts: 5

Raptor Lake audio issues KDE PipeWire

Hi all.

I'm a new arch user and I ran into an issue right after installing: the audio of my laptop (Lenovo 7i slim Pro) just does not seem to want to work with arch. (I should note that before I installed arch, I was testing some stuff on a live Manjaro USB, and I seem to remember having the exact same problem in KDE Manjaro as I'm having now in "pure arch".

I'm using PipeWire on kde-plasma, but the issue was also there when I tried to use PulseAudio. Essentially what happens is: Every time I boot or log in, adjusting system audio to even 10% sets the real volume to 100%. This is not represented in the GUI, but definitely in the resulting volume. I can "fix" it temporarily by going to kMix, and changing the audio profile from "Play HiFi quality music" to "Pro Audio". After that, the system works perfectly. However, every time I reboot, this setting is forgotten. I found only one similar case on the internet here (no solution given), also on an arch-based distro, from a user who happens to have the exact same hardware as me.

After checking alsamixer, I noticed that the Master track of my -c0 device is displaying the behaviour of going to 100% even though my system volume is much lower. To show you what I mean, here are the top outputs of

 amixer -c0 

for two cases:

Case 0: (system volume (kMix) is at 0%)

 
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 0 [0%] [-65.25dB] [off]

Case 1: (system volume (kMix) is at 10%)

 
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 87 [100%] [0.00dB] [on]

I'm not certain if this is what's causing the problem, but it seems too coincidental.

I have read all wiki pages regarding PipeWire and audio setup, and I got no further.

Additional info:

> aplay -lL

null
    Discard all samples (playback) or generate zero samples (capture)
lavrate
    Rate Converter Plugin Using Libav/FFmpeg Library
samplerate
    Rate Converter Plugin Using Samplerate Library
speexrate
    Rate Converter Plugin Using Speex Resampler
jack
    JACK Audio Connection Kit
oss
    Open Sound System
pipewire
    PipeWire Sound Server
pulse
    PulseAudio Sound Server
speex
    Plugin using Speex DSP (resample, agc, denoise, echo, dereverb)
upmix
    Plugin for channel upmix (4,6,8)
vdownmix
    Plugin for channel downmix (stereo) with a simple spacialization
default
    Default ALSA Output (currently PipeWire Media Server)
sysdefault:CARD=sofhdadsp
    sof-hda-dsp, 
    Default Audio Device
usbstream:CARD=sofhdadsp
    sof-hda-dsp
    USB Stream Output
**** List of PLAYBACK Hardware Devices ****
card 0: sofhdadsp [sof-hda-dsp], device 0: HDA Analog (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 3: HDMI1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 4: HDMI2 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 5: HDMI3 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 31: HDA Analog Deep Buffer (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

>pactl info

Server String: /run/user/1000/pulse/native
Library Protocol Version: 35
Server Protocol Version: 35
Is Local: yes
Client Index: 578
Tile Size: 65472
Server Name: PulseAudio (on PipeWire 1.0.0)
Server Version: 15.0.0
Default Sample Specification: float32le 2ch 48000Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink
Default Source: alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__source
Cookie: fe37:8670

>amixer

Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 13107 [20%] [on]
  Front Right: Playback 13107 [20%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 65536
  Front Left: Capture 65536 [100%] [on]
  Front Right: Capture 65536 [100%] [on]

>amixer -c0

Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 22 [25%] [-48.75dB] [off]
  Front Right: Playback 22 [25%] [-48.75dB] [off]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 32 [37%] [-41.25dB] [on]
  Front Right: Playback 32 [37%] [-41.25dB] [on]
Simple mixer control 'Bass Speaker',0
  Capabilities: pswitch
  Playback channels: Front Left - Front Right
  Mono:
  Front Left: Playback [on]
  Front Right: Playback [on]
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'IEC958',1
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'IEC958',2
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 63
  Front Left: Capture 63 [100%] [30.00dB] [on]
  Front Right: Capture 63 [100%] [30.00dB] [on]
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
Simple mixer control 'Dmic0',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right - Rear Left - Rear Right
  Limits: Capture 0 - 70
  Front Left: Capture 70 [100%] [20.00dB] [on]
  Front Right: Capture 70 [100%] [20.00dB] [on]
  Rear Left: Capture 70 [100%] [20.00dB] [on]
  Rear Right: Capture 70 [100%] [20.00dB] [on]
Simple mixer control 'Dmic1 2nd',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right - Rear Left - Rear Right
  Limits: Capture 0 - 70
  Front Left: Capture 50 [71%] [0.00dB]
  Front Right: Capture 50 [71%] [0.00dB]
  Rear Left: Capture 50 [71%] [0.00dB]
  Rear Right: Capture 50 [71%] [0.00dB]
Simple mixer control 'Headset Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'PGA1.0 1 Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 32
  Mono:
  Front Left: Playback 32 [100%] [0.00dB]
  Front Right: Playback 32 [100%] [0.00dB]
Simple mixer control 'PGA2.0 2 Master',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 80
  Front Left: Capture 50 [62%] [0.00dB]
  Front Right: Capture 50 [62%] [0.00dB]
Simple mixer control 'PGA30.0 30',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 32
  Mono:
  Front Left: Playback 32 [100%] [0.00dB]
  Front Right: Playback 32 [100%] [0.00dB]
Simple mixer control 'PGA31.0 31',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 32
  Mono:
  Front Left: Playback 32 [100%] [0.00dB]
  Front Right: Playback 32 [100%] [0.00dB]
Simple mixer control 'PGA7.0 7 Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 32
  Mono:
  Front Left: Playback 32 [100%] [0.00dB]
  Front Right: Playback 32 [100%] [0.00dB]
Simple mixer control 'PGA8.0 8 Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 32
  Mono:
  Front Left: Playback 32 [100%] [0.00dB]
  Front Right: Playback 32 [100%] [0.00dB]
Simple mixer control 'PGA9.0 9 Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 32
  Mono:
  Front Left: Playback 32 [100%] [0.00dB]
  Front Right: Playback 32 [100%] [0.00dB]

Last edited by Lynntricate (2023-12-26 10:55:42)

Offline

#2 2023-12-26 11:30:11

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Raptor Lake audio issues KDE PipeWire

https://bbs.archlinux.org/viewtopic.php … 8#p1534028?

EDIT: and I don't believe you're running "pure Arch" at all but maybe I'm being unfair tongue

Last edited by Head_on_a_Stick (2023-12-26 11:31:06)


Jin, Jîyan, Azadî

Offline

#3 2023-12-26 12:23:52

Lynntricate
Member
Registered: 2023-12-26
Posts: 5

Re: Raptor Lake audio issues KDE PipeWire

Head_on_a_Stick wrote:

https://bbs.archlinux.org/viewtopic.php … 8#p1534028?

EDIT: and I don't believe you're running "pure Arch" at all but maybe I'm being unfair tongue


Hahah, true regarding the pure arch part.

I looked into the original forum post, created the extra timer and service, and it actually works! I tried to reduce the timer as much as possible, but anything under 1 minute makes it unreliable. This is such a strange bug though, why wouldn't it just wait until the sound card has been initialized by default?

I wonder if there is a cleaner way to solve this than just a timer, as with this solution, audio is still pretty much unavailable for a minute after booting.

Either way, many thanks!

Last edited by Lynntricate (2023-12-26 12:30:44)

Offline

#4 2023-12-26 13:48:09

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Raptor Lake audio issues KDE PipeWire

Lynntricate wrote:

I wonder if there is a cleaner way to solve this

Try

# systemctl edit alsa-restore

Then add this between the comments:

[Unit]
Wants=sound.target
After=sound.target

Jin, Jîyan, Azadî

Offline

#5 2023-12-26 15:58:49

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,156

Re: Raptor Lake audio issues KDE PipeWire

This is unlikely to be up to alsa state once pipewire takes over and then fumbles it's calculation of the volume delta to apply to master.  This is technically a pipewire bug and the volume level consolidation that it normally does not working on this particular hardware. Switching to Pro-Audio just bypasses all of that logic and gives you raw access to all device nodes but will disable a bunch of the niceties of pipewire.


You might want to try the following, assuming you're using wireplumber for your session manager, create a file  /etc/wireplumber/main.lua.d/51-disableHWVolume.lua

table.insert (alsa_monitor.rules, {
  matches = {
    {
      { "device.name", "matches", "alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic" },
    },
  },
  apply_properties = {
    ["api.alsa.soft-mixer"] = true,
  }
})

That should enforce a software mixer that does not touch your master device HW volume.

Offline

#6 2023-12-26 17:57:53

Lynntricate
Member
Registered: 2023-12-26
Posts: 5

Re: Raptor Lake audio issues KDE PipeWire

V1del wrote:

This is unlikely to be up to alsa state once pipewire takes over and then fumbles it's calculation of the volume delta to apply to master.  This is technically a pipewire bug and the volume level consolidation that it normally does not working on this particular hardware. Switching to Pro-Audio just bypasses all of that logic and gives you raw access to all device nodes but will disable a bunch of the niceties of pipewire.


You might want to try the following, assuming you're using wireplumber for your session manager, create a file  /etc/wireplumber/main.lua.d/51-disableHWVolume.lua

table.insert (alsa_monitor.rules, {
  matches = {
    {
      { "device.name", "matches", "alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic" },
    },
  },
  apply_properties = {
    ["api.alsa.soft-mixer"] = true,
  }
})

That should enforce a software mixer that does not touch your master device HW volume.

/etc/wireplumber/ does not exist on my system. /usr/share/wireplumber/main.lua.d does exist, so I put the file there, but it seems to have no effect. The system does automatically select the "Pro Audio" profile, but it now seems muted, as in, the output of amixer now makes more sense (it doesn't automatically go to 100%):

Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 39322 [60%] [on]
  Front Right: Playback 39322 [60%] [on]

but it doesn't produce sound either. I still have to switch between the two profiles for it to work. Really makes me wonder what magic is happening under the hood that switching back and forth between the pro audio profile suddenly gives it the capability to produce audio.

Perhaps this is useful context:

$ systemctl status alsa-state
○ alsa-state.service - Manage Sound Card State (restore and store)
     Loaded: loaded (/usr/lib/systemd/system/alsa-state.service; static)
     Active: inactive (dead)
  Condition: start condition unmet at Tue 2023-12-26 18:51:57 CET; 15min ago
             └─ ConditionPathExists=/etc/alsa/state-daemon.conf was not met

Dec 26 18:51:57 Anubis systemd[1]: Manage Sound Card State (restore and store) was skipped because of an unmet condition check (ConditionPathExists=/etc/alsa/state-daemon.conf).

Edit: Now I'm getting no audio at all not even when switching, so I am not entirely sure what changed...

Last edited by Lynntricate (2023-12-26 18:24:20)

Offline

#7 2023-12-26 17:59:43

Lynntricate
Member
Registered: 2023-12-26
Posts: 5

Re: Raptor Lake audio issues KDE PipeWire

Head_on_a_Stick wrote:
Lynntricate wrote:

I wonder if there is a cleaner way to solve this

Try

# systemctl edit alsa-restore

Then add this between the comments:

[Unit]
Wants=sound.target
After=sound.target

Hmm I had hopes but this does not seem to do anything, sadly.

Offline

#8 2023-12-26 23:32:03

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,156

Re: Raptor Lake audio issues KDE PipeWire

Don't look at the plain master volume in amixer, that's a plain pipewire <-> ALSA compatibility layer that means nothing. Check

amixer -c0

for the actual mixers of the card and what changes with those when you toggle the two outputs.

Generally speaking if someone gives you a file path that does not yet exist you should be creating it. But adding that config to /usr/share/wireplumber/main.lua.d should lead to the same end result regardless.

If this is really just about toggling between the two, you could also add some pipewire commands to do so, but we should probably rather fix this with other config if possible.

If you want to try that anyway create /etc/pipewire/pipewire-pulse.d/adjustPulse.conf and add

pulse.cmd = [
    { cmd = "load-module" args = "module-always-sink" flags = [ ] }
    { cmd = "set-card-profile" args = "alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic pro-audio" }
    { cmd = "set-card-profile" args = "alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic HiFi"}
]

that should logically lead to the same toggling behaviour.

Offline

#9 2023-12-27 11:39:43

Lynntricate
Member
Registered: 2023-12-26
Posts: 5

Re: Raptor Lake audio issues KDE PipeWire

V1del wrote:

Don't look at the plain master volume in amixer, that's a plain pipewire <-> ALSA compatibility layer that means nothing. Check

amixer -c0

for the actual mixers of the card and what changes with those when you toggle the two outputs.

Generally speaking if someone gives you a file path that does not yet exist you should be creating it. But adding that config to /usr/share/wireplumber/main.lua.d should lead to the same end result regardless.

If this is really just about toggling between the two, you could also add some pipewire commands to do so, but we should probably rather fix this with other config if possible.

If you want to try that anyway create /etc/pipewire/pipewire-pulse.d/adjustPulse.conf and add

pulse.cmd = [
    { cmd = "load-module" args = "module-always-sink" flags = [ ] }
    { cmd = "set-card-profile" args = "alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic pro-audio" }
    { cmd = "set-card-profile" args = "alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic HiFi"}
]

that should logically lead to the same toggling behaviour.


Oh thank you so much! This actually works very well! Tried rebooting / logging out/in a bunch of times and until now, no issues big_smile

Offline

Board footer

Powered by FluxBB