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

[Bug Report, but not really] RISC-V breakage; where do I go with this? #1557

Open
3 tasks done
IngwiePhoenix opened this issue Apr 26, 2024 · 2 comments
Open
3 tasks done

Comments

@IngwiePhoenix
Copy link

Bug Description

This is not really a bug - more of an imcompatibility.

Apr 26 20:07:14 riscboi java[118802]: [20:07:14] [INFO] [JDA]: Finished Loading!
Apr 26 20:07:22 riscboi java[118802]: [20:07:22] [INFO] [NativeLibraryLoader]: Native library libmpg123-0: loading with filter com.sedmelluq.discord.lavaplayer.natives.ConnectorNativeLibLoader$$Lambda/0x0000000011370218@292d25a3
Apr 26 20:07:22 riscboi java[118802]: [20:07:22] [INFO] [NativeLibraryLoader]: Native library libmpg123-0: could not detect sytem type, but system filter is com.sedmelluq.discord.lavaplayer.natives.ConnectorNativeLibLoader$$Lambda/0x0000000011370218@292d25a3 - assuming it does not match and skipping library.
Apr 26 20:07:22 riscboi java[118802]: [20:07:22] [INFO] [NativeLibraryLoader]: Native library connector: loading with filter null
Apr 26 20:07:22 riscboi java[118802]: [20:07:22] [ERROR] [NativeLibraryLoader]: Native library connector: loading failed.
Apr 26 20:07:22 riscboi java[118802]: java.lang.IllegalArgumentException: Unknown architecture: riscv64
Apr 26 20:07:22 riscboi java[118802]:         at com.sedmelluq.lava.common.natives.architecture.DefaultArchitectureTypes.detect(DefaultArchitectureTypes.java:45)
Apr 26 20:07:22 riscboi java[118802]:         at com.sedmelluq.lava.common.natives.architecture.SystemType.detect(SystemType.java:49)
Apr 26 20:07:22 riscboi java[118802]:         at com.sedmelluq.lava.common.natives.NativeLibraryLoader.detectMatchingSystemType(NativeLibraryLoader.java:177)
Apr 26 20:07:22 riscboi java[118802]:         at com.sedmelluq.lava.common.natives.NativeLibraryLoader.loadInternal(NativeLibraryLoader.java:97)
Apr 26 20:07:22 riscboi java[118802]:         at com.sedmelluq.lava.common.natives.NativeLibraryLoader.loadWithFailureCheck(NativeLibraryLoader.java:81)
Apr 26 20:07:22 riscboi java[118802]:         at com.sedmelluq.lava.common.natives.NativeLibraryLoader.load(NativeLibraryLoader.java:66)
Apr 26 20:07:22 riscboi java[118802]:         at com.sedmelluq.discord.lavaplayer.natives.ConnectorNativeLibLoader.loadConnectorLibrary(ConnectorNativeLibLoader.java:21)
Apr 26 20:07:22 riscboi java[118802]:         at com.sedmelluq.discord.lavaplayer.natives.aac.AacDecoderLibrary.getInstance(AacDecoderLibrary.java:14)
Apr 26 20:07:22 riscboi java[118802]:         at com.sedmelluq.discord.lavaplayer.natives.aac.AacDecoder.<init>(AacDecoder.java:33)
Apr 26 20:07:22 riscboi java[118802]:         at com.sedmelluq.discord.lavaplayer.container.mpeg.MpegAacTrackConsumer.consume(MpegAacTrackConsumer.java:62)
Apr 26 20:07:22 riscboi java[118802]:         at com.sedmelluq.discord.lavaplayer.container.mpeg.reader.fragmented.MpegFragmentedFileTrackProvider.provideFrames(MpegFragmentedFileTrackProvider.java:69)
Apr 26 20:07:22 riscboi java[118802]:         at dev.lavalink.youtube.track.YoutubeMpegStreamAudioTrack.processSegmentStream(YoutubeMpegStreamAudioTrack.java:205)
Apr 26 20:07:22 riscboi java[118802]:         at dev.lavalink.youtube.track.YoutubeMpegStreamAudioTrack.processNextSegment(YoutubeMpegStreamAudioTrack.java:175)
Apr 26 20:07:22 riscboi java[118802]:         at dev.lavalink.youtube.track.YoutubeMpegStreamAudioTrack.processNextSegmentWithRetry(YoutubeMpegStreamAudioTrack.java:136)
Apr 26 20:07:22 riscboi java[118802]:         at dev.lavalink.youtube.track.YoutubeMpegStreamAudioTrack.execute(YoutubeMpegStreamAudioTrack.java:108)
Apr 26 20:07:22 riscboi java[118802]:         at dev.lavalink.youtube.track.YoutubeMpegStreamAudioTrack.lambda$process$0(YoutubeMpegStreamAudioTrack.java:64)
Apr 26 20:07:22 riscboi java[118802]:         at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.executeProcessingLoop(LocalAudioTrackExecutor.java:284)
Apr 26 20:07:22 riscboi java[118802]:         at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.executeProcessingLoop(LocalAudioTrackExecutor.java:257)
Apr 26 20:07:22 riscboi java[118802]:         at dev.lavalink.youtube.track.YoutubeMpegStreamAudioTrack.process(YoutubeMpegStreamAudioTrack.java:64)
Apr 26 20:07:22 riscboi java[118802]:         at com.sedmelluq.discord.lavaplayer.track.DelegatedAudioTrack.processDelegate(DelegatedAudioTrack.java:25)
Apr 26 20:07:22 riscboi java[118802]:         at dev.lavalink.youtube.track.YoutubeAudioTrack.processStream(YoutubeAudioTrack.java:165)
Apr 26 20:07:22 riscboi java[118802]:         at dev.lavalink.youtube.track.YoutubeAudioTrack.processWithClient(YoutubeAudioTrack.java:106)
Apr 26 20:07:22 riscboi java[118802]:         at dev.lavalink.youtube.track.YoutubeAudioTrack.process(YoutubeAudioTrack.java:63)
Apr 26 20:07:22 riscboi java[118802]:         at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:101)
Apr 26 20:07:22 riscboi java[118802]:         at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.lambda$executeTrack$2(DefaultAudioPlayerManager.java:330)
Apr 26 20:07:22 riscboi java[118802]:         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
Apr 26 20:07:22 riscboi java[118802]:         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
Apr 26 20:07:22 riscboi java[118802]:         at java.base/java.lang.Thread.run(Thread.java:1575)
Apr 26 20:07:44 riscboi java[118802]: [20:07:44] [WARN] [NativeResourceHolder]: Should have been closed before finalization (com.sedmelluq.discord.lavaplayer.natives.aac.AacDecoder).
^C⏎
root@riscboi ~ [SIGINT]# dpkg -l | grep libmpg123
ii  libmpg123-0:riscv64                              1.32.5-1+b1                               riscv64      MPEG layer 1/2/3 audio decoder (shared library)
ii  libmpg123-dev:riscv64                            1.32.5-1+b1                               riscv64      MPEG layer 1/2/3 audio decoder (development files)

