flutter_soloud icon indicating copy to clipboard operation
flutter_soloud copied to clipboard

fix: Failed to load dynamic library 'libflutter_soloud_plugin.so': libvorbis.so.0.4.9: cannot open shared object file

Open filiph opened this issue 3 months ago • 3 comments

Description

Here's a Sentry error that I haven't seen yet.

ArgumentError: Invalid argument(s): Failed to load dynamic library 'libflutter_soloud_plugin.so': libvorbis.so.0.4.9: cannot open shared object file: No such file or directory
  File "soloud_controller_ffi.dart", line 15, in new SoLoudController._
  File "soloud_controller_ffi.dart", line 10, in new SoLoudController
  File "soloud.dart", line 77, in new SoLoud._
  File "soloud.dart", line 169, in SoLoud.instance
  ...

Steps To Reproduce

Unfortunately, this is coming from the wild, so I can't reproduce. I'll add as much context as possible, though.

  • I'm NOT building with OGG_LIB = false (can't remember the correct invocation now but you probably know what I mean) but I thought I don't need to if I'm not actually using any ogg vorbis files?
  • I building using Steam's sniper container, which is supposed to guard against such SO incompatibilities. See giant_robot project's readme ("Linux Steam container")

Expected Behavior

SoLoud initialization proceeds normally.

Additional Context

  • dart: Dart 3.9.2 (stable)
  • dart.name: Dart
  • dist: 83
  • environment: production
  • flutter.name: Flutter
  • flutter0: Flutter 3.35.3 (stable)
  • flutter0.name: Flutter
  • handled: yes
  • level: fatal
  • mechanism: PlatformDispatcher.onError
  • os: Linux
  • os.name: Linux
  • release: [email protected]+83+Fusion Reactor

Exception 1

Type: ArgumentError Value: Invalid argument(s): Failed to load dynamic library 'libflutter_soloud_plugin.so': libvorbis.so.0.4.9: cannot open shared object file: No such file or directory

Stacktrace

 _open in ffi_dynamic_library_patch.dart [Line 11] (Not in app)
 new DynamicLibrary.open in ffi_dynamic_library_patch.dart [Line 22] (Not in app)
 new SoLoudController._ in soloud_controller_ffi.dart [Line 15] (In app)
 new SoLoudController in soloud_controller_ffi.dart [Line 10] (In app)
 new SoLoud._ in soloud.dart [Line 77] (In app)
 SoLoud.instance in soloud.dart [Line 169] (In app)
 SoLoudAudioController.internalInitialize in soloud_audio_controller.dart [Line null] (In app)
 AudioController.initialize in audio_controller.dart [Line 224] (In app)
 Unknown function in <asynchronous suspension> [Line null] (Not in app)
 _guardedMain.<fn> in main.dart [Line 230] (In app)

Operating system

Build #1 SMP PREEMPT_DYNAMIC Mon, 22 Sep 2025 22:08:35 +0000

Kernel Version 6.16.8-arch3-1

Name Linux

Raw Description Linux 6.16.8-arch3-1 #1 SMP PREEMPT_DYNAMIC Mon, 22 Sep 2025 22:08:35 +0000

Memory Size 31.3 MiB

Processor Count 12

filiph avatar Sep 29 '25 13:09 filiph

Hi Filip,

this sounds like the app is run on a non x86_64 (probably an arm64) machine running Linux. Maybe a Rasberry Pi which has arm64 architecture? Also due to the small amount of OS memory.

For Linux, only the x86_64 arch is currently supported by the OGG libs.

I'm NOT building with OGG_LIB = false (can't remember the correct invocation now but you probably know what I mean) but I thought I don't need to if I'm not actually using any ogg vorbis files?

since you are not using OGG libs, it is convenient not to link the libs. By the default they are linked, but you can easily disable them: Without Opus/Vorbis

alnitak avatar Sep 29 '25 14:09 alnitak

I assumed the memory size is a mistake of some kind, because it's Arch Linux and the processor (core) count is 12. I also think (think!) that it's not possible to run Steam on a device of that kind, let alone a game through Steam.

Also, I just noticed this in the Sentry report:

**App**

In Foreground      true
Memory Usage       428.0 MiB

If this was a tiny unsupported device, I think we could safely disregard this. But I think it's, in fact, a desktop Linux computer.

If that's the case, would building without Opus/Vorbis prevent this from happening?

filiph avatar Sep 29 '25 15:09 filiph

If that's the case, would building without Opus/Vorbis prevent this from happening?

yes, the error clearly states that it cannot find the libraries, so by disabling the linking of them, you surely resolve.

alnitak avatar Sep 29 '25 16:09 alnitak