Open tj64 opened 2 years ago
Looks legit issue and legit solution.
I'll review tomorrow (and look into the midi-sco issue as well)
But we need to take into accout that
csound-play-flags
are defined (as opposed to undefined) and doesn't apply the rtaudio options, and the user loses audio for defining message level options.I had this in my doom emacs config.el, but first I had to figure out the problem with csound-mode on wsl2 (and how audio works in wsl2 now). The idea of this PR is to set defaults on wsl2 so everything works out-of-the box without each user having to analyse the situation again.
I understand the conflict between avoiding error messages for starters and not messing up csound configs of seasoned users.
Not sure if a new variable like "csound-wsl-flags" would help. Maybe just add another check for a .csoundrc (must be empty or non-existing)?
We could rethink the configuration variable, and set csound options on individual argument basis. So that rtaudio vars would be their own emacs var, within that, we could set them to defaults depending on the system configuration.
Sounds good to me. Maybe we could have a defvar (not defcustom) like csound-os-wslg-p
, and set that once with this code or something similar:
` (and
(string-match "linux" (format "%s" system-type))
(string-match "WSL2" operating-system-release)
(not (string-empty-p (getenv "PULSE_SERVER") ) ) )`
Then have defcustoms like csound-rtaudio-flag
, csound-server-flag
(maybe more, but thats all I need for WSL2). And we set them conditional on csound-os-wslg-p
as default.
But then they need to be used for csound-play
and csound-repl--start-server
.
How to proceed now? Reject/Delete the current PR, then either you implement this, or I try to create a new cleaner PR?
Hi, with current versions of WSL2 (Windows Subsystem for Linux) graphics and audio are possible, the latter due to a running Pulse Server on WSLg, linked to the users linux distro via env var $PULSE_SERVER.
I added some code that
Cheers Thorsten
PS sorry for the accidental formatting noise in the PR. And something similar needs to be done for csound-repl, but I'm not yet there, maybe another PR soon