Closed EspressoKyle closed 4 weeks ago
I talked to the runelite devs about this recently. The reason --configure doesn't work is because it saves a settings.json in the CWD, and runelite searches for that file in CWD on startup, but when Bolt starts its CWD will be somewhere in /opt.
The solution will be to add a "RuneLite (configure)" option to Bolt like the official launcher has. I'd already been meaning to do this but been wrapped up in something else recently.
A better workaround for now might be to set the jvm args you need in the _JAVA_OPTIONS environment variable.
On Tue, 30 Jan 2024, 15:22 Kyle Walters, @.***> wrote:
I am using Bolt on Arch Linux to play OSRS with RuneLite.
I have been troubleshooting an audio-related issue. This issue seems to be affecting some RuneLite Linux users. I found a solution to this issue mentioned here https://github.com/runelite/runelite/issues/3525#issuecomment-1813525702
I'm not very familiar with the inner workers on java relating to the --configure option that is mentioned in that solution. Although, I was able to confirm, that JVM options that are added via the java --configure option do not apply to instances of runelite that are started through the Bolt Launcher.
I suspect this is due to the fact the Bolt Launcher sets its own JAVA HOME, but unsure.
As I was able to confirm that adding those JVM options to the execution of the RuneLite.jar from outside of Bolt Launcher resolved the "no sound" issue for myself. As the JVM options applied via --configure did not apply to instances of RuneLite.jar that was launched through the Bolt Launcher, the temporary solution that I was able to implement is as follows.
- Execute java -jar RuneLite.jar --configure and add the following options to the JVM section:
-Djavax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider -Djavax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider
- Unmute the login screen music and see if this fixes the "no sound" issue, if it does, then proceed to the next steps.
- execute archlinux-java get and make note of the java version from the output.
- (as root) cd /usr/lib/jvm/
/bin - (as root) mv ./java ./java-real
- (as root) vim ./java and populate it with the following:
!/bin/bash
echo "$*" | grep -i "\ runelite.jar"
arguments=$(echo "$*" | sed "s/net.runelite.client.RuneLite//g")
if [ "$?" -eq 0 ]; then java2 $arguments -Djavax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider -Djavax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider net.runelite.client.RuneLite else java2 $* fi
7.(as root) chmod a+x ./java
- attempt launching RuneLite through the Bolt Launcher.
Notes: I recognize this solution isn't ideal for several reasons and should only function as a temporary "fix" until the downstream issue with alsa/java/runelite is resolved. Although its not an issue with Bolt Launcher itself, given the current working fix for this issue is a sub par solution, as you have to replace the java binary with a "helper" bash script that intercepts and modifies usage of the java command specifically when used for the RuneLite.jar. This can present issues as if java is updated, or you switch java versions, the solution will stop functioning, additionally, this solution may have an unidentified issue that leads to the execution of other java applications being affected.
With that in mind, below are the instructions for how to "undo" the changes.
(as root)
- cd /usr/lib/jvm/
/bin - mv ./java2 ./java
- chmod a+x ./java
and if you need to completely reinstall java, please refer to your distributions instructions for that matter.
— Reply to this email directly, view it on GitHub https://github.com/Adamcake/Bolt/issues/19, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHG6BIAZJ2UJNA5RXHRAJWLYREF43AVCNFSM6AAAAABCROHW42VHI2DSMVQWIX3LMV43ASLTON2WKOZSGEYDQMJTGA2DOMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I tried using _JAVA_OPTIONS
without luck.
This Runelite issue thread, mentions configuring the Runelite JAR with the same options but that doesn't fix it for me either, even if I tell bolt
to use that as a custom Runelite JAR. I am not privy to the inner (or outer tbh) workings of Java so I'm definitely missing something :upside_down_face:.
I haven't tried @EspressoKyle's bash wrapper script solution.
An extra wrinkle in this situation is that runelite.jar is actually just a launcher, which downloads all the latest runelite binaries and runs them by starting up a totally separate JVM. So passing command-line options to the launcher's JVM doesn't configure the actual game client's JVM... but you can do that by using runelite's -J
option to pass through args.
java --some-jvm-arg -jar runelite.jar -J--some-jvm-arg
Here the first configures the launcher and the second configures the game. The arguments do need to be in exactly this order: JVM args before the JAR, and -J args after it.
I have no idea how this is represented in the --configure menu though.
@deejcunningham
I tried using _JAVA_OPTIONS without luck.
I haven't tried updating my _JAVA_OPTIONS env variable so I am not able to confirm myself yet. But, I would think that should of worked. How environment variables are applied in Linux can be a bit non-intuitive. Please attempt the following and report back if possible.
_JAVA_OPTIONS
from the following files (assuming your default shell is Bash (/bin/bash).add...
export _JAVA_OPTIONS="-Djavax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider -Djavax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider"
... to $HOME/.profile
How to restart your display manager is different depending on if your system uses Systemd or Sysctl and which display manager that you are using (GDM, LightDM, etc). If you know how to restart your display manager, then do that, otherwise just reboot your device.
echo $_JAVA_OPTIONS
to confirm that the environment variable is set and exported.This Runelite issue https://github.com/runelite/runelite/issues/3525#issuecomment-1813525702, mentions configuring >the Runelite JAR with the same options but that doesn't fix it for me either, even if I tell bolt to use that as a custom >Runelite JAR. I am not privy to the inner (or outer tbh) workings of Java so I'm definitely missing something 🙃.
I haven't tried @EspressoKyle's bash wrapper script solution.
During my original testing before I created the mentioned helper script, I also tried using the --configure
option on a separately downloaded Runelite Jar file and then I executed java -jar ./Runelite.jar --configure
prior to configuring bolt to use that specific jar file (to see if the JVM options that I configured in the --configure
dialog would also apply to jar files that were ran through Bolt Launcher. Sadly, the JVM options that I specified in the --configure
only applied when I ran that specific runelite jar directly with java -jar ./Runelite.jar
. But, it didn't apply to that same RuneLite jar being started by the Bolt Launcher.
I was able to provide definitive confirmation that any JVM options configured using --configure will not apply to the RuneLite.jar file executed by Bolt Launcher doing the following:
java
command is executed and Runelite.jar
is mentioned in the command line arguments ("$*" in bash).--configure
dialog opened and the JVM Options section was blank. Following that, I re-executed java -jar ./Runelite.jar --configure
and confirmed that the settings that I configured in the JVM Options section were still present while running the runelite.jar directly (not using Bolt Launcher).The above confirmed my suspicions that the JVM options configured using the --configure
option were not being applied when the Runelite.jar was started by the Bolt Launcher.
An extra wrinkle in this situation is that runelite.jar is actually just a launcher, which downloads all the latest runelite binaries and runs them by starting up a totally separate JVM. So passing command-line options to the launcher's JVM doesn't configure the actual game client's JVM... but you can do that by using runelite's
-J
option to pass through args.
java --some-jvm-arg -jar runelite.jar -J--some-jvm-arg
Here the first configures the launcher and the second configures the game. The arguments do need to be in exactly this order: JVM args before the JAR, and -J args after it.I have no idea how this is represented in the --configure menu though.
@Adamcake
Regarding your thinking that the JVM options that are applied to the parent RuneLite.jar file wouldn't be applied the the subsequently downloaded jar files.
This was intriguing to me as the helper script that I wrote should only inject those mentioned JVM options into instances where the java
command is used in combination with (case insensitive) runelite.jar
is also used.
Thus, I performed some further testing by modifying my helper script to capture exactly what uses of the java
command the JVM Options were being injected into. Here is the modified helper script with an additional line to log any commands that my script is injecting those JVM options into, also log that entire command to a file. With this, we can see the entirety of any commands that are being passed the JVM options through my helper script.
#!/bin/bash
echo "$*" | grep -iE "\ ('runelite.jar'|'hdos.jar')"
arguments=$(echo "$*" | sed "s/net\.runelite\.client\.RuneLite//g")
if [ "$?" -eq 0 ]; then
echo "java2 $arguments -Djavax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider -Djavax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider net.runelite.client.RuneLite" | tee -a ~yooblie/tmp.txt
java2 $arguments -Djavax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider -Djavax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider net.runelite.client.RuneLite
else
java2 $*
fi
Here is the findings:
My helper script injected the mentioned JVM options into two different commands that were both executed following pressing the "Runelite" button within the Bolt Launcher.
java2 -Duser.home=/home/yooblie/.local/share/bolt-launcher -jar /home/yooblie/.local/share/bolt-launcher/runelite.jar -J-Duser.home=/home/yooblie/.local/share/bolt-launcher -Djavax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider -Djavax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider net.runelite.client.RuneLite
java2 -cp /home/yooblie/.local/share/bolt-launcher/.runelite/repository2/client-1.10.21.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/slf4j-api-1.7.25.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/logback-classic-1.2.9.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/logback-core-1.2.9.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/jopt-simple-5.0.1.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/guava-23.2-jre.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/guice-4.1.0-no_aop.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/javax.inject-1.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/aopalliance-1.0.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/gson-2.8.5.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/flatlaf-3.2.5-rl2.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/commons-text-1.2.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/commons-lang3-3.7.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/archive-patcher-applier-1.2.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/jna-5.9.0.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/jna-platform-5.9.0.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/jsr305-3.0.2.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/protobuf-javalite-3.21.12.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/rlawt-1.4.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/lwjgl-3.3.2.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/lwjgl-3.3.2-natives-linux.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/lwjgl-opengl-3.3.2.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/lwjgl-opengl-3.3.2-natives-linux.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/lwjgl-opencl-3.3.2.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/client-patch-1.10.21.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/http-api-1.2.12.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/okhttp-3.14.9.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/okio-1.17.2.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/discord-1.4.jar:/home/yooblie/.local/share/bolt-launcher/.runelite/repository2/runelite-api-1.10.21-runtime.jar -XX:+DisableAttachMechanism -Xmx768m -Xss2m -XX:CompileThreshold=1500 -Dsun.java2d.opengl=false -Drunelite.launcher.version=2.6.13 -XX:ErrorFile=/home/yooblie/.local/share/bolt-launcher/.runelite/logs/jvm_crash_pid_%p.log -Duser.home=/home/yooblie/.local/share/bolt-launcher -Djavax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider -Djavax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider -Djavax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider net.runelite.client.RuneLite
Bolt version 0.8.2 is out on AUR and has a "Configure RuneLite" launch option which launches with --configure. I'd appreciate one of you confirming that it works correctly.
Regarding your helper script, command 2 is definitely the parent process spawning the child process. So your helper script is intercepting that somehow.
@Adamcake That doesn't seem to have done the trick for me :frowning_face:
I used the new "Configure RuneLite" button to set the JVM args however, I am still having the same sound issue(s). No sound output from RuneLite if I have other sound playing when it starts up. If I have no other sound playing when starting RuneLite, then RL sound works, but no other sounds will as long as RL is running.
Looks like Bolt is picking up my _JAVA_OPTIONS env var, but I'm not sure about the config from the new button? This line seems to indicate that it's getting picked up tho: 2024-02-05 21:49:02 CST [main] INFO net.runelite.client.RuneLite - Java VM arguments: -XX:+DisableAttachMechanism -Xmx768m -Xss2m -XX:CompileThreshold=1500 -Dsun.java2d.opengl=false -Drunelite.launcher.version=2.6.13 -XX:ErrorFile=/home/dj/.local/share/bolt-launcher/.runelite/logs/jvm_crash_pid_%p.log -Duser.home=/home/dj/.local/share/bolt-launcher -Djavax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider -Djavax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider
.
The repeated Failed to create secure directory (/run/user/1000/bolt-runelite-CzeL0g/pulse): Too many levels of symbolic links
seem related to the audio issue, but I'm not sure what's expected there. It does seem strange to me that the bolt-runelite-CzeL0g/
dir contains a circular symlink to itself, but the pulse/
dir doesn't, and (again) I don't know what's expected.
That's the same issue as #12. I should really add this to the readme.
My Arch Linux laptop still has this issue, in a few hours I can remove the helper script so that it is back to being a standard java install, and then I will test it for you.
@Adamcake thank you for taking the time to make that update. I appreciate it :)
Please confirm this issue still happens after setting PULSE_RUNTIME_PATH as described in #12?
@Adamcake Seems like adding PULSE_RUNTIME_PATH
did the trick for me. I also tested removing my _JAVA_OPTIONS
env as well as the RuneLite JVM configuration args and it seems like I only need the PULSE_RUNTIME_PATH
.
One specific note for my setup: I originally added these env vars to ~/.bashrc
, but when launching bolt
via dmenu the sound issue persisted. This is because dmenu isn't a login shell so I added them to /etc/environment
per the Arch wiki.
Thanks a lot for all your assistance @Adamcake!
All of this family of issues should be fixed absolutely for good in 0.9.
I am using Bolt on Arch Linux to play OSRS with RuneLite.
I have been troubleshooting an audio-related issue. This issue seems to be affecting some RuneLite Linux users. I found a solution to this issue mentioned here
I'm not very familiar with the inner workers on java relating to the --configure option that is mentioned in that solution. Although, I was able to confirm, that JVM options that are added via the java --configure option do not apply to instances of runelite that are started through the Bolt Launcher.
I suspect this is due to the fact the Bolt Launcher sets its own JAVA HOME, but unsure.
As I was able to confirm that adding those JVM options to the execution of the RuneLite.jar from outside of Bolt Launcher resolved the "no sound" issue for myself. As the JVM options applied via --configure did not apply to instances of RuneLite.jar that was launched through the Bolt Launcher, the temporary solution that I was able to implement is as follows.
java -jar RuneLite.jar --configure
and add the following options to the JVM section:archlinux-java get
and make note of the java version from the output.cd /usr/lib/jvm/<JAVA_VERSION>/bin
mv ./java ./java-real
vim ./java
and populate it with the following:echo "$*" | grep -i "\ runelite.jar"
arguments=$(echo "$*" | sed "s/net.runelite.client.RuneLite//g")
if [ "$?" -eq 0 ]; then java-real $arguments -Djavax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider -Djavax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider -Djavax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider net.runelite.client.RuneLite else java-real $* fi