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

Sample JACK client (sfizz_jack) goes into infinite loop on EOF #1266

Open
acli opened this issue May 27, 2024 · 6 comments · May be fixed by #1274 or #1284
Open

Sample JACK client (sfizz_jack) goes into infinite loop on EOF #1266

acli opened this issue May 27, 2024 · 6 comments · May be fixed by #1274 or #1284

Comments

@acli
Copy link

acli commented May 27, 2024

sfizz-1.2.3 compiled with gcc 11. If I start sfizz_jack and then hit ctrl-d to try to end the program, sfizz_jack instead goes into an infinite loop and I’ll have to hit ctrl-c to stop it.

Example (ctrl-d was pressed on line 54, i.e., immediately after I got a prompt):

[...]
    42 Positional arguments: /opt/sfz/data/VCSL-1.2.2-RC/Chordophones/Zithers/Grand Piano, Kawai - Legacy.sfz,
    43 Instrument loaded: /opt/sfz/data/VCSL-1.2.2-RC/Chordophones/Zithers/Grand Piano, Kawai - Legacy.sfz
    44 ===========================
    45 Total:
    46         Masters: 0
    47         Groups: 3
    48         Regions: 126
    49         Curves: 7
    50         PreloadedSamples: 126
    51 ===========================
    52 Unknown opcodes:
    53 
    54 > 
    55 > 
    56 > 
    57 > 
    58 > 
[...]
 11039 > 
 11040 > 
 11041 > 
 11042 > 
 11043 > ^C> 
 11044 > 
 11045 > 
 11046 > Signal received
 11047 Closing...
@acli
Copy link
Author

acli commented May 27, 2024

Just tried this on current git version. Same behaviour and can also be reproduced by redirecting stdin from /dev/null.

@GeoffreyPlitt
Copy link

GeoffreyPlitt commented Jul 13, 2024

CC @acli @redtide @KKQ-KKQ Any help with this? Makes it impossible to run as a background job (launching with " &", etc)

@GeoffreyPlitt
Copy link

The REPL loop seems to be here if anyone knows how to fix it to properly detect EOF and exit:

void cliThreadProc()

In the meantime, my workaround is to send it an empty string and newline once per minute like this:
( ( while true; do echo $'\n'; sleep 60; done ) | /home/pi/sfizz-ui/build/library/bin/sfizz_jack ...) &

@KKQ-KKQ
Copy link
Contributor

KKQ-KKQ commented Jul 14, 2024

@acli In my personal opinion, the client should not quit by Ctrl-D or EOF in order to run as a background job.
Could you use a "quit" command instead? Or the client freezes?
Oh I didn't try this actually because I am not a linux user. It enters the infinite loop.

@KKQ-KKQ KKQ-KKQ linked a pull request Jul 14, 2024 that will close this issue
@acli
Copy link
Author

acli commented Jul 14, 2024

@KKQ-KKQ I have a patch too (actually three; I tried a few different ways). It’s still open after one and a half months; I’m supposing they’re too busy.

@acli
Copy link
Author

acli commented Jul 14, 2024

@GeoffreyPlitt Fixing this will not (and should not) allow it to run as a demon. When it detects EOF the CLI thread ends and the program will (should) exit.

I think what you need is a flag to disable the CLI. I should be able to make you an unofficial patch but it’s been more than a month since I touched this. (My computer is too slow to do SFZ; I’ve sort of given up.)

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