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

Ehsan

  • Guest
Re: BASS for Windows Store/Phone
« Reply #200 on: 21 Jun '18 - 00:01 »
I just used BASS_StreamCreateFile with BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_8BITS and then BASS_ChannelGetData to get a dump of the mp3 file with problematic playback.
You can get the dump file from https://1drv.ms/u/s!AiqmLTS7IYp8i-UHVMv4bj3iA83JUg on my OneDrive.

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #201 on: 21 Jun '18 - 15:28 »
I was able to reproduce the MP3 decoding problem with the Windows 8 and Windows Phone 8 builds. I will look for a solution and then hopefully come back with an update for you to try.

Ehsan

  • Guest
Re: BASS for Windows Store/Phone
« Reply #202 on: 21 Jun '18 - 17:52 »
Thanks. I'll be waiting.

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #203 on: 25 Jun '18 - 13:37 »
I think I've found the piece of code that the Windows 8 compiler (VS2013) was having trouble with, so here's an update with a little modification for you to try:

   www.un4seen.com/stuff/bass-winstore-test.zip

Ehsan

  • Guest
Re: BASS for Windows Store/Phone
« Reply #204 on: 25 Jun '18 - 20:07 »
Issue resolved. Perfect.
Many thanks.

Ehsan

  • Guest
Re: BASS for Windows Store/Phone
« Reply #205 on: 26 Jun '18 - 09:04 »
Also, could you point me in the right direction if I want to create visualizations in a Windows Phone app?

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #206 on: 26 Jun '18 - 13:52 »
Issue resolved. Perfect.

Great! The updated Windows 8 BASS.DLLs are now up in the package in the 1st post.

Also, could you point me in the right direction if I want to create visualizations in a Windows Phone app?

You would use the BASS_ChannelGetData and/or BASS_ChannelGetLevel/Ex functions for that. Please see the documentation for details on those functions. I'm not familiar with the Windows Store APIs, so I'm afraid I can't really advise on the specifics of that, but you could have a look at the SPECTRUM example that comes in the Win32 BASS package for some ideas.

Ehsan

  • Guest
Re: BASS for Windows Store/Phone
« Reply #207 on: 27 Jun '18 - 21:45 »
Thanks Ian.

Ehsan

  • Guest
Re: BASS for Windows Store/Phone
« Reply #208 on: 29 Jun '18 - 02:32 »
Hey Ian

So the last issue involves deploying my app to Windows Phone store with the BASS library.
It looks like Bass.Net.WinStore.dll references a bunch of different dlls, like bassmidi.dll, bassmix.dll, etc. so these files need to be included in the app package so that the Store deployment test doesn't fail.

I included these files, but the Store test tells me there is one file missing and won't allow me to upload my app. It's bass_fx.dll. I couldn't find this file in the library. I hope it is compiled for Windows Phone and exists, but just wasn't included in the zip file.

I must add that I am only using the functions in bass.dll and not any other dlls, so a .NET wrapper for bass.dll, a compact version if you will, would be more suitable as it won't force me to include unnecessary dlls with my app package.

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #209 on: 29 Jun '18 - 17:38 »
Yeah, unfortunately, Microsoft's app verification process currently doesn't seem to accept that some DLLs referenced by BASS.Net might not be needed/used by the app, so you have to include the BASSMIDI/BASSmix/BASS_FX DLLs with your .Net app. The other supported add-ons aren't referenced by BASS.Net (they can be used via BASS_PluginLoad instead), so don't need to be included. The BASS_FX files can be found in the first post of this thread.

Ehsan

  • Guest
Re: BASS for Windows Store/Phone
« Reply #210 on: 6 Jul '18 - 23:24 »
Hey Ian.

Thanks to your efforts in resolving the library's issues for Windows Phone I was able to add a 7 band audio equalizer to my free app, RHYTHM, accessible from rhythmapp.audio.

I thought you might want to add it to BASS showcase.
Thanks again.

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #211 on: 9 Jul '18 - 17:49 »
Great to hear that you got things working well with your app. To add it to the "BASS showcase" list, please use the form at the bottom of that page.

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #212 on: 13 Aug '18 - 16:32 »
A Windows Store version of the BASSFLAC add-on has now been added to the 1st post.

aybe

  • Posts: 162
Re: BASS for Windows Store/Phone
« Reply #213 on: 14 Aug '18 - 02:26 »
@Ian

In regards of having to use Task.Run(()=>{...}) in UWP, it apparently applies to any of the BASS functions, e.g. playing, pausing, changing channel attributes etc, else you are granted with:

Code: [Select]
System.Runtime.InteropServices.SEHException: 'External component has thrown an exception.'
Is that correct that one shall always use Task.Run in UWP ?

Thank you.

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #214 on: 14 Aug '18 - 15:53 »
That's strange. As far as I recall, it was only necessary for the file/URL opening functions (eg. BASS_StreamCreateFile/URL) to be called asynchronously last time I checked. Are you having to do everything asynchronously, even a BASS_GetVersion call?

