Use "Edit" above to add a comment to this ticket.

Ticket Hash: 17ae9a7fab6de3f711c7ea3e40a87d0c4e6dd35e
Title: Stuttering when remote control is activated
Status: Closed Type: Code_Defect
Severity: Severe Priority: Immediate
Subsystem: Resolution: Fixed
Last Modified: 2025-04-07 20:13:28
Version Found In: 0.7.0-dev
User Comments:
MistressRemilia added on 2025-03-04 22:57:56:

When the --remote option is specified (or remote: true is in the config), and the CRYSTAL_WORKERS environment variable is set to 4 or less, then Benben stutters bad when playing anything. Disabling the remote control feature, or increasing CRYSTAL_WORKERS to 5 or more, fixes the problem.

This was first noticed after I upgraded from Crystal v1.12.2 to v1.15.1, so I suspect that newer versions of Crystal break the way Benben overrides CRYSTAL_WORKERS in fun main in main.cr


MistressRemilia added on 2025-03-04 23:10:35:

I can confirm that the regression happens when compiling Benben with Crystal v1.15.0 or later. My guess is that the Crystal developers changed the way things work within the Crystal runtime starting at this version, and so the workaround present in main.cr no longer works.

As a workaround for now, when compiling with Crystal version 1.15.0 or later, you can do one or both of the following:

  • Set CRYSTAL_WORKERS environment variable to a value of 5 or higher. A value of 9 or higher would be even better.
  • Do not use the remote control feature. Either put remote: false in your config, or do not use the --remote command line option.

Note that the AppImages are compiled with an earlier version of Crystal, and are not affected.


MistressRemilia added on 2025-04-07 20:13:28:

I've confirmed this goes away in what will become v0.7.0. Probably because it's a non-issue to begin with since we have access to real threads in Common Lisp.