Author Topic: BASS for Universal Windows Platform (UWP)  (Read 121985 times)

MARCOVLESMES

  • Guest
Re: BASS for Universal Windows Platform (UWP)
« Reply #250 on: 4 Jan '21 - 16:10 »
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:
Code: [Select]
public async Task<int> GetBassEncVersion()
{
     int version = -1;
     Task.Run(() =>
     {
          version = BassEnc.BASS_Encode_GetVersion();
     }).Wait();

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

Ian @ un4seen

  • Administrator
  • Posts: 23924
Re: BASS for Universal Windows Platform (UWP)
« Reply #251 on: 4 Jan '21 - 17:44 »
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

  • Posts: 32
Re: BASS for Universal Windows Platform (UWP)
« Reply #252 on: 27 Feb '21 - 15:40 »
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

  • Posts: 4725
Re: BASS for Universal Windows Platform (UWP)
« Reply #253 on: 28 Feb '21 - 14:05 »
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

  • Posts: 32
Re: BASS for Universal Windows Platform (UWP)
« Reply #254 on: 28 Feb '21 - 14:33 »
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.

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

  • Administrator
  • Posts: 23924
Re: BASS for Universal Windows Platform (UWP)
« Reply #255 on: 25 Jun '21 - 14:57 »
The UWP version of the BASS 2.4.16 release is up now in the 1st post.

Ian @ un4seen

  • Administrator
  • Posts: 23924
Re: BASS for Universal Windows Platform (UWP)
« Reply #256 on: 30 Jul '21 - 17:40 »
The UWP version of the BASSHLS 2.4.3 release is up in the 1st post.

msitton

  • Posts: 1
Re: BASS for Universal Windows Platform (UWP)
« Reply #257 on: 24 Aug '21 - 22:30 »
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

  • Administrator
  • Posts: 23924
Re: BASS for Universal Windows Platform (UWP)
« Reply #258 on: 25 Aug '21 - 15:18 »
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

  • Guest
Re: BASS for Universal Windows Platform (UWP)
« Reply #259 on: 6 Sep '21 - 16:30 »
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

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

thanks

Ian @ un4seen

  • Administrator
  • Posts: 23924
Re: BASS for Universal Windows Platform (UWP)
« Reply #260 on: 6 Sep '21 - 17:10 »
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

  • Guest
Re: BASS for Universal Windows Platform (UWP)
« Reply #261 on: 7 Sep '21 - 11:55 »
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

Code: [Select]
                case -1:
                    return Marshal.PtrToStringAnsi(ptr);

with


Code: [Select]
                case -1:
                    return Marshal.PtrToStringAuto(ptr);

for the moment

Ian @ un4seen

  • Administrator
  • Posts: 23924
Re: BASS for Universal Windows Platform (UWP)
« Reply #262 on: 23 Sep '21 - 15:14 »
The UWP version of the BASSmix 2.4.11 release is up in the 1st post.