aybe

  • Posts: 162
Re: BASS for Windows Store/Phone
« Reply #215 on: 14 Aug '18 - 17:57 »
For BASS_StreamCreateFile of course it will invariably crash,

BASS_GetVersion works,

BASS_ChannelPlay throws,

Does nothing:
BASS_ChannelPause
BASS_ChannelSetAttribute(HandleReverse, BASSAttribute.BASS_ATTRIB_REVERSE_DIR

Works but crashes soon after:
BASS_ChannelSetAttribute(Handle, BASSAttribute.BASS_ATTRIB_TEMPO_FREQ

And when it doesn't work, either it'll do nothing or soon after throw:
- you get System.Runtime.InteropServices.SEHException: 'External component has thrown an exception.'
- then in the Output window : has exited with code -1073741819 (0xc0000005) 'Access violation'
- I enabled native debugging and access violation happens in bass.dll

Surprisingly sometimes it works a bit before throwing an access violation.

So I simply decided to wrap everything in a Task, it's a bit tedious but it's simpler in the end compared to trying/adjusting which call needs it VS which doesn't -> anything in the view dealing with BASS must do it asynchronously.

aybe

  • Posts: 162
Re: BASS for Windows Store/Phone
« Reply #216 on: 14 Aug '18 - 18:25 »
Sorry, forgot to mention:

Sometimes, even when wrapping with Task.Run, the app will crash for no apparent reason with 'access violation'.

I am starting to consider if this could be related to an AV-related issue where the software doesn't like something and forbids it, causing the application to crash. However, I don't see anything in its logs (Bitdefender Endpoint Security).

aybe

  • Posts: 162
Re: BASS for Windows Store/Phone
« Reply #217 on: 14 Aug '18 - 19:15 »
I have sent the following crash dump to you in the FTP: crashdump_uwp_.zip

Error : 0xC0000005: Access violation writing location 0x0000000000000000.

What happens:
- I play the stream such as the one I created in https://www.un4seen.com/forum/?topic=18177.0
- I go to 3 seconds before the end of it
- I let it play until it reaches end
- the application crashes

Note that every calls to BASS are wrapped in Task.Run.

Thanks  :)


Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #218 on: 15 Aug '18 - 12:54 »
For BASS_StreamCreateFile of course it will invariably crash,

BASS_GetVersion works,

BASS_ChannelPlay throws,

Does nothing:
BASS_ChannelPause
BASS_ChannelSetAttribute(HandleReverse, BASSAttribute.BASS_ATTRIB_REVERSE_DIR

Works but crashes soon after:
BASS_ChannelSetAttribute(Handle, BASSAttribute.BASS_ATTRIB_TEMPO_FREQ

And when it doesn't work, either it'll do nothing or soon after throw:
- you get System.Runtime.InteropServices.SEHException: 'External component has thrown an exception.'
- then in the Output window : has exited with code -1073741819 (0xc0000005) 'Access violation'
- I enabled native debugging and access violation happens in bass.dll

Surprisingly sometimes it works a bit before throwing an access violation.

So I simply decided to wrap everything in a Task, it's a bit tedious but it's simpler in the end compared to trying/adjusting which call needs it VS which doesn't -> anything in the view dealing with BASS must do it asynchronously.

OK, that looks like actual crashing rather than the UI thread restrictions.

From the dump file that you uploaded, it looks like it crashed when calling a SYNCPROC callback function because there's no code at the SYNCPROC function's address. Perhaps it was garbage collected? Have you you setup a delegate for any SYNCPROC functions that you're using, as described in the "Callbacks and Delegates" section of the "Interoperating with Unmanaged Code" page in the BASS.Net documentation? If not, please check that out.

aybe

  • Posts: 162
Re: BASS for Windows Store/Phone
« Reply #219 on: 18 Aug '18 - 03:26 »
You are right  ;D

One of the subtle differences of BASS under UWP is that Managed Debugging Assistants are not part of the game to let you know something looks wrong !

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #220 on: 23 Oct '18 - 17:24 »
An updated WinStore BASS version is up now in the 1st post, adding support for the BASS_CONFIG_DEV_DEFAULT option. It also improves handling of when a device's sample format is changed (via the Sound control panel) while the device is in use.

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #221 on: 13 Nov '18 - 13:24 »
The WinStore version of the BASSMIDI 2.4.12 release is now up in the 1st post.

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #222 on: 22 Nov '18 - 17:35 »
Support for the ARM64 architecture has been added to the packages in the 1st post (not BASS_FX yet). The BASSDSD/WV/mix add-ons have also been updated to the latest versions for all architectures.

The NETRADIO example has also been updated to the latest version of that. It also been changed to a Windows 10 (UWP) project, as Microsoft is phasing-out the Windows 8 and Windows Phone stores.

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #223 on: 7 Dec '18 - 17:15 »
ARM64 support is now included in the BASS_FX add-on package in the 1st post.

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #224 on: 17 Jan '19 - 16:39 »
The WinStore version of the BASS 2.4.14 release is up now in the 1st post.