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

Program aborted with reason: Assertion 'pa_atomic_load(&(o)->_ref) >= 1' failed at ../src/pulse/operation.c:68, function pa_operation_unref(). #181

Open
Duy-Thanh opened this issue Nov 1, 2022 · 4 comments

Comments

@Duy-Thanh
Copy link

Basic Information

  • Platform (Mac, iOS, Android, Linux, etc): Linux Ubuntu 22.04.1
  • Built from source? (yes/no): yes
    • If yes, source branch/revision ID: master

Description of issue

I did a build from the master branch, everything was fine until when I ran the application, after the NewtonOS startup screen and sound startup played, and then the sound suddenly stopped, and in the next screen I clicked Continue (Welcome Screen in NewtonOS), but at the moment the sound continued and stopped again after it had moved to the next screen, and in the next screen, I press Next button, and when I press the button, the previous startup sound continues to play (It's like the startup sound was broken up and played every time the button was pressed and stopped when it moved to the next screen) and then it threw an error:

Assertion 'pa_atomic_load(&(o)->_ref) >= 1' failed at ../src/pulse/operation.c:68, function pa_operation_unref(). Aborting.
Aborted (core dumped)

As far as I understand this is a bug in implementing the emulator's audio to work with Linux's PulseAudio.

So, is there any workaround for this problem, and how can I fix it?

Expected behaviour

Fully working emulator with supported sound

Steps to reproduce issue

I did a build from the master branch, everything was fine until when I ran the application, after the NewtonOS startup screen and sound startup played, and then the sound suddenly stopped, and in the next screen I clicked Continue (Welcome Screen in NewtonOS), but at the moment the sound continued and stopped again after it had moved to the next screen, and in the next screen, I press Next button, and when I press the button, the previous startup sound continues to play (It's like the startup sound was broken up and played every time the button was pressed and stopped when it moved to the next screen)

@MatthiasWM
Copy link
Collaborator

Thanks, we had some very recent changes around sound handling on Linux. I have unfortunately
no Intel Linux machine available. Do you have a way to test if the version before the last commit works correctly for you? Also, the most recent binary release is very current.

@morgant
Copy link
Collaborator

morgant commented Dec 9, 2022

@chuma, I am experiencing this same error under OpenBSD, as well.

I don't use a desktop environment which would start pulseaudio automatically, so when testing Einstein I just do the following:

pulseaudio &
Einstein &

Einstein will start booting NewtonOS and I hear the startup sound, but Einstein seems to just hang at the Newton logo and never complete the boot process.

If I kill Einstein and launch it again, then Einstein crashes with the error mentioned in this issue. However, if I restart pulseaudio as follows, Einstein will then play the startup sound and hang again:

pulseaudio --kill
pulseaudio &

Update: The hanging issue seems to have been related to my einstein.prefs. Deleting it & reconfiguring allows it to boot at normal speed, though interactions that presumably would play sounds (such as tapping a button) do cause NewtonOS to hang without playing a sound.

@emulti
Copy link

emulti commented Dec 14, 2023

I can confirm that reverting the October 2022 commit related to Pulseaudio fixed this error for me.

$ git revert 80727f6
[master e4fc3d07] Revert "Fix performance hit, clicking output with Linux PulseAudio (#180)"
2 files changed, 201 insertions(+), 216 deletions(-)

@MatthiasWM
Copy link
Collaborator

I reverted the commit in the master. Sorry @chuma , it crashed many machines, and I don't have the time right now to fix this. Maybe you can look at 80727f6 and create a new PR?

Assertion 'pa_atomic_load(&(o)->_ref) >= 1' failed at ../src/pulse/operation.c:68, function pa_operation_unref(). Aborting.
Thread 19 "threaded-ml" received signal SIGABRT, Aborted.
[Switching to Thread 0xfffff5024da0 (LWP 8478)]
__pthread_kill_implementation (threadid=281474792312224, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
(gdb) bt
#0  __pthread_kill_implementation (threadid=281474792312224, signo=signo@entry=6, no_tid=no_tid@entry=0)
    at ./nptl/pthread_kill.c:44
#1  0x0000fffff6b4f254 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  0x0000fffff6b0a67c in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x0000fffff6af7130 in __GI_abort () at ./stdlib/abort.c:79
#4  0x0000fffff7f6bce8 in pa_operation_unref () at /lib/aarch64-linux-gnu/libpulse.so.0
#5  0x0000fffff6a7eca8 in  () at /usr/lib/aarch64-linux-gnu/pulseaudio/libpulsecommon-15.99.so
#6  0x0000fffff6a7fe18 in pa_pdispatch_run () at /usr/lib/aarch64-linux-gnu/pulseaudio/libpulsecommon-15.99.so
#7  0x0000fffff7f62288 in  () at /lib/aarch64-linux-gnu/libpulse.so.0
#8  0x0000fffff6a84980 in  () at /usr/lib/aarch64-linux-gnu/pulseaudio/libpulsecommon-15.99.so
#9  0x0000fffff6a8553c in  () at /usr/lib/aarch64-linux-gnu/pulseaudio/libpulsecommon-15.99.so
#10 0x0000fffff6a858d4 in  () at /usr/lib/aarch64-linux-gnu/pulseaudio/libpulsecommon-15.99.so
#11 0x0000fffff6a89424 in  () at /usr/lib/aarch64-linux-gnu/pulseaudio/libpulsecommon-15.99.so
#12 0x0000fffff7f74fc0 in pa_mainloop_dispatch () at /lib/aarch64-linux-gnu/libpulse.so.0
#13 0x0000fffff7f756a0 in pa_mainloop_iterate () at /lib/aarch64-linux-gnu/libpulse.so.0
#14 0x0000fffff7f75758 in pa_mainloop_run () at /lib/aarch64-linux-gnu/libpulse.so.0
#15 0x0000fffff7f85ea4 in  () at /lib/aarch64-linux-gnu/libpulse.so.0
#16 0x0000fffff6a9854c in  () at /usr/lib/aarch64-linux-gnu/pulseaudio/libpulsecommon-15.99.so
#17 0x0000fffff6b4d5c8 in start_thread (arg=0x0) at ./nptl/pthread_create.c:442
#18 0x0000fffff6bb5d5c in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:79

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