patroclos / PAmix

ncurses/curses pulseaudio mixer in c++ similar to pavucontrol
MIT License
140 stars 10 forks source link

NCurses "Playback" screen disappears when repeatedly playing short samples #80

Open farblos opened 1 week ago

farblos commented 1 week ago

Thanks for PAmix! Please keep going on that!

Version information:

[~]$ pamix --version
PAmix v 

Uh, OK, not very helpful :-). Would that be a packaging issue?

Anyway, more version information on the used Debian testing package:

Package: pamix
Version: 1.6~git20180112.ea4ab3b-4+b1
State: installed
Automatically installed: no
Multi-Arch: foreign
Priority: optional
Section: sound
Maintainer: Josue Ortega <josue@debian.org>
Architecture: amd64
Uncompressed Size: 167 k
Depends: libc6 (>= 2.34), libgcc-s1 (>= 3.0), libncursesw6 (>= 6), libpulse0 (>= 0.99.1), libstdc++6 (>= 12), libtinfo6 (>= 6)
Recommends: pulseaudio
Description: Pulseaudio terminal mixer based in pavucontrol
 PAMix is an ncurses/curses pulseaudio mixer in C++ similar to pavucontrol designed to run in the terminal, it allows you to control both the volume of hardware devices and of each playback stream separately.
Homepage: https://github.com/patroclos/PAmix
Tags: uitoolkit::ncurses

Reproducer:

Expected Result:

pamix continues to display the noise in the sound bar on the Playback screen.

Actual Result:

After a couple of loop cycles, the alternate screen of the ncurses display goes away, showing the running pamix. In addition pamix then starts to eat CPU cycles up to 100% load. An strace seems to show that it cycles on the following:

--- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=NULL} ---
write(1, "\33[?1l\33>", 7)              = 7
ioctl(1, TCGETS, {c_iflag=ICRNL|IXON|IUTF8, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPO
ST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|
ECHOCTL|ECHOKE, ...}) = 0
ioctl(1, TCSETSW, {c_iflag=ICRNL|IXON|IUTF8, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OP
OST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN
|ECHOCTL|ECHOKE, ...}) = 0
ioctl(1, TCGETS, {c_iflag=ICRNL|IXON|IUTF8, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPO
ST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|
ECHOCTL|ECHOKE, ...}) = 0
rt_sigreturn({mask=[]})                 = 0
patroclos commented 5 days ago

Thank you for the report.

I recently rewrote this project and addressed some synchronization issues in the process. Could you try running your test against the dev branch?

farblos commented 1 day ago

Could you try running your test against the dev branch?

Will try over the weekend.

For the record: I get the same symptoms (with the aforementioned version of pamix) when I toggle "mute" frequently enough on a Firefox tab playing some sound.

farblos commented 12 hours ago

The dev branch fixes this issue!

That's already one good reason to switch from C++ to C, but I'm curious what was your main reason to rewrite this in plain C?

Thanks again!