Author Topic: BASS for ARM Linux  (Read 142495 times)

DJAGABx

  • Guest
Re: BASS for ARM Linux
« Reply #350 on: 26 Jul '17 - 10:24 »
Thanks Ian for the quick reply.
I did a quick test and the add-ons appear to work fine on the 64bit environment. Would it be possible to create a 64bit version of the libbasscd.so as well?

Ian @ un4seen

  • Administrator
  • Posts: 20400
Re: BASS for ARM Linux
« Reply #351 on: 26 Jul '17 - 17:05 »
The BASSCD add-on has now been added, as has the BASSMIDI add-on.

   www.un4seen.com/stuff/bass24-linux-aarch64.zip

DJAGABx

  • Guest
Re: BASS for ARM Linux
« Reply #352 on: 27 Jul '17 - 14:02 »
Thanks again Ian for the quick response. I may have found a possible issue concerning BASS_ChannelSetSync. I use a mono environment version 4.2.1.201 together with the latest Bass.net version and the bass version from the arm64 package. Perhaps you or Radio 42 could look into this. To me it feels like accessing dereferenced pointers on the unmanaged side from a managed side.
This happens on all places in my code where channelsetsync is used. The same code has worked before on an ARM32 environment using mono version 3.10 armhf.

Here is the stack trace:

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) object.__icall_wrapper_mono_delegate_to_ftnptr (object) <0xffffffff>
  at (wrapper managed-to-native) Un4seen.Bass.Bass.BASS_ChannelSetSync (int,Un4seen.Bass.BASSSync,long,Un4seen.Bass.SYNCPROC,intptr) <0xffffffff>
  at AudioBitsApp.Radio.Connect () <0x001b7>
  at AudioBitsApp.AudioBits.TestInternetRadio (string) <0x00073>

And here's an excerpt from the code reponsible:
Code: [Select]
_Stream=Bass.BASS_StreamCreateURL(url,0,BASSFlag.BASS_STREAM_STATUS|BASSFlag.BASS_STREAM_DECODE|BASSFlag.BASS_STREAM_PRESCAN,null,IntPtr.Zero);

//check for _Stream being zero left out.

BASS_CHANNELINFO info=Bass.BASS_ChannelGetInfo(_Stream);
mySync+=new SYNCPROC(MetaSync);
Bass.BASS_ChannelSetSync(_Stream, BASSSync.BASS_SYNC_META, 0,mySync,IntPtr.Zero);
}

This is just a small piece I took from the part of my program that tests Radio station stream validity. It happens on other places, too where I use channelsetsync for other purposes.

Thanks in advance for the effort.

djagab

  • Posts: 35
Re: BASS for ARM Linux
« Reply #353 on: 28 Jul '17 - 10:40 »
I have read Radio42's very comprehensive help section Interoperating with Unmanaged Code and made some changes to the code listed above.
mySync+=new SYNCPROC(MetaSync); changed to mySync=new SYNCPROC(MetaSync);
This time it is working fine, again! This leads me to the question: Why does mono 4.2.1.102 require this modification while mono 3.10 armhf does not?
In respect to Garbage Collection compared to unmanaged code, how does '+=' act differently compared to using '='?
@Radio42: Your thoughts please..... ;)

 

radio42

  • Posts: 4574
Re: BASS for ARM Linux
« Reply #354 on: 28 Jul '17 - 11:37 »
I cannot really follow, since the += operator is noemally used for event handlers; while the = sign is a simple assign operator.
SoI cannot follow, why += should have have worked once. "+=" and "=" are two different things.
The only main difference with Mono once was (afair), that it only allowed static callbacks - but I am not sure, as I am not too much into Mono development.

djagab

  • Posts: 35
Re: BASS for ARM Linux
« Reply #355 on: 30 Jul '17 - 09:40 »
Thanks for your reply. It didn't make sense to me either. I changed the error (possible type-o) and now it is working fine on an Allwinner H5 ARM64 SBC from China :). I expected some performance improvements over the ARM32 version, though. The performance is slightly worse, but this might be mono version related.
Anyway bass(.net) is running on an ARM64 architecture. Good work!!

