jagrosh / MusicBot

🎶 A Discord music bot that's easy to set up and run yourself!
https://jmusicbot.com
Apache License 2.0
5.36k stars 2.57k forks source link

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

Open IngwiePhoenix opened 6 months ago

IngwiePhoenix commented 6 months ago

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 commented 6 months ago

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:

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 commented 6 months ago

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! :)