Do you know where I should put this? LavaPlayer? This is using the fork with the updates to temporarily work around the playback issues.

Steps to Reproduce

Uh... Buy a RISC-V board, install Debian, install Java, make a SystemD unit, run the bot, observe?

# dpkg -l | grep jdk
ii  openjdk-23-jre:riscv64                           23~15ea-1                                 riscv64      OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-23-jre-headless:riscv64                  23~15ea-1                                 riscv64      OpenJDK Java runtime, using Hotspot JIT (headless)

Jokes aside; bog-standard Linux install - but, doesn't really matter here.

Expected Result

Sound o.o

Debug Output

...should I? x)

Additional Info

VisionFive2, self-built 6.6.0 kernel, Debian Trixie.
It's all over the place.

I know what I am doing; but my Java-fu is not so good - since, however, there is a likelyhood of Java devs peeking in here, might as well post this and see if I get a lovely pointer or not :)

Thanks and kind regards!

PS.: Migrating it back to ARM; got enough nodes. I hope the update with the Docker container comes soon, itching to put this into my Kubernetes cluster!

Checklist

@MichailiK
Copy link
Collaborator

MichailiK commented May 11, 2024

As a workaround, do not use JMusicBot in a way which requires native libraries to function. JMusicBot makes use of native libraries under 2 circumstances:

  • Setting a volume to anything other than 100 requires JMusicBot to re-encode the audio. It makes use of natives to do that.
  • If JMusicBot encounters any non-Opus audio (such as MP3 or WAV) it will try to load native libraries to re-encode the audio to Opus. Discord only makes use of Opus for voice channels. (YouTube serves audio with Opus, so YouTube playback shouldn't be problematic. You'll likely just encounter that when trying to play local mp3/wav files.)

Unfortunately, no natives have been built for RISC-V, presumably as its still pretty niche. lavaplayer handles audio for us, so we'd have to ask them about this. I believe the developers are already aware of this incompatibility though.

@IngwiePhoenix
Copy link
Author

Ahh interesting!

Thanks for the infos - thats the kinda pointer I needed. I wonder if I could "build" my way through this problem. Doesn't sound too difficult; just getting the natives built.

I'll come back to this when I tried some things out! :)

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

No branches or pull requests

2 participants