DJAGABx

  • Guest
Re: BASS for ARM Linux
« Reply #356 on: 31 Jul '17 - 10:50 »
One more thing. I connected the DSD DAC based on the ESS Sabre 9018K2M to this SBC with the ARM64 setup. In my DAC this chip is combined with a SA9227 USB receiver. This combination requires a valid DOP marker right at the beginning of the playback. In order to achieve this, Ian advised to disable all ramp-in and introduced an attribute to channelplay for preventing ramp-in. This attribute had number 11. @Ian: Could it be this option is not available in the 64bit build version for ARM? When I try to play the file it is not recognised as a valid Dop file and the setattribute line in my code
Code: [Select]
Bass.BASS_ChannelSetAttribute(!useRaW ? mixerHandle : stream, (BASSAttribute)11, 1); returns false for this version of libbass.so 

DJAGABx

  • Guest
Re: BASS for ARM Linux
« Reply #357 on: 31 Jul '17 - 11:58 »
Hi Ian. My bad. It turned out the alsamixer set the master volume back to 25% of this device which is not bit perfect enough ;) for playing DoP this way.
The setattribute return value being false was a result of an error occuring in a piece of code prior to this setattribute.  :'( So, nothing wrong with BASS but with me, needing a holiday ;)



ken

  • Posts: 739
Re: BASS for ARM Linux
« Reply #358 on: 14 Aug '17 - 12:12 »
Hi Ian,

Do you have an 64-bit version of the Bass ARM?

I'm trying to run it on a Allwinner H5 64-bit processor, but it just say "threw an exception".

This is the board: http://www.friendlyarm.com/index.php?route=product/product&path=69&product_id=180

Running Ubuntu core 16.04 LTS (4.11.2) aarch64

Thanks!

/Ken


-- EDIT --

Just found the post with "linux-aarch64" seam to work just fine!  Is it possible to make "libbassalac" and "libbassopus" as 64-bit to?

/Ken



« Last Edit: 14 Aug '17 - 12:19 by ken »

Ian @ un4seen

  • Administrator
  • Posts: 20400
Re: BASS for ARM Linux
« Reply #359 on: 15 Aug '17 - 18:02 »
The BASSALAC and BASSOPUS add-ons have been added:

   www.un4seen.com/stuff/bass24-linux-aarch64.zip

Let me know if you hear any problems with BASSOPUS. It's using the latest libOpus version (1.2.1), which seems to have introduced sound quality issues on iOS at least. I haven't got to the bottom of that yet, which is why none of the ARM-based platforms have been updated to BASSOPUS 2.4.1.10 yet, in case it affects all of them.

Ian @ un4seen

  • Administrator
  • Posts: 20400
Re: BASS for ARM Linux
« Reply #360 on: 8 Sep '17 - 14:48 »
The ARM Linux versions of the recent BASSFLAC and BASSmix releases are up now in the 1st post. The aarch64 architecture files have also now been added to the main package, instead of being separate downloads.

laheller

  • Guest
Re: BASS for ARM Linux
« Reply #361 on: 7 Oct '17 - 22:28 »
Just did a quick test and I can tell that BASS works fine on Raspberry PI running "Raspbian wheezy". I run C# code using Mono 2.10 with BASS.Net (C# 4.0)

/Ken
How to set up the whole stuff? I mean for example where to put the libbass.so ? Which Bass.Net nuget package is required?
I just created a simple console app in Monodevelop + Bass.Net and my code fails at BASS_Init:

Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Un4seen.Bass.Bass' threw an exception. ---> System.DllNotFoundException: bass
  at (wrapper managed-to-native) Un4seen.Bass.Bass:BASS_SetConfig (Un4seen.Bass.BASSConfig,int)
  at Un4seen.Bass.Bass.InitBass () [0x0000c] in <1603c3a5c01b47259b0e7edff8fa7eb0>:0
  at Un4seen.Bass.Bass..cctor () [0x00069] in <1603c3a5c01b47259b0e7edff8fa7eb0>:0
   --- End of inner exception stack trace ---
  at Second.MainClass.Main (System.String[] args) [0x0009f] in /home/pi/Test/Second/Program.cs:19
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'Un4seen.Bass.Bass' threw an exception. ---> System.DllNotFoundException: bass
  at (wrapper managed-to-native) Un4seen.Bass.Bass:BASS_SetConfig (Un4seen.Bass.BASSConfig,int)
  at Un4seen.Bass.Bass.InitBass () [0x0000c] in <1603c3a5c01b47259b0e7edff8fa7eb0>:0
  at Un4seen.Bass.Bass..cctor () [0x00069] in <1603c3a5c01b47259b0e7edff8fa7eb0>:0
   --- End of inner exception stack trace ---
  at Second.MainClass.Main (System.String[] args) [0x0009f] in /home/pi/Test/Second/Program.cs:19


laheller

  • Guest
Re: BASS for ARM Linux
« Reply #362 on: 9 Oct '17 - 10:31 »
Just did a quick test and I can tell that BASS works fine on Raspberry PI running "Raspbian wheezy". I run C# code using Mono 2.10 with BASS.Net (C# 4.0)

/Ken
How to set up the whole stuff? I mean for example where to put the libbass.so ? Which Bass.Net nuget package is required?
I just created a simple console app in Monodevelop + Bass.Net and my code fails at BASS_Init:

Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Un4seen.Bass.Bass' threw an exception. ---> System.DllNotFoundException: bass
  at (wrapper managed-to-native) Un4seen.Bass.Bass:BASS_SetConfig (Un4seen.Bass.BASSConfig,int)
  at Un4seen.Bass.Bass.InitBass () [0x0000c] in <1603c3a5c01b47259b0e7edff8fa7eb0>:0
  at Un4seen.Bass.Bass..cctor () [0x00069] in <1603c3a5c01b47259b0e7edff8fa7eb0>:0
   --- End of inner exception stack trace ---
  at Second.MainClass.Main (System.String[] args) [0x0009f] in /home/pi/Test/Second/Program.cs:19
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'Un4seen.Bass.Bass' threw an exception. ---> System.DllNotFoundException: bass
  at (wrapper managed-to-native) Un4seen.Bass.Bass:BASS_SetConfig (Un4seen.Bass.BASSConfig,int)
  at Un4seen.Bass.Bass.InitBass () [0x0000c] in <1603c3a5c01b47259b0e7edff8fa7eb0>:0
  at Un4seen.Bass.Bass..cctor () [0x00069] in <1603c3a5c01b47259b0e7edff8fa7eb0>:0
   --- End of inner exception stack trace ---
  at Second.MainClass.Main (System.String[] args) [0x0009f] in /home/pi/Test/Second/Program.cs:19

Nevermind, I already solved it.
Problem was the I forgot to reference Bass.Net.Linux.dll and also used wrong version of libbass.so.
Now it works!

Ian @ un4seen

  • Administrator
  • Posts: 20400
Re: BASS for ARM Linux
« Reply #363 on: 10 Oct '17 - 17:57 »
An ARM Linux version of the BASSHLS add-on has been added to the package in the 1st post.

Alias

  • Guest
Re: BASS for ARM Linux
« Reply #364 on: 9 Nov '17 - 05:29 »
Is recording working on Raspberry PI? Playback/encoding works fine, but when i call BASS_RecordStart(44100, 2, BASS_RECORD_PAUSE, 0, 0);, I get BASS_ERROR_DRIVER. BASS_RecordInit gives me BASS_OK. So what's wrong here?

Ian @ un4seen

  • Administrator
  • Posts: 20400
Re: BASS for ARM Linux
« Reply #365 on: 9 Nov '17 - 16:28 »
A BASS_ERROR_DRIVER error from BASS_RecordStart indicates that an ALSA snd_pcm_open call on the device failed, and not because it was busy (EBUSY). For comparison, are you able to successfully record using ALSA's "arecord" utility?

Alias

  • Guest
Re: BASS for ARM Linux
« Reply #366 on: 11 Nov '17 - 11:53 »
Nope. It's not able to open any device (File or directory not found, wrong number for device, ...).