Fedora 41 pipewire how do i enable sample rate higher than 48000

I have copied the pipewire.conf to my ~/.config/pipewire path with the following entries uncommented, my laptops built-in sound card supports up to 192000 sample rate. I’m using the headphone jack from my computer into the aux on a soundbar. All my music plays fine just never at the correct sample rate for the hi-res audio files.

Properties for the DSP configuration.

default.clock.rate = 96000
default.clock.allowed-rates = [ 48000 44100 88200 96000 192000 ]

I have restarted the pipewire daemon but still when I run this command below to see the stream for the song playing, I get the following even though my audio file is 24 bit/96000. How can i make this work? Thank you,

less /proc/asound/card0/pcm0p/sub0/hw_params

access: MMAP_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 1024
buffer_size: 8192

It shows in my latest pipewire live settings that my requested sample rate is configured below.

update: id:0 key:‘log.level’ value:‘2’ type:‘’
update: id:0 key:‘clock.rate’ value:‘96000’ type:‘’
update: id:0 key:‘clock.allowed-rates’ value:‘[ 48000, 44100, 88200, 96000, 192000 ]’ type:‘’
update: id:0 key:‘clock.quantum’ value:‘1024’ type:‘’
update: id:0 key:‘clock.min-quantum’ value:‘32’ type:‘’
update: id:0 key:‘clock.max-quantum’ value:‘2048’ type:‘’
update: id:0 key:‘clock.force-quantum’ value:‘0’ type:‘’
update: id:0 key:‘clock.force-rate’ value:‘0’ type:‘’

I even tried here recently to add this to my /etc/asound.conf but no dice either:

pcm.device{
rate 96000
type hw
card 0
device 0
}

@hmsm78,

Maybe it is the player that is using the lower sample rate. Take a look at

man gstlaunch-1.0

as it allows you to set your desired rate.

Once you can play at the desired rate with gstlaunch-1.0 look into other application configuration settings.

Hi Stephen-

I appreciate the response. I will look into this tool you mentioned. I’m using moc (music on console) it supports whatever source file I give it to play to my default audio source. In my moc config file, I have these settings below.

Always use this sample rate (in Hz) when opening the audio device (and
resample the sound if necessary). When set to 0 the device is opened
with the file’s rate.
ForceSampleRate = 0

By default, even if the sound card reports that it can output 24bit samples
MOC converts 24bit PCM to 16bit. Setting this option to ‘yes’ allows MOC
to use 24bit output. (The MP3 decoder, for example, uses this format.)
This is disabled by default because there were reports that it prevents
MP3 files from playing on some soundcards.
Allow24bitOutput = yes

Made a new discovery today via pw-top command. It shows this below, so it seems that moc is indeed playing the file at 96000 but ALSA is somehow just hardcoded to 48000.

It is not common for integrated soundcards to be able to play higher than 48Khz. Are you certain that your soundcard supports this at the hardware level?

Hi Olivier-

Yes, as shown below the headphone jack on this laptop supports the following, the 0x560 is my headphone jack. Cheers,

grep -P ‘rates|bits’ /proc/asound/card0/codec#0
rates [0x560]: 44100 48000 96000 192000
bits [0xe]: 16 20 24
rates [0x40]: 48000
bits [0xe]: 16 20 24
rates [0x40]: 48000
bits [0xe]: 16 20 24
rates [0x40]: 48000
bits [0xe]: 16 20 24
rates [0x40]: 48000
bits [0xe]: 16 20 24
rates [0x560]: 44100 48000 96000 192000
bits [0xe]: 16 20 24
rates [0x560]: 44100 48000 96000 192000
bits [0xe]: 16 20 24

I was mistaken my headphone jack is not on 0x560 its on 0x40 which only supports 48000. I also tested with a USB dac and I do get 96000 and 192000 on ALSA now. Thank you Olivier for having me double check this on my hardware. The full output from this command cleared up my confusion, below are the important parts. cat /proc/asound/card0/codec#0

Node 0x02 [Audio Output] wcaps 0x41d: Stereo Amp-Out
Control: name=“Speaker Playback Volume”, index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
Amp-Out caps: ofs=0x57, nsteps=0x57, stepsize=0x02, mute=0
Amp-Out vals: [0x00 0x00]
Converter: stream=0, channel=0
PCM:
rates [0x40]: 48000
bits [0xe]: 16 20 24
formats [0x1]: PCM
Power states: D0 D1 D2 D3 EPSS
Power: setting=D0, actual=D0
Node 0x03 [Audio Output] wcaps 0x41d: Stereo Amp-Out
Control: name=“Headphone Playback Volume”, index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
Amp-Out caps: ofs=0x57, nsteps=0x57, stepsize=0x02, mute=0
Amp-Out vals: [0x38 0x38]
Converter: stream=0, channel=0
PCM:
rates [0x40]: 48000
bits [0xe]: 16 20 24
formats [0x1]: PCM
Power states: D0 D1 D2 D3 EPSS
Power: setting=D0, actual=D0

1 Like

Added audio, pipewire

Added f41