-
-
Notifications
You must be signed in to change notification settings - Fork 292
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
[BUG] MIDI failure in JVM on fresh install cause alda and alda-player to both fail #496
Comments
Hi, thanks for reporting this! I did a little googling, and it seems like maybe audio doesn't work out of the box in WSL. I found this page, which looks like it has some good information about setting up audio in WSL. I'm curious - if you install and run Firefox (or other programs that produce sound) inside WSL, does the audio work? |
Hi, thanks for looking at this! The linked blog post is out of date (it's for the WSL 1 Beta from 7 years ago). In WSL2, audio has been built in since the release of the WSLg project a few years ago (https://github.com/microsoft/wslg). Any installation of WSL 2 inside of Windows 11 will include WSLg by default. The workaround suggested in the blog (install PulseAudio) is now a native component within WSL2, so I don't think that's the issue. Various scattered comments seem to corroborate this (microsoft/WSL#7107 (comment)). I could be misunderstanding the dependency chain, but the MidiEngine.<init>:281 - Initializing MIDI synthesizer...
Exception in thread "main" javax.sound.midi.MidiUnavailableException: Can not open line
...
Caused by: java.lang.IllegalArgumentException: No line matching interface SourceDataLine supporting format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian is supported. I will note that installed under Windows rather than WSL, the application does seem to work. Further investigationI've tried the following:
So I don't think it's an issue with Java per se. At any rate, I've found scattered comments with similar issues (https://stackoverflow.com/questions/71381472/issues-with-javax-sound-midi-with-midiunavailableexception-and-illegalargumentex), but none with a clean resolution. My suspicion is that it's some deeper issue between JVM's MIDI engine and WSL but I realize that's not much to go on. If nothing jumps out at you I'll just run it on Windows I guess. |
This is where I'm at, as well. I wish I understood better what the issue was... I'll leave this issue open in the hope that someone comes along who can be of more help. |
🐞 Bug report 🐞
Description
On a fresh install, the software seems unable to start due to Java issues with MIDI. (WSL Debian / Java 17 / more details below)
Steps to Reproduce
apt
(Java 17, which is behind the newest 21 LTS on Adoptium butalda.io
doesn't list a minimum required version).$ sudo apt-get install openjdk-17-jre $ java -version openjdk version "17.0.10" 2024-01-16 OpenJDK Runtime Environment (build 17.0.10+7-Debian-1deb11u1) OpenJDK 64-Bit Server VM (build 17.0.10+7-Debian-1deb11u1, mixed mode, sharing) $ wget https://alda-releases.nyc3.digitaloceanspaces.com/2.2.7/client/linux-amd64/alda $ wget https://alda-releases.nyc3.digitaloceanspaces.com/2.2.7/player/non-windows/alda-player
.bashrc
Expected Behavior
The post-install verification commands should successfully execute.
Actual Behavior
Both programs error out.
Environment
Operating system and version: Windows 11
Run in WSL 2 - Debian.
$ cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 11 (bullseye)" ...
Alda version:
Health check:
Logs:
The server seems locked in a loop where it tries to restart the MIDI engine. However, no actual errors are logged to the file.
(Something similar to the above on different ports comprises the majority of the logfiles).
The text was updated successfully, but these errors were encountered: