I have also experienced audio dropouts on PipeWire. In my case, I found that
the audio data-loop threads were not running with realtime scheduling after
login; restarting the user audio services made them realtime. I reported this
separately in LP #2174841:
https://bugs.launchpad.net/ubuntu/+source/pipewire/+bug/2174841

### Check realtime scheduling

Could you check the scheduler class of PipeWire's audio threads while the
crackling occurs? Realtime scheduling applies to individual threads, so
checking only the main process may miss it. Please capture this output before
restarting anything, and again after restarting the user audio services:

```sh
for p in $(pgrep -x pipewire; pgrep -x pipewire-pulse; pgrep -x wireplumber); do
  ps -L -p "$p" -o pid,tid,cls,rtprio,pri,ni,comm
done
```

Look for each `data-loop.0` thread. `RR` with a positive `RTPRIO` means it is
running with a realtime policy; `TS` and `-` mean `SCHED_OTHER`. For an
individual thread ID, you can also run:

```sh
chrt -p TID
```

Replace `TID` with the thread ID shown by `ps`.

If the threads are not realtime, please save the output above and then try
restarting the user audio services with:

```sh
systemctl --user restart pipewire.service pipewire-pulse.service 
wireplumber.service
```

This briefly interrupts audio. After the services return, run the `ps` command
again and note whether the `data-loop.0` threads changed to `RR`.

### Try a 44.1 kHz A52/AC-3 rate

Your `pactl load-module module-alsa-sink` example explicitly requests
`rate=48000`. As a diagnostic, could you try an A52 PCM configured for
44100 Hz? The upstream [A52 plugin 
documentation](https://github.com/alsa-project/alsa-plugins/blob/master/doc/a52.txt)
says its `rate` option sets the input/output sample rate; it accepts 44100 or
48000 Hz and defaults to 48000.

For example, a temporary PCM definition in `~/.asoundrc` could be:

```conf
pcm.a52_44100_test {
  type a52
  slavepcm "hw:0,3"
  rate 44100
  channels 6
  bitrate 448
}
```

Then load a test sink using that PCM and request 44100 Hz from PipeWire
too:

```sh
pactl load-module module-alsa-sink \
  device="plug:a52_44100_test" \
  sink_name=astro_ac3_44100_test \
  format=s32le rate=44100 channels=6 \
  channel_map=front-left,front-right,rear-left,rear-right,front-center,lfe
```

This is only a diagnostic suggestion, not a confirmed fix. Please report
whether the sink loads, whether the crackling changes, and whether the log
still shows `snd_pcm_start: Broken pipe`. The system-wide example is
`/usr/share/alsa/alsa.conf.d/60-a52-encoder.conf`; a temporary user PCM avoids
editing that package-managed file.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2171344

Title:
  AC-3 5.1 output crackles with PipeWire, but works directly through
  ALSA

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pipewire/+bug/2171344/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to