l struggle to change the default S32_LE audio format to S24_LE.
Installed packages
pipewire 1:1.4.1-1
pipewire-alsa 1:1.4.1-1
pipewire-audio 1:1.4.1-1
pipewire-docs 1:1.4.1-1
pipewire-pulse 1:1.4.1-1
sof-firmware 2025.01-1
As i understand my hardware support or i think so bits: [0x1e]: 16 20 24 32
$ cat /proc/asound/card1/codec#0
Node 0x02 [Audio Output] wcaps 0xd043d: Stereo Amp-Out Stripe
Control: name="Headphone Playback Volume", index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
Amp-Out caps: ofs=0x7f, nsteps=0x7f, stepsize=0x01, mute=1
Amp-Out vals: [0x00 0x00]
Converter: stream=5, channel=0
PCM:
rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
bits [0x1e]: 16 20 24 32
formats [0x3]: PCM FLOAT
Power states: D0 D3 EPSS
Power: setting=D0, actual=D0
Delay: 13 samples
Node 0x03 [Audio Output] wcaps 0xd043d: Stereo Amp-Out Stripe
Control: name="Speaker Playback Volume", index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
Control: name="Speaker Playback Switch", index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
Device: name="CS4208 Analog", type="Audio", device=0
Amp-Out caps: ofs=0x7f, nsteps=0x7f, stepsize=0x01, mute=1
Amp-Out vals: [0x43 0x43]
Converter: stream=5, channel=0
PCM:
rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
bits [0x1e]: 16 20 24 32
formats [0x3]: PCM FLOAT
Power states: D0 D3 EPSS
Power: setting=D0, actual=D0
Delay: 13 samples
I have two audio hardware Intel Broadwell HDMI and Cirrus Logic CS4208.
Cirrus Logic CS4208 where i plug headphones or built-in speaker to listen music and its node /proc/asound/card1/codec#0:Node 0x02
$ grep -E 'Codec|Audio Output|rates' /proc/asound/card*/codec#*
/proc/asound/card0/codec#0:Codec: Intel Broadwell HDMI
/proc/asound/card0/codec#0: rates [0x0]:
/proc/asound/card0/codec#0:Node 0x02 [Audio Output] wcaps 0x6611: 8-Channels Digital
/proc/asound/card0/codec#0: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
/proc/asound/card0/codec#0:Node 0x03 [Audio Output] wcaps 0x6611: 8-Channels Digital
/proc/asound/card0/codec#0: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
/proc/asound/card0/codec#0:Node 0x04 [Audio Output] wcaps 0x6611: 8-Channels Digital
/proc/asound/card0/codec#0: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
/proc/asound/card1/codec#0:Codec: Cirrus Logic CS4208
/proc/asound/card1/codec#0: rates [0x0]:
/proc/asound/card1/codec#0:Node 0x02 [Audio Output] wcaps 0xd043d: Stereo Amp-Out Stripe
/proc/asound/card1/codec#0: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
/proc/asound/card1/codec#0:Node 0x03 [Audio Output] wcaps 0xd043d: Stereo Amp-Out Stripe
/proc/asound/card1/codec#0: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
/proc/asound/card1/codec#0:Node 0x04 [Audio Output] wcaps 0xd043d: Stereo Amp-Out Stripe
/proc/asound/card1/codec#0: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
/proc/asound/card1/codec#0:Node 0x05 [Audio Output] wcaps 0xd043d: Stereo Amp-Out Stripe
/proc/asound/card1/codec#0: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
/proc/asound/card1/codec#0: rates [0x1f5]: 8000 16000 32000 44100 48000 88200 96000
/proc/asound/card1/codec#0: rates [0x1f5]: 8000 16000 32000 44100 48000 88200 96000
/proc/asound/card1/codec#0: rates [0x1f5]: 8000 16000 32000 44100 48000 88200 96000
/proc/asound/card1/codec#0: rates [0x1f5]: 8000 16000 32000 44100 48000 88200 96000
/proc/asound/card1/codec#0:Node 0x0a [Audio Output] wcaps 0x46631: 8-Channels Digital Stripe
/proc/asound/card1/codec#0: rates [0x60]: 44100 48000
/proc/asound/card1/codec#0:Node 0x0b [Audio Output] wcaps 0x46631: 8-Channels Digital Stripe
/proc/asound/card1/codec#0: rates [0x60]: 44100 48000
/proc/asound/card1/codec#0: rates [0x60]: 44100 48000
/proc/asound/card1/codec#0: rates [0x60]: 44100 48000
/proc/asound/card1/codec#0:Node 0x0e [Audio Output] wcaps 0x40631: Stereo Digital Stripe
/proc/asound/card1/codec#0: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
/proc/asound/card1/codec#0: rates [0x5f0]: 32000 44100 48000 88200 96000 192000
While listening music i check the hardware params and format: S32_LE is there.
$ cat /proc/asound/card1/pcm0p/sub0/hw_params
access: MMAP_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 1024
buffer_size: 32768
After some research i found a section in pipewire arch wiki.
Wireplumber Configuration
then applied the configuration.
$ cat .config/wireplumber/wireplumber.conf.d/90-alsa.conf
monitor.alsa.rules = [
{
matches = [
{
node.name = "alsa_output.pci-0000_00_1b.0.analog-stereo"
}
]
actions = {
update-props = {
alsa.resolution_bits = "24"
audio.format = "S24_LE"
}
}
}
]
also updated sample rates.
$ cat .config/pipewire/pipewire.conf.d/90-sample-rates.conf
context.properties = {
default.clock.rate = 48000
default.clock.allowed-rates = [ 32000 44100 48000 88200 96000 176400 192000 ]
}
after that
systemctl --user restart pipewire.service pipewire-pulse.service wireplumber.service pipewire-pulse.socket
and systemctl reboot
.
My conf are loaded and applied:
$ wpctl status
PipeWire ‘pipewire-0’ [1.4.1, fywrite@fedora, cookie:3644433263]
└─ Clients:
34. WirePlumber [1.4.1, fywrite@fedora, pid:617]
35. pipewire [1.4.1, fywrite@fedora, pid:616]
36. pipewire [1.4.1, fywrite@fedora, pid:618]
37. pipewire [1.4.1, fywrite@fedora, pid:616]
47. WirePlumber [export] [1.4.1, fywrite@fedora, pid:617]
72. xdg-desktop-portal [1.4.1, fywrite@fedora, pid:1308]
73. xdg-desktop-portal-wlr [1.4.1, fywrite@fedora, pid:1322]
74. LibreWolf [1.4.1, fywrite@fedora, pid:2]
80. wpctl [1.4.1, fywrite@fedora, pid:5932]
Audio
├─ Devices:
│ 52. Built-in Audio [alsa]
│ 53. Built-in Audio [alsa]
│
├─ Sinks:
│ * 60. Built-in Audio Analog Stereo [vol: 0.31]
│
├─ Sources:
│ * 61. Built-in Audio Analog Stereo [vol: 1.00]
│
├─ Filters:
│ - filter-chain-616-30
│ 38. Parametric EQ input [Audio/Sink]
│ 39. Parametric EQ output [Stream/Output/Audio]
│
└─ Streams:
75. LibreWolf
78. output_FR > CS4208 Analog:playback_FR [active]
79. output_FL > CS4208 Analog:playback_FL [active]
Video
├─ Devices:
│
├─ Sinks:
│
├─ Sources:
│
├─ Filters:
│
└─ Streams:
Settings
└─ Default Configured Devices:
0. Audio/Sink alsa_output.pci-0000_00_1b.0.analog-stereo
$ wpctl inspect 60
id 60, type PipeWire:Interface:Node
alsa.card = “1”
alsa.card_name = “HDA Intel PCH”
alsa.class = “generic”
alsa.components = “HDA:10134208,106b7b00,00100300”
alsa.device = “0”
alsa.driver_name = “snd_hda_intel”
alsa.id = “CS4208 Analog”
alsa.long_card_name = “HDA Intel PCH at 0xc1814000 irq 77”
alsa.mixer_name = “Cirrus Logic CS4208”
alsa.name = “CS4208 Analog”
alsa.resolution_bits = “24”
alsa.subclass = “generic-mix”
alsa.subdevice = “0”
alsa.subdevice_name = “subdevice #0”
alsa.sync.id = “00000000:00000000:00000000:00000000”
api.alsa.card.longname = “HDA Intel PCH at 0xc1814000 irq 77”
api.alsa.card.name = “HDA Intel PCH”
api.alsa.path = “front:1”
api.alsa.pcm.card = “1”
api.alsa.pcm.stream = “playback”
audio.channels = “2”
audio.format = “S24_LE”
audio.position = “FL,FR”
card.profile.device = “4”
- client.id = “47”
clock.quantum-limit = “8192”
device.api = “alsa”
device.class = “sound”
device.icon-name = “audio-card-analog” - device.id = “53”
device.profile.description = “Analog Stereo”
device.profile.name = “analog-stereo”
device.routes = “2” - factory.id = “19”
factory.name = “api.alsa.pcm.sink”
library.name = “audioconvert/libspa-audioconvert” - media.class = “Audio/Sink”
- node.description = “Built-in Audio Analog Stereo”
node.driver = “true”
node.loop.name = “data-loop.0” - node.name = “alsa_output.pci-0000_00_1b.0.analog-stereo”
- node.nick = “CS4208 Analog”
node.pause-on-idle = “false” - object.path = “alsa:acp:PCH:4:playback”
- object.serial = “60”
port.group = “playback” - priority.driver = “1009”
- priority.session = “1009”
but bit rate does not change.
pw-top
S ID QUANT RATE WAIT BUSY W/Q B/Q ERR FORMAT NAME
S 31 0 0 --- --- --- --- 0 Dummy-Driver
S 32 0 0 --- --- --- --- 0 Freewheel-Driver
S 55 0 0 --- --- --- --- 0 Midi-Bridge
S 58 0 0 --- --- --- --- 0 bluez_midi.server
R 61 1024 44100 309.6us 48.8us 0.01 0.00 1 S32LE 2 44100 alsa_output.pci-0000_00_1b.0.analog-stereo
R 39 0 0 71.7us 33.7us 0.00 0.00 0 F32P 2 0 + Parametric EQ input
R 40 0 0 9.5us 84.3us 0.00 0.00 0 F32P 2 0 + Parametric EQ output
R 90 3307 44100 52.5us 55.7us 0.00 0.00 0 F32LE 2 44100 + LibreWolf
S 62 0 0 --- --- --- --- 0 alsa_input.pci-0000_00_1b.0.analog-stereo
I 75 0 0 0.0us 0.0us ??? ??? 0 F32LE 2 44100 LibreWolf
I 85 0 0 0.0us 0.0us ??? ??? 0 F32LE 2 44100 LibreWolf
I 80 0 0 0.0us 0.0us ??? ??? 0 F32LE 2 44100 LibreWolf
S32LE 2 44100 alsa_output.pci-0000_00_1b.0.analog-stereo my configuration changes sample rates depends on source but bit rate no matter what not changes or i am missing something. Technically no sound corruption or any other releated problems i have but i expect if there is a setting for it. it should respect to my decision. The last output from hardware.
$ cat /proc/asound/card1/pcm0p/sub0/hw_params
access: MMAP_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 1024
buffer_size: 32768
Solution
I solved the issue after some research. My config was right but my hardware especially with alsa only supports two audio formats. Pipewire does not give me error about audio format either its supported or not. What i did is to play sound with aplay (alsa-utils) with the alsa path of my audio hardware. The output says my hardware actually support two audio format i confirm S16_LE and S32_LE work with monitor.alsa.rules in wireplumber configuration.
$ aplay -D hw:1 --dump-hw-params ~/Music/audiofilename.flac
HW Params of device "hw:1":
--------------------
ACCESS: MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT: S16_LE S32_LE
SUBFORMAT: STD MSBITS_MAX
SAMPLE_BITS: [16 32]
FRAME_BITS: [32 128]
CHANNELS: [2 4]
RATE: [32000 192000]
PERIOD_TIME: (41 16384000]
PERIOD_SIZE: [8 524288]
PERIOD_BYTES: [128 2097152]
PERIODS: [2 32]
BUFFER_TIME: (83 32768000]
BUFFER_SIZE: [16 1048576]
BUFFER_BYTES: [128 4194304]
TICK_TIME: ALL
--------------------
aplay: set_params:1387: Sample format non available
Available formats:
- S16_LE
- S32_LE