Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a52 plugin crashing pulseaudio #28

Closed
quequotion opened this issue Jun 17, 2021 · 8 comments
Closed

a52 plugin crashing pulseaudio #28

quequotion opened this issue Jun 17, 2021 · 8 comments

Comments

@quequotion
Copy link
Contributor

quequotion commented Jun 17, 2021

Ever since f11e7a8, the recent commit that brings the a52 plugin up to speed with ffmpeg's requirement for s32le format sampling, sending any audio to plug:a52 from any pulseaudio client crashes pulseaudio.

I posted this log earlier in #23, in which audio from mpv crashes pulseaudio.

I have tried other clients since and they all crash the same way.

This is with a default pulseaudio configuration, as shipped in Archlinux, and the following /etc/asound.conf:

# Alsa Resampler
 defaults.pcm.rate_converter "speexrate_best"

# Use PulseAudio by default
pcm.!default {
  type pulse
  fallback "sysdefault"
  hint {
    show on
    description "Default ALSA Output (currently PulseAudio Sound Server)"
  }
}

ctl.!default {
  type pulse
  fallback "sysdefault"
}

defaults.namehint.showall on
defaults.namehint.extended on

To enable the use of plug:a52 in pulseaudio without configuring it manually, I select the "Digital Surround 5.1 (IEC958/AC3) Output" profile in pavucontrol.

Pulseaudio, as far as I know, is agnostic of how ALSA plugins work internally. This leads me to think there is something not getting done right in the new patchset, even if it is tolerable in an ALSA-only setup.

@tiwai
Copy link
Contributor

tiwai commented Jun 17, 2021

Please try to catch the crash with gdb and check the backtrace, identify which place it's triggered.

@perexg
Copy link
Member

perexg commented Jun 17, 2021

It seems that something is slow. PA with --realtime=false does not trigger this, so it's killed by the kernel. gdb does not help here.

@quequotion
Copy link
Contributor Author

quequotion commented Jun 17, 2021

It seems that something is slow. PA with --realtime=false does not trigger this, so it's killed by the kernel. gdb does not help here.

Here's pulseaudio getting started by systemd and then killed, a couple of times, from journalctl -f:

