Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • pipewire pipewire
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 608
    • Issues 608
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 25
    • Merge requests 25
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

  • PipeWirePipeWire
  • pipewirepipewire
  • Issues
  • #2925
Closed
Open
Issue created Jan 02, 2023 by zDEFz@zDEFz

default.clock.rate results in wrong period_size for a frequency of 44100 Hz which leads to audio distortion at 44100 Hz and above

  • PipeWire version (pipewire --version):
pipewire
Compiled with libpipewire 0.3.63
Linked with libpipewire 0.3.63
  • Distribution and distribution version (PRETTY_NAME from /etc/os-release): Arch Linux
  • Desktop Environment: sway/wayland
  • Kernel version (uname -r): 6.1.1-arch1-1

Description of Problem:

Inadequate period_size when using default.clock.rate

How Reproducible:

Steps to Reproduce:

  1. In /pipewire/pipewire.conf set the following under context.properties
   default.clock.allowed-rates = [ 44100 48000 96000 192000 ]
   default.clock.quantum = 512
   default.clock.min-quantum = 16
   default.clock.max-quantum = 2048
   default.clock.quantum-limit = 512
   settings.check-quantum = false
   settings.check-rate = false
  1. Restart the pipewire service
  2. Use pw-play to playback a file. You can Download file: https://pomf2.lain.la/f/4wg6xrw3.mp3 and then convert it to wav PCM ffmpeg -i 4wg6xrw3.mp3 sample.wav
  3. During Playback of the sample file, query hw_params. Mine was under /proc/asound/DAC51080054/pcm0p/sub0/hw_params
  4. Write down the results. They were for me as follows:
access: MMAP_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 128
buffer_size: 2048
  1. In /pipewire/pipewire.conf, add a new line under context.properties containing the following: default.clock.rate = 192000
  2. Restart the pipewire service and start playback.
  3. My results were:
access: MMAP_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 32
buffer_size: 2048

Actual Results:

period_size is inadequately adjusted, leaving to severe audio distortion. For some reason, this issue would cause MPV to crackle, because it for some reason takes only a period_size of 8 from this.

Expected Results:

period_size is adequately adjusted, to ensure proper playback. Other programs are thereby not negatively affected

Additional Info (as attachments):

  • pw-dump > pw-dump.log:

I need further information which one precisely is required. Of the one working, or the one not working? Playback is working, but distorted, due to faulty calibration. The finding was originally assumed to be caused by MPV, but the difference in period_size is not normal. Ref: https://github.com/mpv-player/mpv/issues/11055

Edited Jan 02, 2023 by zDEFz
Assignee
Assign to
Time tracking