BASS for Universal Windows Platform (UWP)

Started by Ian @ un4seen, 30 Jul '15 - 16:42

MARCOVLESMES

Hi I'm try to use BASSEnc in a UWP app but when I try to get the library version I'm getting an Access Violation error my code is:
public async Task<int> GetBassEncVersion()
{
     int version = -1;
     Task.Run(() =>
     {
          version = BassEnc.BASS_Encode_GetVersion();
     }).Wait();

     return version;
}
The error is:
The program '[22396] MyApp.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.
Can you guide me to the right direction? Thanks!

Ian @ un4seen

Unfortunately, a UWP version of the BASSenc add-on isn't currently available (I guess you're trying to use the Win32 BASSENC.DLL?). The BASSenc add-on has a lot of platform-specific stuff, and UWP is unlike any of the existing supported platforms, so a port isn't straightforward.

Are you sure your app needs to be UWP? Perhaps it could be a regular "desktop" Windows app instead?

Andy09

Hi,

i have the following error: System.PlatformNotSupportedException: Marshalling arbitrary types is not supported.

First of all, i have called this:
_ReverbHandle = Bass.BASS_ChannelSetFX(_BassExInstance.Handle, BASSFXType.BASS_FX_DX8_REVERB, 1);

This works, and the effect is starting (i can hear this).
But if i call in the next line this:
Bass.BASS_FXSetParameters(_ReverbHandle, r);

then comes the error.

My enviroment: Visual Studio 2019, UWP App with .NET Standard Library and BASS.NET for Standard.

Andy

radio42

This is unfortunately not supported at runtime...due to the fact, in .Net Standard not all operations are supported, as 'Marshalling arbitrary types is not supported'.
So in order to remove that function (as it is supported in .Net Framework), I left it like it is.

Andy09

Quote from: radio42 on 28 Feb '21 - 14:05This is unfortunately not supported at runtime...due to the fact, in .Net Standard not all operations are supported, as 'Marshalling arbitrary types is not supported'.
So in order to remove that function (as it is supported in .Net Framework), I left it like it is.

Hi,
please do not get this wrong, but i guess this is not a problem with the runtime. I think is a problem with Bass.Net.Dll for .Net Standard. I have tested with Bass.Net.WinStore.dll and i have no issues with BASS_FXSetParameters and can set reverb parameters in my same library project (for .Net Standard 2.0).
And if i go back to Bass.Net.Dll (for Standard) i receive the error. And i wondering me, why works with Bass.Net.WinStore.dll and not with Bass.Net (Standard) in the same project? :-)

Andy

Ian @ un4seen

The UWP version of the BASS 2.4.16 release is up now in the 1st post.

Ian @ un4seen

The UWP version of the BASSHLS 2.4.3 release is up in the 1st post.

msitton

Any chance of getting BASSOPUS ported to UWP? I searched the thread and haven't seen any updates on it since the first post back in 2015.

Thanks!

Ian @ un4seen

Yep, a BASSOPUS port has now been added to the package in the 1st post, so please redownload to get that. Let me know if you have any trouble with it.

PandaSharp

Is it normal that when I call GetDeviceInfo method, the name property value is not really useful but is just "N", "D", "1", "H" instead of the soundcard name ... Is it a UWP limitation? here there is my code, I use managedbass c# wrapper

for (int i = 0; i < ManagedBass.Bass.DeviceCount; i++)
            {
                var device = ManagedBass.Bass.GetDeviceInfo(i);
                _deviceList.Add(device);
            }

thanks

Ian @ un4seen

The device names should be the same in UWP and Win32 on the same system, but a difference is that they're in UTF-16 form in the UWP BASS version, rather than ANSI or UTF-8 (depending on BASS_CONFIG_UNICODE) in the Win32 version. Perhaps ManagedBass isn't currently expecting that?

PandaSharp

Thanks the issue is here indeed https://github.com/ManagedBass/ManagedBass/blob/43f9d4b363f51e27819b033c66eae7084257581e/src/Bass/Shared/Bass/Structures/DeviceInfo.cs

I overwritten the class and replaced

                case -1:
                    return Marshal.PtrToStringAnsi(ptr);

with


                case -1:
                    return Marshal.PtrToStringAuto(ptr);

for the moment

Ian @ un4seen

The UWP version of the BASSmix 2.4.11 release is up in the 1st post.

Ian @ un4seen

The UWP version of the new BASSAPE add-on (replacing BASS_APE) is up in the 1st post.

Ian @ un4seen

The UWP version of the BASSMIDI 2.4.14 release is up in the 1st post.

Ian @ un4seen

The UWP version of the BASSmix 2.4.12 release is up in the 1st post.

Ian @ un4seen

The UWP version of the BASS 2.4.17 release is up in the 1st post.

Ian @ un4seen

The UWP version of the BASSFLAC 2.4.5 release is up in the 1st post.

Ian @ un4seen

The UWP version of the BASSWV 2.4.7.2 release is up in the 1st post.

Ian @ un4seen

The UWP version of the BASSDSD 2.4.1.3 and BASSWV 2.4.7.3 releases are up in the 1st post.

Ian @ un4seen

The UWP version of the BASSOPUS 2.4.2.3 release is up in the 1st post.

Ian @ un4seen

The UWP version of the BASSFLAC 2.4.5.4 release is up in the 1st post.

Ian @ un4seen

The UWP version of the BASSWV 2.4.7.4 release is up in the 1st post.

Ian @ un4seen

The UWP version of the BASSAPE 2.4.0.1 release is up in the 1st post.

Ian @ un4seen

The UWP version of the BASSOPUS 2.4.3 release is up in the 1st post.