Silk.NET icon indicating copy to clipboard operation
Silk.NET copied to clipboard

Add OpenAL Soft library for Android

Open roeyskoe opened this issue 3 years ago • 11 comments

Summary of feature

Currently OpenAL Soft library is not compiled for Android, and trying to use it throws an FileNotFoundException.

Does this have a proposal?

No

roeyskoe avatar Sep 17 '21 11:09 roeyskoe

Will only be adding this for .NET 6 as backporting to Xamarin would be a lot of maintenance burden.

Perksey avatar Sep 17 '21 13:09 Perksey

Low priority, won't make it into 2.9.

Perksey avatar Sep 22 '21 20:09 Perksey

Any news on that? Currently Silk.net 2.13.0 throws a NullReferenceException when calling AL.GetApi(true) or AL.GetApi(false):

   at Silk.NET.Core.Loader.DefaultPathResolver.GetAllRuntimeIds(String currentRid, DependencyContext ctx)
   at Silk.NET.Core.Loader.DefaultPathResolver.TryLocateNativeAssetInRuntimesFolder(String name, String baseFolder, String& result)
   at Silk.NET.Core.Loader.DefaultPathResolver.CoreEnumeratePossibleLibraryLoadTargets(String name, Boolean noLinuxTraverse)+MoveNext()
   at Silk.NET.Core.Loader.LibraryLoader.LoadWithResolver(String name, PathResolver pathResolver)
   at Silk.NET.Core.Loader.LibraryLoader.TryLoadNativeLibrary(String[] names, PathResolver pathResolver, IntPtr& result)
   at Silk.NET.Core.Loader.LibraryLoader.TryLoadNativeLibrary(String name, PathResolver pathResolver, IntPtr& result)
   at Silk.NET.Core.Loader.LibraryLoader.LoadNativeLibrary(String name, PathResolver pathResolver)
   at Silk.NET.Core.Loader.UnmanagedLibrary..ctor(String name, LibraryLoader loader, PathResolver pathResolver)
   at Silk.NET.Core.Loader.UnmanagedLibrary..ctor(String name)
   at Silk.NET.Core.Contexts.DefaultNativeContext..ctor(String name)
   at Silk.NET.OpenAL.AL.CreateDefaultContext(String n)
   at Silk.NET.OpenAL.AL.GetApi(Boolean soft)
   at Ambermoon.Audio.OpenAL.AudioOutput..ctor(Int32 channels, Int32 sampleRate)

Pyrdacor avatar Feb 14 '22 14:02 Pyrdacor

Ok with a valid RID in the csproj, the exception is gone. It just won't find the .so file now. :)

Pyrdacor avatar Feb 14 '22 14:02 Pyrdacor

Current progress:

  • @roeyskoe did some work to standardize the build process for native libraries
  • To my knowledge, Android does not respect the runtimes folder.
  • As such, we'll need someone (community) to create a gradle project for producing an aar for this.

We have the SilkDroid gradle project to go off, but beyond that this is a large task full of a lot of figuring out.

The Silk.NET team at this time don't have any real priority on this issue due to low demand and time constraints thus it is a community issue (help wanted!)

Perksey avatar Feb 14 '22 16:02 Perksey

Ok thanks for the heads-up. Maybe this will help: https://github.com/sgothel/openal-soft/blob/master/Android.md

Can't tell if I will have the time for it either.

Pyrdacor avatar Feb 14 '22 19:02 Pyrdacor

I already have gotten OpenAL to build for Android, but have not yet have time to research how the required(?) aar could be done.

I could actually open a pr for the OpenAL native builds, even without Android support.

roeyskoe avatar Feb 14 '22 19:02 roeyskoe

Nevermind I just used the AudioTrack class for Android which works quite well. :)

Pyrdacor avatar Feb 15 '22 15:02 Pyrdacor