Jun 17 23:21:22 Shiroko systemd[2338]: Listening on Sound System.
Jun 17 23:21:22 Shiroko io.elementary.n[11139]: gtk_widget_size_allocate(): attempt to allocate widget with width 292 and height -9
Jun 17 23:21:53 Shiroko systemd[2338]: Starting Sound Service...
Jun 17 23:21:53 Shiroko pulseaudio[135114]: Stale PID file, overwriting.
Jun 17 23:21:54 Shiroko rtkit-daemon[8609]: Supervising 0 threads of 0 processes of 0 users.
Jun 17 23:21:54 Shiroko rtkit-daemon[8609]: Successfully made thread 135117 of process 135114 owned by '1000' RT at priority 5.
Jun 17 23:21:54 Shiroko rtkit-daemon[8609]: Supervising 1 threads of 1 processes of 1 users.
Jun 17 23:21:54 Shiroko systemd[2338]: Started Sound Service.
Jun 17 23:21:54 Shiroko bluetoothd[626]: Endpoint registered: sender=:1.216 path=/MediaEndpoint/A2DPSink/sbc
Jun 17 23:21:54 Shiroko bluetoothd[626]: Endpoint registered: sender=:1.216 path=/MediaEndpoint/A2DPSource/sbc
Jun 17 23:22:18 Shiroko bluetoothd[626]: Endpoint unregistered: sender=:1.216 path=/MediaEndpoint/A2DPSink/sbc
Jun 17 23:22:18 Shiroko bluetoothd[626]: Endpoint unregistered: sender=:1.216 path=/MediaEndpoint/A2DPSource/sbc
Jun 17 23:22:18 Shiroko systemd[2338]: pulseaudio.service: Main process exited, code=killed, status=9/KILL
Jun 17 23:22:18 Shiroko systemd[2338]: pulseaudio.service: Failed with result 'signal'.
Jun 17 23:22:18 Shiroko systemd[2338]: pulseaudio.service: Consumed 11.158s CPU time.
Jun 17 23:22:18 Shiroko systemd[2338]: pulseaudio.service: Scheduled restart job, restart counter is at 1.
Jun 17 23:22:18 Shiroko systemd[2338]: Stopped Sound Service.
Jun 17 23:22:18 Shiroko systemd[2338]: pulseaudio.service: Consumed 11.158s CPU time.
Jun 17 23:22:18 Shiroko systemd[2338]: Starting Sound Service...
Jun 17 23:22:18 Shiroko pulseaudio[135182]: Stale PID file, overwriting.
Jun 17 23:22:18 Shiroko rtkit-daemon[8609]: Supervising 0 threads of 0 processes of 0 users.
Jun 17 23:22:18 Shiroko rtkit-daemon[8609]: Successfully made thread 135183 of process 135182 owned by '1000' RT at priority 5.
Jun 17 23:22:18 Shiroko rtkit-daemon[8609]: Supervising 1 threads of 1 processes of 1 users.
Jun 17 23:22:18 Shiroko systemd[2338]: Started Sound Service.
Jun 17 23:22:18 Shiroko bluetoothd[626]: Endpoint registered: sender=:1.218 path=/MediaEndpoint/A2DPSink/sbc
Jun 17 23:22:18 Shiroko bluetoothd[626]: Endpoint registered: sender=:1.218 path=/MediaEndpoint/A2DPSource/sbc
Jun 17 23:22:19 Shiroko bluetoothd[626]: Endpoint unregistered: sender=:1.218 path=/MediaEndpoint/A2DPSink/sbc
Jun 17 23:22:19 Shiroko bluetoothd[626]: Endpoint unregistered: sender=:1.218 path=/MediaEndpoint/A2DPSource/sbc
Jun 17 23:22:19 Shiroko systemd[2338]: pulseaudio.service: Main process exited, code=killed, status=9/KILL
Jun 17 23:22:19 Shiroko systemd[2338]: pulseaudio.service: Failed with result 'signal'.
Jun 17 23:22:19 Shiroko systemd[2338]: pulseaudio.service: Scheduled restart job, restart counter is at 2.
Jun 17 23:22:19 Shiroko systemd[2338]: Stopped Sound Service.
Jun 17 23:22:19 Shiroko systemd[2338]: Starting Sound Service...
Jun 17 23:22:19 Shiroko pulseaudio[135191]: Stale PID file, overwriting.
Jun 17 23:22:19 Shiroko rtkit-daemon[8609]: Supervising 0 threads of 0 processes of 1 users.
Jun 17 23:22:19 Shiroko rtkit-daemon[8609]: Successfully made thread 135192 of process 135191 owned by '1000' RT at priority 5.
Jun 17 23:22:19 Shiroko rtkit-daemon[8609]: Supervising 1 threads of 1 processes of 1 users.
Jun 17 23:22:19 Shiroko systemd[2338]: Started Sound Service.
Jun 17 23:22:19 Shiroko bluetoothd[626]: Endpoint registered: sender=:1.220 path=/MediaEndpoint/A2DPSink/sbc
Jun 17 23:22:19 Shiroko bluetoothd[626]: Endpoint registered: sender=:1.220 path=/MediaEndpoint/A2DPSource/sbc
Jun 17 23:22:19 Shiroko bluetoothd[626]: Endpoint unregistered: sender=:1.220 path=/MediaEndpoint/A2DPSink/sbc
Jun 17 23:22:19 Shiroko bluetoothd[626]: Endpoint unregistered: sender=:1.220 path=/MediaEndpoint/A2DPSource/sbc
Jun 17 23:22:19 Shiroko systemd[2338]: pulseaudio.service: Main process exited, code=killed, status=9/KILL
Jun 17 23:22:19 Shiroko systemd[2338]: pulseaudio.service: Failed with result 'signal'.
Jun 17 23:22:20 Shiroko systemd[2338]: pulseaudio.service: Scheduled restart job, restart counter is at 3.
Jun 17 23:22:20 Shiroko systemd[2338]: Stopped Sound Service.
Jun 17 23:22:20 Shiroko systemd[2338]: Starting Sound Service...
Jun 17 23:22:20 Shiroko pulseaudio[135199]: Stale PID file, overwriting.
Jun 17 23:22:20 Shiroko rtkit-daemon[8609]: Supervising 0 threads of 0 processes of 1 users.
Jun 17 23:22:20 Shiroko rtkit-daemon[8609]: Successfully made thread 135200 of process 135199 owned by '1000' RT at priority 5.
Jun 17 23:22:20 Shiroko rtkit-daemon[8609]: Supervising 1 threads of 1 processes of 1 users.
Jun 17 23:22:20 Shiroko systemd[2338]: Started Sound Service.
Jun 17 23:22:20 Shiroko bluetoothd[626]: Endpoint registered: sender=:1.222 path=/MediaEndpoint/A2DPSink/sbc
Jun 17 23:22:20 Shiroko bluetoothd[626]: Endpoint registered: sender=:1.222 path=/MediaEndpoint/A2DPSource/sbc

EDIT: I tried adding realtime-scheduling = no to /etc/pulse/daemon.conf.

Good news: pulseaudio does not immediately die when a client attempts to send audio through plug:a52

Bad news: CPU usage maxes out and no audio is produced. In fact, even pavumeter fails to register any audio.

@quequotion
Copy link
Contributor Author

@manio helped out with reverting f11e7a8 (see diff).

This did allow pulseaudio to use the plugin again, but of course also brought back the choppy, chipmunk effect.

perexg added a commit that referenced this issue Jun 18, 2021
BugLink: #28
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
@perexg
Copy link
Member

perexg commented Jun 18, 2021

Try latest sources from repo, please.

@tiwai
Copy link
Contributor

tiwai commented Jun 18, 2021

Also, try tsched=0 for PA. It's a blind shot, but this is always the first thing for a problem on PA.

@manio
Copy link

manio commented Jun 18, 2021

AFAICT your recent two commits probably fixed the problem :)
I removed .asoundrc, enabled and started pulseaudio server and tested the audio on mpv and spotify. No problems noticed :)
Before those two commits I have the same problem as @quequotion - the PA server was crashing.

Let's just wait for the @quequotion final test... :)

@quequotion
Copy link
Contributor Author

Indeed, this has done the trick!

How do I buy all of you a round for the Zoom party we're having when this gets to release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants