Author Topic: BASS.NET API 2.4.12.7  (Read 783256 times)

ken

  • Posts: 739
Re: BASS.NET API 2.4.10.2
« Reply #1200 on: 13 Aug '13 - 09:03 »
Hi,

When using the iOS version i Xamarin Studio I get error when compiling to device (in simulator all works fine)

Compiler says : "Structure field of type BASSFXChan[] can't be marshalled as LPArray"  "error MT3001: Could not AOT the assembly Bass.Net.iOS.dll"

Any suggestions, is iy your lib or Xamarin?

/Ken

ken

  • Posts: 739
Re: BASS.NET API 2.4.10.2
« Reply #1201 on: 13 Aug '13 - 11:13 »
Hi Bernd.

I got answer from Xamarin (mono touch) about the compiling error and this is there answer.

Quote
It looks like you're hitting the following issue: http://forums.xamarin.com/discussion/comment/20278/#Comment_20278 - which is saying that the assemblies that you're using in Xamarin.iOS were not built against a version of Xamarin.iOS it can reference (based on the changed made here: http://forums.xamarin.com/discussion/1475/changes-to-assembly-strongnames-in-xamarin-ios-6-2-0).

Is it possible to re-build the assemblies against the latest version of Xamarin.iOS or try and download an update of a component for the store if that is the case.

So is there something you need to update in your component?

/Ken

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.10.2
« Reply #1202 on: 13 Aug '13 - 13:11 »
No, as I am not even using ANY Xamarin.iOS assemblies!

With what method call do you get this error - as it seems only one specific one?

I assume it is a call to "BASS_FXSetParameters(int handle, BASS_BFX_MIX par)"

Probably this is another limitation of the Xamarin.iOS compiler....as it can not automatically marshal a class member which is an array!
Note, that "BASS_BFX_MIX" has a lChannel member, which is actually an array of "BASSFXChan":
public BASSFXChan[] lChannel;

So the MT3001 error seems to be a bit misleading and has nothing to do with "...assemblies that you're using in Xamarin.iOS were not built against a version of Xamarin.iOS..." !
Infact the Xamarin.iOS compiler seems to be unable to marshal the 'lChannel' member of the BASS_BFX_MIX class.

If that is the case (what I assume, as I am not using anything else here), then there is effectively only one options I can think of:
- Xamarin.iOS needs to add support for marshaling arrays as class members

I wouldn't know what else to do, as BASS_FX needs that array of 'BASSFXChan' instances.

BUT...
What version of Bass.Net are you using (the latest v2.4.10.2)?
Note, that I have added extra Xamarin overloads to BASS_FXSetParameters when using BASS_BFX_MIX - are you really using these?



ken

  • Posts: 739
Re: BASS.NET API 2.4.10.2
« Reply #1203 on: 13 Aug '13 - 15:11 »
Hi,

I'm using version 2.4.10.2

Only FX call I do is BASS_FX_Create  and then I use BASS_ATTRIB_TEMPO with BASS_ChannelAttribute.  I also use BassMix for mixing 3 channels.

Any more ideas?

Note that all works fine in iOS simulator, it's when I compile to an device the problem comes.

/Ken
« Last Edit: 13 Aug '13 - 15:13 by ken »

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.10.2
« Reply #1204 on: 13 Aug '13 - 15:18 »
But where exactly does it fail or does the compilation process itself is failing?
Does the compiler give any source code position or anything else...?

ken

  • Posts: 739
Re: BASS.NET API 2.4.10.2
« Reply #1205 on: 13 Aug '13 - 15:26 »
But where exactly does it fail or does the compilation process itself is failing?
Does the compiler give any source code position or anything else...?

Compiler says this about Bass.Net.iOS

Code: [Select]

PublicKeyToken=969db8053d3322ac' of the assembly 'Bass.Net.iOS, Version=2.4.10.2, Culture=neutral, PublicKeyToken=b7566c273e6ef480' was not found. Please review the project's references.
warning MT3006: Could not compute a complete dependency map for the project. This will result in slower build times because Xamarin.iOS can't properly detect what needs to be rebuilt (and what does not need to be rebuilt). Please review previous warnings for more details.

Mono Ahead of Time compiler - compiling assembly /Bass.Net.iOS.dll
Structure field of type BASSFXChan[] can't be marshalled as LPArray

error MT3001: Could not AOT the assembly 'Bass.Net.iOS.dll'


I don't get it why is it working in the simulator...


ken

  • Posts: 739
Re: BASS.NET API 2.4.10.2
« Reply #1206 on: 14 Aug '13 - 16:26 »
Hi,

I tested an old version of the iOS dll "2.7.4.2 Bass.Net.iphone.dll" and that version compiles and works on a device. With 2.4.10.2 I get compiling error: "Structure field of type BASSFXChan[] can't be marshalled as LPArray"

Any ideas Bernd?

/Ken

ken

  • Posts: 739
Re: BASS.NET API 2.4.10.2
« Reply #1207 on: 15 Aug '13 - 10:09 »
Hi,

I found some more BASS.NET installations on my computer, newest version that compiles on a iOS device is "2.4.10.1". But I can't use "BASS_ChannelSetSync" I get this error in debug on the device when I try to call BASS_ChannelSetSync:

Code: [Select]
Attempting to JIT compile method '(wrapper native-to-managed) :OnTrackSync (int,int,int,intptr)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.

My sync looks like this:
Code: [Select]
private void OnTrackSync(int handle, int channel, int data, IntPtr user)
{
    ...my stuff
}

I realy need "BASS_ChannelSetSync"...

I use bass, bassmix and bassfx.

/Ken

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.10.2
« Reply #1208 on: 15 Aug '13 - 13:45 »
Then I guess I see what it might be...I'll prepare a new version to play with...

ken

  • Posts: 739
Re: BASS.NET API 2.4.10.2
« Reply #1209 on: 15 Aug '13 - 15:40 »
Then I guess I see what it might be...I'll prepare a new version to play with...

Thanks, I happy to beta test;)

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.10.2
« Reply #1210 on: 15 Aug '13 - 16:03 »
Here is the pre-version link:

 www.un4seen.com/filez/4/Bass24.Net_pre.zip

Let me know, if that works.

ken

  • Posts: 739
Re: BASS.NET API 2.4.10.2
« Reply #1211 on: 15 Aug '13 - 16:40 »
Here is the pre-version link:

 www.un4seen.com/filez/4/Bass24.Net_pre.zip

Let me know, if that works.

Hi,

Compiling to device works now. But I get same error then calling "BASS_ChannelSetSync".

/Ken


radio42

  • Posts: 4576
Re: BASS.NET API 2.4.10.2
« Reply #1212 on: 15 Aug '13 - 16:55 »
How are you creating your SYNCPROC?
I guess to remember, that this must be a static callback method on iOS!

See here from the iOS limitations doc (the error already gives you that link!):

2.2. Reverse Callbacks

In standard Mono it is possible to pass C# delegate instances to unmanaged code in lieu of a function pointer. The runtime would typically transform those function pointers into a small thunk that allows unmanaged code to call back into managed code.

In Mono these bridges are implemented by the Just-in-Time compiler. When using the ahead-of-time compiler required by the iPhone there are two important limitations at this point:
•You must flag all of your callback methods with the MonoPInvokeCallbackAttribute
•The methods have to be static methods, there is no support for instance methods.

So it is not a Bass.Net issue!

ken

  • Posts: 739
Re: BASS.NET API 2.4.10.2
« Reply #1213 on: 15 Aug '13 - 17:20 »
How are you creating your SYNCPROC?


I do like I normaly call sync

Code: [Select]

private SYNCPROC _TrackSync;
private int _sync1 = 0;
private int _sync2 = 0;

_TrackSync = new SYNCPROC(OnTrackSync);

private LoadTrack()
{
   .. create stream and add to mixer stuff

   _sync1 = Bass.BASS_ChannelSetSync(_channel1, BASSSync.BASS_SYNC_POS, _mixPos, _TrackSync, new IntPtr(0)); //Mixcue
   _sync2 = Bass.BASS_ChannelSetSync(_channel1, BASSSync.BASS_SYNC_END, 0, _TrackSync, new IntPtr(1)); //End of File

}


private void OnTrackSync(int handle, int channel, int data, IntPtr user)
{
     Console.WriteLine("OnTrackSync: " + user.ToInt32());
}


Strangly it works in simulator, but not on a device.

How do you suggest I do the Sync call?

/Kennet

ken

  • Posts: 739
Re: BASS.NET API 2.4.10.2
« Reply #1214 on: 15 Aug '13 - 18:01 »
Ok, I got Sync to work with help of this: http://docs.go-mono.com/index.aspx?link=T%3AMonoTouch.MonoPInvokeCallbackAttribute

Now next obstacle is to go from static to non static... I have my "audioEngine" in its own class and using EventArgs to let the mainForm know about when the sync happens...


/Ken

einsteinx2

  • Posts: 67
Re: BASS.NET API 2.4.10.2
« Reply #1215 on: 5 Sep '13 - 03:13 »
Unfortunately, I'm running into the exact same error, except that my callback methods are marked with MonoPInvokeCallback and are static. Yet I'm receiving this when playing audio on my device:

System.ExecutionEngineException: Attempting to JIT compile method '(wrapper native-to-managed) SStreamProc (int,intptr,int,intptr)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.

Anything else I can try? I'm using the prerelease version that you posted as the current release does not compile for me.


Nevermind please ignore this post :)

I had marked a stream proc using MonoPInvokeCallback(typeof(SYNCPROC)) so the definition was incorrect. Once I fixed it to MonoPInvokeCallback(typeof(STREAMPROC)) it worked fine. Sometimes the simplest bugs are so hard to find! I only noticed by accident...
« Last Edit: 6 Sep '13 - 01:00 by einsteinx2 »

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.10.3
« Reply #1216 on: 13 Sep '13 - 17:02 »
13.09.2013: Version 2.4.10.3 is out!

BASSWASAPI: added support for v2.4.0.0
BASSopus: added support for v2.4.1.1
BASS_FX: added support for v2.4.10.2

NOTE: Due to some last minute compatibility changes within BASSWASAPI - I needed to also change the "BassWasapiHandler" (the sessionVol parameter in the constructor is now obsolete).
There actually has been a change to the session volume handling, to allow session and device volume to be used at the same time: the BASS_WASAPI_Init (BASS_WASAPI_SESSIONVOL) option is replaced by a new parameter added to BASS_WASAPI_Get/SetVolume/Mute (BASS_WASAPI_VOL_SESSION) option.

Full Install:
 www.un4seen.com/filez/4/Bass24.Net.zip

Lib only:
 www.un4seen.com/filez/4/Bass24.Net_update.zip

RomikB

  • Posts: 5
Re: BASS.NET API 2.4.10.3
« Reply #1217 on: 25 Sep '13 - 13:07 »
Is Unity3D supported?

I get this error when try to add Bass.Net.iOS.dll to my Unity3D Plugins folder.

Quote
Error building Player: SystemException: Duplicate native method found: BASS_MIDI_StreamCreateFileMemory. Please check your source carefully.

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.10.3
« Reply #1218 on: 26 Sep '13 - 08:15 »
As it works in general on iOS using Mono Xamarin I guess it might be a Unity3D issue.
Have you asked them for support (I am actually not using Unity3D).

RomikB

  • Posts: 5
Re: BASS.NET API 2.4.10.3
« Reply #1219 on: 26 Sep '13 - 09:40 »
They say:
Quote
you must not have the same dllimport in two functions.
Possible it's because you import BASS_MIDI_StreamCreateFile two times: in BASS_MIDI_StreamCreateFileMemory and BASS_MIDI_StreamCreateFileUnicode

ecoldur

  • Posts: 2
Re: BASS.NET API 2.4.10.3
« Reply #1220 on: 29 Sep '13 - 06:53 »
Hi there;

I am using BASS.NET wrapper for Android for an audio application. Here is my situation.

I have an mp4 file or an mp3 file stored in the device. I would like to start playing the mp3 file, open the mic for recording when the user taps a button at the same time.

In other words, I would like to be able to record what is playing from the mp3 file along with the mic at the same time and record the resulting stream into another mp3 file in real time. Think of it like Karaoke... User taps a button, the mp3 starts playing, the mic becomes enabled and the user then can sing along and record the resulting combined stream from the mic and the mp3 file.

I have tried opening up two streams one from the mic and one from the file, then hooking up these two streams into a mixer but when I call channelplay on the mixers stream nothing happens.

Can anyone please help

Thanks

MadUnity3d

  • Posts: 3
Re: BASS.NET API 2.4.10.3
« Reply #1221 on: 6 Oct '13 - 17:56 »
They say:
Quote
you must not have the same dllimport in two functions.
Possible it's because you import BASS_MIDI_StreamCreateFile two times: in BASS_MIDI_StreamCreateFileMemory and BASS_MIDI_StreamCreateFileUnicode

True!!!
I have the same Problem and got also the same Error Message....
How can we fix that ???
Thank You!

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.10.3
« Reply #1222 on: 7 Oct '13 - 09:47 »
Bass.Net often uses 'overloads' - meaning using the same method name with different parameters - that is a common and standard way within .Net and any other object-oriented language.
If Unity3D has an issue with this, this should definitely be fixed on their side, as I definitely can not change this within Bass.Net, as it is used all over.
Another 'overload' example is "BASS_ChannelGetData".
As such it must definitely be fixed on the Unity3D side!

Vouille

  • Guest
Re: BASS.NET API 2.4.10.3
« Reply #1223 on: 4 Nov '13 - 13:10 »
Hello

 ???It's impossible for me to download full file : download stops at 19.4Mo.
Zip file seems to be corrupted.

Is that the case for everybody ?

Ian @ un4seen

  • Administrator
  • Posts: 20426
Re: BASS.NET API 2.4.10.3
« Reply #1224 on: 6 Nov '13 - 14:20 »
Do you have a virus scanner enabled? If so, please try temporarily disabling that for the download. A few people have had problems with their virus scanner (I'm not sure which scanner) apparently halting the download for an extended period, which causes the connection to timeout.