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

Jan Rzepiszczak

  • Posts: 9
BASS for ARM Linux
« Reply #425 on: 14 Sep '20 - 22:32 »
Hey,
I need help again. Some time ago Youtube changed something on their servers and now I have some issues with some of the tracks. The biggest mistake is that if I ran my program on PC it runs perfectly but when I ran this same program but on Raspberry Pi v4 some links cause that thread stop on creating Stream from URL:
Code: [Select]
...
 _currentStream = Bass.BASS_StreamCreateURL(track.Url, 0, BASSFlag.BASS_DEFAULT, null, IntPtr.Zero);
...
When I'm copying stream URL and pasting it into the browser, the browser has no problems with playings such files. And of course, when I'm trying to play these tracks on my PC everything goes smoothly and easy. Because the problem is always with some specific files I downloaded it and tried to compare it but they are identical.
Then I remembered that I have a debug version of libbass for raspberry so I tried to collect some logs.
There are logs from trying opening an invalid file:
Code: [Select]
...
4977[2cf0]: BASS_StreamCreateURL(9b8c394c(4977[2cf0]: nf=9084e0/908630
4977[2cf0]: utf[https://r3---sn-x2pm-3ufk.googlevideo.com/videoplayback?expire=1600138132&ei=NNdfX4vFKMbhyAXLl7HgAw&ip=185.174.112.38&id=o-ADUE-CciW4LBu6gPMxgIFn4X53DChJ9Gk5mKtSrQu52-&itag=251&source=youtube&requiressl=yes&mh=Vc&mm=31%2C29&mn=sn-x2pm-3ufk%2Csn-u2oxu-f5fe6&ms=au%2Crdu&mv=m&mvi=3&pl=22&gcr=pl&initcwndbps=760000&vprv=1&mime=audio%2Fwebm&gir=yes&clen=4119747&dur=217.221&lmt=1580613614122630&mt=1600116401&fvip=3&keepalive=yes&beids=23886209&c=WEB&txp=5531432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgW7codG9-XNwK3o99IgnNRUuuxHxokIQICLGnQkuh3dECIBN3AJdY-FmnD8w6QS26mFnlQlzVDIrSLnbpJotze-oo&sig=AOq0QJ8wRAIgagP7QRIguFPFU_QVpNlELcg8g-o035-hRfBjvfYd8gYCIGU--OELQt0Mzknghv-V7iptf8SvQQSqVSxl1jRZrZbB]
4977[2cf0]: ssl=5e63d8
5045[2cf0]: addr=176.126.58.206
5045[2cf0]: socket=282
5045[2cf0]: connect...
5051[2cf0]: connected
5051[2cf0]: SET_TLSEXT_HOSTNAME = 1
In this case, it is the end of the file. If I'm trying to load other songs I'm getting output:
Code: [Select]
...
4465[2d71]: BASS_StreamCreateURL(b5211978(https://r8---sn-x2pm-3ufk.googlevideo.com/videoplayback?expire=1600138223&ei=j9dfX4D_EpT-7ATb34CwCw&ip=185.174.112.38&id=o-ABY4xtAl3ti_q1Tsariy_Efowlyy6MCGTgUXUQ8CGMXg&itag=251&source=youtube&requiressl=yes&mh=pr&mm=31%2C29&mn=sn-x2pm-3ufk%2Csn-u2oxu-f5fed&ms=au%2Crdu&mv=m&mvi=8&pl=22&initcwndbps=807500&vprv=1&mime=audio%2Fwebm&gir=yes&clen=3409797&dur=208.461&lmt=1584130788919679&mt=1600116520&fvip=2&keepalive=yes&c=WEB&txp=5431432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAMaCZZYfxo7NCxSpW8lUg-RNF32iFCF9i57OdqeHhseVAiAXs7o9-jsqpDo468AePahhHaE-lyJOwMTu-rt9ZxzbhA%3D%3D&sig=AOq0QJ8wRgIhAM9a9laAJYfHZ5mvBJ7NHrii30b7K-Xvk2zABfOpdnfWAiEAknnBPdzrG7w41tyLdQMoAR4tLfr3n1UR5pMl5vDLWbI=), 0, 0, 0, 0)
4465[2d71]: nf=b52bc1c8/b52bc318
4479[2d71]: addr=176.126.58.211
4479[2d71]: socket=270
4479[2d71]: connect...
4484[2d71]: connected
4484[2d71]: SET_TLSEXT_HOSTNAME = 1
4511[2d71]: http[HTTP/1.1 200 OK]
4511[2d71]: http[Last-Modified: Fri, 13 Mar 2020 20:19:48 GMT]
4511[2d71]: http[Content-Type: audio/webm]
4511[2d71]: http[Date: Mon, 14 Sep 2020 20:50:24 GMT]
4511[2d71]: http[Expires: Mon, 14 Sep 2020 20:50:24 GMT]
4511[2d71]: http[Cache-Control: private, max-age=21299]
4511[2d71]: http[Accept-Ranges: bytes]
4511[2d71]: http[Content-Length: 3409797]
4511[2d71]: http[Connection: keep-alive]
4511[2d71]: http[Alt-Svc: h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"]
4511[2d71]: http[Vary: Origin]
4511[2d71]: http[X-Content-Type-Options: nosniff]
4511[2d71]: http[Server: gvs 1.0]
...
And songs can be played.
Unfortunately, links have got expiration dates and are filtered for specific IP addresses so I can't give just paste in because they will respond with 403 error code. But I downloaded two files which I had a problem and one working perfectly.  Link: https://1drv.ms/u/s!AhZzYQaFDepLgrV7gKEsL0g1knJ15g?e=gC6Jl5
Summarizing, links works on PC but this same link freezes the bass library on BASS_StreamCreateURL() method when run on Raspberry Pi 4. Most of the links run perfectly but some of them cause the problem.  And in the end, from time to time "broken" link will run easily without causing the problem, but if I try to play it next time by creating a new stream from this same URL it freezes.

P.S. I'm using radio42 Bass.Net wrapper.


Ian @ un4seen

  • Administrator
  • Posts: 26108
Re: BASS for ARM Linux
« Reply #426 on: 15 Sep '20 - 15:19 »
Coincidentally, there was an HTTPS-related ARM Linux bugfix posted yesterday:

   www.un4seen.com/forum/?topic=19073

Please give that update a try and see whether it helps in your case too.

Jan Rzepiszczak

  • Posts: 9
BASS for ARM Linux
« Reply #427 on: 15 Sep '20 - 16:45 »
I tried to update library but nothing changed at all, the song is played properly in 1 of 30-40 cases. Most of the time it just stuck in creating stream from url for this specifics songs. I'm using webm and opus plugins too, it is changing situation?

Ian @ un4seen

  • Administrator
  • Posts: 26108
Re: BASS for ARM Linux
« Reply #428 on: 15 Sep '20 - 17:20 »
OK. I will send you a debug version to get more information on what's happening.

Ian @ un4seen

  • Administrator
  • Posts: 26108
Re: BASS for ARM Linux
« Reply #429 on: 17 Sep '20 - 17:30 »
The ARM Linux version of the BASSMIDI 2.4.13 release is up now in the 1st post.

Harry May

  • Guest
Re: BASS for ARM Linux
« Reply #430 on: 24 Nov '20 - 16:05 »
I want to publish an open source project containing some bass libraries for ARM platform.
For the ease of use I would like to include the libbass...so libraries into my project.
Is this allowed? Or does each user need to search for them on your web site ?

Ian @ un4seen

  • Administrator
  • Posts: 26108
Re: BASS for ARM Linux
« Reply #431 on: 25 Nov '20 - 15:28 »
It will be fine to include the BASS libraries with your project, so long as you make it clear (eg. in the documentation) that BASS is not free and the user will need to get a licence if they decide to use it commercially.

Harry May

  • Guest
Re: BASS for ARM Linux
« Reply #432 on: 26 Nov '20 - 10:39 »
thanks for your answer. That makes it easier for the user. I will put a link to your licensing in the source code and in the GUI.
The project is on github: https://github.com/dj0abr/SSB_HighSpeed_Modem

Ian @ un4seen

  • Administrator
  • Posts: 26108
Re: BASS for ARM Linux
« Reply #433 on: 7 Dec '20 - 16:10 »
The ARM Linux versions of the BASSenc 2.4.15, BASSenc_FLAC 2.4.3, BASSenc_OGG 2.4.1, BASSenc_OPUS 2.4.2, BASSFLAC 2.4.4.5 releases are now up in the 1st post.

Ian @ un4seen

  • Administrator
  • Posts: 26108
Re: BASS for ARM Linux
« Reply #434 on: 6 Jan '21 - 17:04 »
The ARM Linux version of the BASSALAC 2.4.0.2 release is up now in the 1st post.

Nathan Umali

  • Posts: 4
Re: BASS for ARM Linux
« Reply #435 on: 23 Feb '21 - 07:28 »
Which of the libbass.so modules in bass24-linux-arm.zip are able to be run on a Raspberry Pi of any model?

Ian @ un4seen

  • Administrator
  • Posts: 26108
Re: BASS for ARM Linux
« Reply #436 on: 23 Feb '21 - 15:41 »
It depends on whether a 32-bit or 64-bit Linux version is on the RPi. For 32-bit (most common), you would want the "hardfp" libraries. For 64-bit, you would want the "aarch64" libraries.

Ian @ un4seen

  • Administrator
  • Posts: 26108
Re: BASS for ARM Linux
« Reply #437 on: 25 Jun '21 - 14:57 »
The ARM Linux version of the BASS 2.4.16 release is up now in the 1st post.

Ian @ un4seen

  • Administrator
  • Posts: 26108
Re: BASS for ARM Linux
« Reply #438 on: 15 Jul '21 - 13:11 »
The ARM Linux version of the BASSOPUS 2.4.2 release is up in the 1st post.

Ian @ un4seen

  • Administrator
  • Posts: 26108
Re: BASS for ARM Linux
« Reply #439 on: 30 Jul '21 - 17:40 »
The ARM Linux version of the BASSHLS 2.4.3 release is up in the 1st post.

rdkartono

  • Posts: 58
Re: BASS for ARM Linux
« Reply #440 on: 19 Aug '21 - 06:08 »
Using latest BassEnc on Raspberry Pi 4 on Raspbian Buster (10) , showed java.lang.UnsatisfiedLinkError error
Code: [Select]
Waiting for debugger to connect...
Program started.
registered to c library
OS Name : Linux
OS Architecture : arm
OS Version : 5.10.52-v7l+
JVM Name : Java HotSpot(TM) Server VM
Java Lib path : /usr/java/packages/lib/arm:/lib:/usr/lib
Default Separator : :
System : Raspberry / ARM
OS Name : Linux
OS Architecture : arm
OS Version : 5.10.52-v7l+
JVM Name : Java HotSpot(TM) Server VM
Java Lib path : /usr/java/packages/lib/arm:/lib:/usr/lib
Path Separator : [:]
Run Directory : /home/pi/tempjars
User Home : /root
User Directory : /home/pi/tempjars
Raspberry
Copied libbass.so to /home/pi/tempjars
libbass.so copied to /home/pi/tempjars
Copied libbass_fx.so to /home/pi/tempjars
libbass_fx.so copied to /home/pi/tempjars
Copied libbassmix.so to /home/pi/tempjars
libbassmix.so copied to /home/pi/tempjars
Copied libbassenc.so to /home/pi/tempjars
libbassenc.so copied to /home/pi/tempjars
java.lang.UnsatisfiedLinkError: Unable to load library '/home/pi/tempjars/libbassenc.so': Native library (home/pi/tempjars/libbassenc.so) not found in resource path ([file:/home/pi/tempjars/AsyncInput2])
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:277)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:403)
at com.sun.jna.Native.register(Native.java:1529)
at com.sun.jna.Native.register(Native.java:1252)
at com.un4seen.bass.BASSenc.<clinit>(BASSenc.java:170)
at jbass.JBass.Initialize(JBass.java:162)
at b4j.example.standardmicrophoneclass._initialize(standardmicrophoneclass.java:57)
at b4j.example.main._init_microphone(main.java:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
at b4j.example.main.main(main.java:29)
java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Unable to load library '/home/pi/tempjars/libbassenc.so': Native library (home/pi/tempjars/libbassenc.so) not found in resource path ([file:/home/pi/tempjars/AsyncInput2])
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:137)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
at b4j.example.main.main(main.java:29)
Caused by: java.lang.UnsatisfiedLinkError: Unable to load library '/home/pi/tempjars/libbassenc.so': Native library (home/pi/tempjars/libbassenc.so) not found in resource path ([file:/home/pi/tempjars/AsyncInput2])
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:277)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:403)
at com.sun.jna.Native.register(Native.java:1529)
at com.sun.jna.Native.register(Native.java:1252)
at com.un4seen.bass.BASSenc.<clinit>(BASSenc.java:170)
at jbass.JBass.Initialize(JBass.java:162)
at b4j.example.standardmicrophone
Program terminated (StartMessageLoop was not called).
class._initialize(standardmicrophoneclass.java:57)
at b4j.example.main._init_microphone(main.java:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
... 3 more

If using older BassEnc, can show BassEnc version number.

Uname -a :
Linux raspberrypi 5.10.52-v7l+ #1441 SMP Tue Aug 3 18:11:56 BST 2021 armv7l GNU/Linux

 
Kindly check

Ian @ un4seen

  • Administrator
  • Posts: 26108
Re: BASS for ARM Linux
« Reply #441 on: 19 Aug '21 - 14:13 »
What BASSenc version were you using previously? I suspect the difference is that BASSenc now links with the BASS library, whereas it depended on the app doing that (with global scope) in the past. That means the BASS library needs to be in Linux's library search path. The "rpath" linker option can be used to add to the search path, as in the makefile.in file included in the BASS package. I haven't tried it but it looks like the Java equivalent is the "java.library.path" property? You could also try simply loading BASS before you load BASSenc, to see if that's sufficient (as on Android).

rdkartono

  • Posts: 58
Re: BASS for ARM Linux
« Reply #442 on: 20 Aug '21 - 02:35 »
I revert back to this version (attachment : old bass version.jpg)
Bass version, BassEnc version, etc can display.

However my colleague just found out that this old version has problem with newest Pi4 and newest buster too.
playback a wav file, status from Bass.channelplay returned okay, but sound output is garbled and incorrect.
playback the same wav with aplay , sound output is correct.
Last time I use that old bass version is using raspbian Jessie. Everything was okay .

I am going to check and help him.
I guess need to workout with newest bass to work with raspberry buster.

Update 20-08-2021 09:47:
Using Pi3 on latest libraries and latest raspberry buster, if I excluded libbassenc.so from loading, test app can work.
However even using latest libbass.so , playback wav on latest buster still garbled (incorrect)
I tried using old jessie on the same Pi3 , playback is okay .


« Last Edit: 20 Aug '21 - 03:49 by rdkartono »

Ian @ un4seen

  • Administrator
  • Posts: 26108
Re: BASS for ARM Linux
« Reply #443 on: 20 Aug '21 - 17:00 »
The libbassenc.so version from 17/7/2018 didn't link with libbass.so, so that does seem to reinforce the theory in my last post. Did you look into the "java.library.path" property and/or try loading BASS before BASSenc?

Another thing you could try is building and running the Linux BASSenc examples, to see whether they're affected too (they should be working if my theory is correct). To build those examples, replace the standard makefile.in file with the one included in the ARM Linux BASSenc package.

rdkartono

  • Posts: 58
Re: BASS for ARM Linux
« Reply #444 on: 23 Aug '21 - 04:31 »
Good Morning, I tried your suggestion  on java.library.path .
Using latest bass and bassenc library

Java Code :
Code: [Select]
public static void setJavaLibPath(String value) {
if (value instanceof String) {
if (!value.isEmpty()) {
if (!value.equals(javaLibPath)) {
String prev = System.setProperty("java.library.path", value);
javaLibPath = value;
if (prev instanceof String) {
BA.Log("java.library.path changed from "+prev+" to "+value);
} else {
BA.Log("New value for java.library.path to "+value);
}
}
}
}
}

Called on class BASS.java
Code: [Select]
static {
   
    if (Platform.isAndroid()) {
    Native.register(BASS.class, BassLibrary.lib_bass);
    lib_is_loaded = true;
    //System.loadLibrary(BassLibrary.lib_bass);
   
    } else {
    if (!BassLibrary.IsInitialized()) BassLibrary.DetectOS();
    String _libpath = BassLibrary.Extract_Library(BassLibrary.lib_bass);
    if (!_libpath.isEmpty()) {
   
    BassLibrary.setJavaLibPath(BassLibrary.rundir);
    Native.register(_libpath);
    lib_is_loaded = true;
    }
   
    }
   
   
   
    }

Called in my B4X java wrapper
Code: [Select]
bass = new BASS();
bassfx = new BASS_FX();
bassmix = new BASSmix();
bassenc = new BASSenc();
bassenc_mp3 = new BASSenc_MP3();

BA.Log("BASS version="+Bit.ToHexString(bass.BASS_GetVersion()));
BA.Log("BASS_FX version="+Bit.ToHexString(bassfx.BASS_FX_GetVersion()));
BA.Log("BASSENC version="+Bit.ToHexString(bassenc.BASS_Encode_GetVersion()));
BA.Log("BASSMIX version="+Bit.ToHexString(bassmix.BASS_Mixer_GetVersion()));
BA.Log("BASSENC MP3 version="+Bit.ToHexString(bassenc_mp3.BASS_Encode_MP3_GetVersion()));

Log in B4J test app
Code: [Select]
Waiting for debugger to connect...
Program started.
OS Name : Linux
OS Architecture : arm
OS Version : 5.10.52-v7+
JVM Name : Java HotSpot(TM) Client VM
Java Lib path : /usr/java/packages/lib/arm:/lib:/usr/lib
Path Separator : [:]
Run Directory : /home/pi/tempjars
User Home : /root
User Directory : /home/pi/tempjars
Raspberry
Copied libbass.so to /home/pi/tempjars
libbass.so copied to /home/pi/tempjars
java.library.path changed from /usr/java/packages/lib/arm:/lib:/usr/lib to /home/pi/tempjars
Copied libbass_fx.so to /home/pi/tempjars
libbass_fx.so copied to /home/pi/tempjars
Copied libbassmix.so to /home/pi/tempjars
libbassmix.so copied to /home/pi/tempjars
Copied libbassenc.so to /home/pi/tempjars
libbassenc.so copied to /home/pi/tempjars
java.lang.UnsatisfiedLinkError: Unable to load library '/home/pi/tempjars/libbassenc.so':
libbass.so: cannot open shared object file: No such file or directory
libbass.so: cannot open shared object file: No such file or directory
Native library (home/pi/tempjars/libbassenc.so) not found in resource path ([file:/home/pi/tempjars/AsyncInput2])
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:301)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:461)


based on this sequence :
bass = new BASS();
bassfx = new BASS_FX();               
bassmix = new BASSmix();            
bassenc = new BASSenc();               
bassenc_mp3 = new BASSenc_MP3();
So actually bass , bassfx, and bassmix can be loaded succesfully.
Test app began to crash at loading bassenc.

So, once more, I revert back to old bass libraries, recompile again, and run the same codes and test app again, showing success
Code: [Select]
Waiting for debugger to connect...
Program started.
OS Name : Linux
OS Architecture : arm
OS Version : 5.10.52-v7+
JVM Name : Java HotSpot(TM) Client VM
Java Lib path : /usr/java/packages/lib/arm:/lib:/usr/lib
Path Separator : [:]
Run Directory : /home/pi/tempjars
User Home : /root
User Directory : /home/pi/tempjars
Raspberry
Copied libbass.so to /home/pi/tempjars
libbass.so copied to /home/pi/tempjars
java.library.path changed from /usr/java/packages/lib/arm:/lib:/usr/lib to /home/pi/tempjars
Copied libbass_fx.so to /home/pi/tempjars
libbass_fx.so copied to /home/pi/tempjars
Copied libbassmix.so to /home/pi/tempjars
libbassmix.so copied to /home/pi/tempjars
Copied libbassenc.so to /home/pi/tempjars
libbassenc.so copied to /home/pi/tempjars
Copied libbassenc_mp3.so to /home/pi/tempjars
libbassenc_mp3.so copied to /home/pi/tempjars
BASS version=2040e00
BASS_FX version=2040c01
BASSENC version=2040e00
BASSMIX version=2040902
BASSENC MP3 version=2040100
index=0, Name=No sound, Driver=, Enabled=true
index=1, Name=Default, Driver=default, Enabled=true
index=2, Name=bcm2835 Headphones: bcm2835 Headphones, Driver=hw:0,0, Enabled=true
Bass inited
Bass Playfile success
Play Start = File = /home/pi/Channel_1_20210819100156.wav, Device=Default
Play Stop = File = /home/pi/Channel_1_20210819100156.wav, Device=Default

   

However , at Raspbian Buster, audio output was garbled and incorrect

Update 23/08/2021 11:35 :
About your suggestion on running Linux Bassenc example , while I am no expert in C programming,
I compiled "convert" example on bassenc using "make convert",
then run it . Here is the result
Code: [Select]
./convert ~/Channel_1_20210819100156.wav
BASSenc transcoding example
---------------------------
output: bass.wav
done: 1155956 / 1155956

« Last Edit: 23 Aug '21 - 05:37 by rdkartono »

Ian @ un4seen

  • Administrator
  • Posts: 26108
Re: BASS for ARM Linux
« Reply #445 on: 23 Aug '21 - 16:54 »
Code: [Select]
public static void setJavaLibPath(String value) {
if (value instanceof String) {
if (!value.isEmpty()) {
if (!value.equals(javaLibPath)) {
String prev = System.setProperty("java.library.path", value);
javaLibPath = value;
if (prev instanceof String) {
BA.Log("java.library.path changed from "+prev+" to "+value);
} else {
BA.Log("New value for java.library.path to "+value);
}
}
}
}
}

Are you sure that is the correct way to change the java.library.path property? I'm not a Java user myself, so I'm not sure, but I found this:

   https://examples.javacodegeeks.com/java-library-path-what-is-java-library-and-how-to-use/

Have you also tried the "Through the command line or terminal" and "Through Java source code" methods mentioned there?

If modifying the java.library.path property doesn't help then another thing you can try is setting Linux's LD_LIBRARY_PATH environment variable. For example, put this in a script to launch your app:

Code: [Select]
export LD_LIBRARY_PATH=/home/pi/tempjars
java ...

Code: [Select]
java.lang.UnsatisfiedLinkError: Unable to load library '/home/pi/tempjars/libbassenc.so':
libbass.so: cannot open shared object file: No such file or directory

That confirms that the problem is that Linux is unable to find the libbass.so file (which libbassenc.so is linked to), presumably because the /home/pi/tempjars folder isn't in the library search path.

based on this sequence :
bass = new BASS();
bassfx = new BASS_FX();               
bassmix = new BASSmix();            
bassenc = new BASSenc();               
bassenc_mp3 = new BASSenc_MP3();
So actually bass , bassfx, and bassmix can be loaded succesfully.

The change to add-ons linking with BASS on Linux is fairly recent, and the BASSmix and BASS_FX libraries don't do it yet (they will in their next releases). The reason for the change is that the old system depended on the BASS library being preloaded with global scope by the app but some languages (eg. at least some .Net versions) don't load libraries with global scope, which means the add-ons can't access the BASS functions (unless the user adds some extra code to give them global scope). The add-ons already link with BASS on other the platforms, so it made sense to do the same on Linux rather than require "global scope" workarounds.

However , at Raspbian Buster, audio output was garbled and incorrect

Is that problem only happening when you use the old BASS version or is it with the latest version too?

rdkartono

  • Posts: 58
Re: BASS for ARM Linux
« Reply #446 on: 24 Aug '21 - 02:58 »
Update on 24/08/2021  08:53 :

Garbled and incorrect sound on Raspberry using latest Raspbian Buster is caused by Raspberry Pi Onboard audio.
If using another USB Soundcard and the same codes :
1. Using old libbass.so + libbassenc.so   --> success, audio played and normal
Code: [Select]
Waiting for debugger to connect...
Program started.
OS Name : Linux
OS Architecture : arm
OS Version : 5.10.52-v7+
JVM Name : Java HotSpot(TM) Client VM
Java Lib path : /usr/java/packages/lib/arm:/lib:/usr/lib
Path Separator : [:]
Run Directory : /home/pi/tempjars
User Home : /root
User Directory : /home/pi/tempjars
Raspberry
Failed to copy libbass.so to /home/pi/tempjars
libbass.so copied to /home/pi/tempjars
java.library.path changed from /usr/java/packages/lib/arm:/lib:/usr/lib to /home/pi/tempjars
Failed to copy libbass_fx.so to /home/pi/tempjars
libbass_fx.so copied to /home/pi/tempjars
Failed to copy libbassmix.so to /home/pi/tempjars
libbassmix.so copied to /home/pi/tempjars
Failed to copy libbassenc.so to /home/pi/tempjars
libbassenc.so copied to /home/pi/tempjars
Failed to copy libbassenc_mp3.so to /home/pi/tempjars
libbassenc_mp3.so copied to /home/pi/tempjars
BASS version=2040e00
BASS_FX version=2040c01
BASSENC version=2040e00
BASSMIX version=2040902
BASSENC MP3 version=2040100
index=0, Name=No sound, Driver=, Enabled=true
index=1, Name=Default, Driver=default, Enabled=true
index=2, Name=bcm2835 HDMI 1: bcm2835 HDMI 1, Driver=hw:0,0, Enabled=true
index=3, Name=bcm2835 Headphones: bcm2835 Headphones, Driver=hw:1,0, Enabled=true
index=4, Name=USB Audio Device: USB Audio, Driver=hw:2,0, Enabled=true
Bass inited
Bass Playfile success
Play Start = File = /home/pi/Channel_1_20210819100156.wav, Device=USB Audio Device: USB Audio
Play Stop = File = /home/pi/Channel_1_20210819100156.wav, Device=USB Audio Device: USB Audio

2. Using latest libbass.so + libbassenc.so --> fail to load at libbassenc.so
Code: [Select]
Waiting for debugger to connect...
Program started.
OS Name : Linux
OS Architecture : arm
OS Version : 5.10.52-v7+
JVM Name : Java HotSpot(TM) Client VM
Java Lib path : /usr/java/packages/lib/arm:/lib:/usr/lib
Path Separator : [:]
Run Directory : /home/pi/tempjars
User Home : /root
User Directory : /home/pi/tempjars
Raspberry
Copied libbass.so to /home/pi/tempjars
libbass.so copied to /home/pi/tempjars
java.library.path changed from /usr/java/packages/lib/arm:/lib:/usr/lib to /home/pi/tempjars
Copied libbass_fx.so to /home/pi/tempjars
libbass_fx.so copied to /home/pi/tempjars
Copied libbassmix.so to /home/pi/tempjars
libbassmix.so copied to /home/pi/tempjars
Copied libbassenc.so to /home/pi/tempjars
libbassenc.so copied to /home/pi/tempjars
java.lang.UnsatisfiedLinkError: Unable to load library '/home/pi/tempjars/libbassenc.so':
libbass.so: cannot open shared object file: No such file or directory
libbass.so: cannot open shared object file: No such file or directory
Native library (home/pi/tempjars/libbassenc.so) not found in resource path ([file:/home/pi/tempjars/AsyncInput2])
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:301)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:461)
at com.sun.jna.Native.register(Native.java:1722)
at com.sun.jna.Native.register(Native.java:1443)
at com.un4seen.bass.BASSenc.<clinit>(BASSenc.java:170)
at jbass.JBass.Initialize(JBass.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.jav
a:676)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:240)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
at b4j.example.main.main(main.java:29)
Suppressed: java.lang.UnsatisfiedLinkError: libbass.so: cannot open shared object file: No such file or directory
at com.sun.jna.Native.open(Native Method)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:191)
... 20 more
Suppressed: java.lang.UnsatisfiedLinkError: libbass.so: cannot open shared object file: No such file or directory
at com.sun.jna.Native.open(
Native Method)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:204)
... 20 more
Suppressed: java.io.IOException: Native library (home/pi/tempjars/libbassenc.so) not found in resource path ([file:/home/pi/tempjars/AsyncInput2])
at com.sun.jna.Native.extractFromResourcePath(Native.java:1095)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:275)
... 20 more
java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Unable to load library '/home/pi/tempjars/libbassenc.so':
libbass.so: cannot open shared object file: No such file or directory
libbass.so: cannot open shared object file: No such file or directory
Native library (home/pi/tempjars/libbassenc.so) not found in resource path ([file:/home/pi/tempjars/AsyncInput2])
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:137)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
at b4j.example.main.main(main.java:29)
Caused by: java.lang.UnsatisfiedLinkError: Unable to load library '/home/pi/tempjars/libbassenc.so':
libbass.so: cannot open shared object file: No such file or directory
libbass.so: cannot open shared object file: No such file or directory
Native library (home/pi/tempjars/libbassenc.so) not found in resource path ([file:/home/pi/tempjars/AsyncInput2])
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:301)
at com.sun.jna.Nat
iveLibrary.getInstance(NativeLibrary.java:461)
at com.sun.jna.Native.register(Native.java:1722)
at com.sun.jna.Native.register(Native.java:1443)
at com.un4seen.bass.BASSenc.<clinit>(BASSenc.java:170)
at jbass.JBass.Initialize(JBass.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:676)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:240)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)

at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
... 3 more
Suppressed: java.lang.UnsatisfiedLinkError: libbass.so: cannot open shared object file: No such file or directory
at com.sun.jna.Native.open(Native Method)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:191)
... 20 more
Suppressed: java.lang.UnsatisfiedLinkError: libbass.so: cannot open shared object file: No such file or directory
at com.sun.jna.Native.open(Native Method)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:204)
... 20 more
Suppressed: java.io.IOException: Native library (home/pi/tempjars/libbassenc.so) not found in resource path ([file:/home/pi/tempjars/AsyncInput2])
at com.sun.jna.Native.extractFromResourcePath(Native.java:1095)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:275)
... 20 more
Program terminated (StartMessageLoop was not called).

3. Using latest libbass.so only (because simple wav playback) --> success, audio played and normal
Code: [Select]
Waiting for debugger to connect...
Program started.
OS Name : Linux
OS Architecture : arm
OS Version : 5.10.52-v7+
JVM Name : Java HotSpot(TM) Client VM
Java Lib path : /usr/java/packages/lib/arm:/lib:/usr/lib
Path Separator : [:]
Run Directory : /home/pi/tempjars
User Home : /root
User Directory : /home/pi/tempjars
Raspberry
Copied libbass.so to /home/pi/tempjars
libbass.so copied to /home/pi/tempjars
java.library.path changed from /usr/java/packages/lib/arm:/lib:/usr/lib to /home/pi/tempjars
BASS version=2041003
index=0, Name=No sound, Driver=, Enabled=true
index=1, Name=Default, Driver=default, Enabled=true
index=2, Name=bcm2835 HDMI 1: bcm2835 HDMI 1, Driver=hw:0,0, Enabled=true
index=3, Name=bcm2835 Headphones: bcm2835 Headphones, Driver=hw:1,0, Enabled=true
index=4, Name=USB Audio Device: USB Audio, Driver=hw:2,0, Enabled=true
Bass inited
Bass Playfile success
Play Start = File = /home/pi/Channel_1_20210819100156.wav, Device=USB Audio Device: USB Audio
Play Stop = File = /home/pi/Channel_1_20210819100156.wav, Device=USB Audio Device: USB Audio


On Old Raspbian Jessie, I dont have this garbled audio , either using Pi onboard audio or USB sound card

Quote
Are you sure that is the correct way to change the java.library.path property? I'm not a Java user myself, so I'm not sure, but I found this:

   https://examples.javacodegeeks.com/java-library-path-what-is-java-library-and-how-to-use/

Have you also tried the "Through the command line or terminal" and "Through Java source code" methods mentioned there?

If modifying the java.library.path property doesn't help then another thing you can try is setting Linux's LD_LIBRARY_PATH environment variable. For example, put this in a script to launch your app:
About above hint, I use "Through Java source code" method.
However, still could not follow your explanation on this
Quote
The change to add-ons linking with BASS on Linux is fairly recent, and the BASSmix and BASS_FX libraries don't do it yet (they will in their next releases). The reason for the change is that the old system depended on the BASS library being preloaded with global scope by the app but some languages (eg. at least some .Net versions) don't load libraries with global scope, which means the add-ons can't access the BASS functions (unless the user adds some extra code to give them global scope). The add-ons already link with BASS on other the platforms, so it made sense to do the same on Linux rather than require "global scope" workarounds.
Usually I load bass libraries using JNA "Native.register(path_to_so_library)" command
Code: [Select]
String _libpath = BassLibrary.Extract_Library(BassLibrary.lib_bassenc);
    if (!_libpath.isEmpty()) {
    Native.register(_libpath);
    lib_is_loaded = true;
    }
_libpath is the complete file path , not relative file path. So libbassenc.so should be found and recognized, as it did on old bassenc version.
Could you explain more about your hint on above quote ? Maybe libbassenc.so need to be reload using other method than Native.register() ?
« Last Edit: 24 Aug '21 - 03:11 by rdkartono »

Ian @ un4seen

  • Administrator
  • Posts: 26108
Re: BASS for ARM Linux
« Reply #447 on: 24 Aug '21 - 17:44 »
Usually I load bass libraries using JNA "Native.register(path_to_so_library)" command
Code: [Select]
String _libpath = BassLibrary.Extract_Library(BassLibrary.lib_bassenc);
    if (!_libpath.isEmpty()) {
    Native.register(_libpath);
    lib_is_loaded = true;
    }
_libpath is the complete file path , not relative file path. So libbassenc.so should be found and recognized, as it did on old bassenc version.

The libbassenc.so file is found fine. The problem is that the libbass.so file (which libbassenc.so now links to) isn't found, as in the error message you posted earlier:

Quote
java.lang.UnsatisfiedLinkError: Unable to load library '/home/pi/tempjars/libbassenc.so':
libbass.so: cannot open shared object file: No such file or directory

That means that Linux couldn't find the libbass.so file because it isn't in the library search path. If modifying the java.library.path property doesn't affect Linux's library search path then that won't help Linux to find the BASS library. Setting the LD_LIBRARY_PATH environment variable should help, but I now have another idea and here's a new BASSenc build for you to try:

   www.un4seen.com/stuff/bassenc-linux-arm.zip

This has an "rpath" value (mentioned in my 1st reply) set to tell Linux to look for any dependencies (ie. libbass.so) in the same folder as it's in. Let me know whether it helps.

rdkartono

  • Posts: 58
Re: BASS for ARM Linux
« Reply #448 on: 25 Aug '21 - 03:09 »
Update 25/08/2021  09:37

Using trial bassenc , can load libbassenc.so and show version number
Code: [Select]
Waiting for debugger to connect...
Program started.
OS Name : Linux
OS Architecture : arm
OS Version : 5.10.52-v7+
JVM Name : Java HotSpot(TM) Client VM
Java Lib path : /usr/java/packages/lib/arm:/lib:/usr/lib
Path Separator : [:]
Run Directory : /home/pi/tempjars
User Home : /root
User Directory : /home/pi/tempjars
Raspberry
Copied libbass.so to /home/pi/tempjars
libbass.so copied to /home/pi/tempjars
java.library.path changed from /usr/java/packages/lib/arm:/lib:/usr/lib to /home/pi/tempjars
Copied libbass_fx.so to /home/pi/tempjars
libbass_fx.so copied to /home/pi/tempjars
Copied libbassmix.so to /home/pi/tempjars
libbassmix.so copied to /home/pi/tempjars
Copied libbassenc.so to /home/pi/tempjars
libbassenc.so copied to /home/pi/tempjars
Copied libbassenc_mp3.so to /home/pi/tempjars
libbassenc_mp3.so copied to /home/pi/tempjars
BASS version=2041003
BASS_FX version=2040c01
BASSENC version=2040f03
BASSMIX version=2040a00
BASSENC MP3 version=2040100
index=0, Name=No sound, Driver=, Enabled=true
index=1, Name=Default, Driver=default, Enabled=true
index=2, Name=bcm2835 Headphones: bcm2835 Headphones, Driver=hw:0,0, Enabled=true
Bass inited
Bass Playfile success
Play Start = File = /home/pi/Channel_1_20210819100156.wav, Device=bcm2835 Headphones: bcm2835 Headphones
Play Stop = File = /home/pi/Channel_1_20210819100156.wav, Device=bcm2835 Headphones: bcm2835 Headphones


However, regarding garbled playback when using onboard Raspberry audio on Raspbian Buster, have some ideas to solve this ?
in latest project, could not use Jessie anymore, since Jessie dont support Pi 4.

rdkartono

  • Posts: 58
Re: BASS for ARM Linux
« Reply #449 on: 25 Aug '21 - 07:38 »
Update 25/08/2021  13:34

Apparently libbassenc_mp3 require the same treatment as libbassenc trial.

Using latest bass (hardfp), latest libbassenc (hardfp), and patched with trial libbassenc (hardfp), will produce similar error
Code: [Select]
Waiting for debugger to connect...
Program started.
OS Name : Linux
OS Architecture : arm
OS Version : 5.10.52-v7+
JVM Name : Java HotSpot(TM) Client VM
Java Lib path : /usr/java/packages/lib/arm:/lib:/usr/lib
Path Separator : [:]
Run Directory : /home/pi/tempjars
User Home : /root
User Directory : /home/pi/tempjars
Raspberry
Failed to copy libbass.so to /home/pi/tempjars
libbass.so copied to /home/pi/tempjars
java.library.path changed from /usr/java/packages/lib/arm:/lib:/usr/lib to /home/pi/tempjars
Failed to copy libbass_fx.so to /home/pi/tempjars
libbass_fx.so copied to /home/pi/tempjars
Failed to copy libbassmix.so to /home/pi/tempjars
libbassmix.so copied to /home/pi/tempjars
Failed to copy libbassenc.so to /home/pi/tempjars
libbassenc.so copied to /home/pi/tempjars
Failed to copy libbassenc_mp3.so to /home/pi/tempjars
libbassenc_mp3.so copied to /home/pi/tempjars
java.lang.UnsatisfiedLinkError: Unable to load library '/home/pi/tempjars/libbassenc_mp3.so':
libbassenc.so: cannot open shared object file: No such file or directory
libbassenc.so: cannot open shared object file: No such file or directory
Native library (home/pi/tempjars/libbassenc_mp3.so) not found in resource path ([file:/home/pi/tempjars/AsyncInput2])
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:301)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:461)
at com.sun.jna.Native.register(Native.java:1722)
at com.sun.jna.Native.register(Native.java:1443)
at com.un4seen.bass.BASSenc_MP3.<clinit>(BASSenc_MP3.java:29)
at jbass.JBass.Initialize(JBass.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.ru
nVoidMethod(Shell.java:676)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:240)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
at b4j.example.main.main(main.java:29)
Suppressed: java.lang.UnsatisfiedLinkError: libbassenc.so: cannot open shared object file: No such file or directory
at com.sun.jna.Native.open(Native Method)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:191)
... 20 more
Suppressed: java.lang.UnsatisfiedLinkError: libbassenc.so: cannot open shared object file: No such file or directory

at com.sun.jna.Native.open(Native Method)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:204)
... 20 more
Suppressed: java.io.IOException: Native library (home/pi/tempjars/libbassenc_mp3.so) not found in resource path ([file:/home/pi/tempjars/AsyncInput2])
at com.sun.jna.Native.extractFromResourcePath(Native.java:1095)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:275)
... 20 more
java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Unable to load library '/home/pi/tempjars/libbassenc_mp3.so':
libbassenc.so: cannot open shared object file: No such file or directory
libbassenc.so: cannot open shared object file: No such file or directory
Native library (home/pi/tempjars/libbassenc_mp3.so) not found in resource path ([file:/home/pi/tempjars/AsyncInput2])
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:137)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
at b4j.example.main.main(main.java:29)
Caused by: java.lang.UnsatisfiedLinkError: Unable to load library '/home/pi/tempjars/libbassenc_mp3.so':
libbassenc.so: cannot open shared object file: No such file or directory
libbassenc.so: cannot open shared object file: No such file or directory
Native library (home/pi/tempjars/libbassenc_mp3.so) not found in resource path ([file:/home/pi/tempjars/AsyncInput2])
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.j
Program terminated (StartMessageLoop was not called).
ava:301)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:461)
at com.sun.jna.Native.register(Native.java:1722)
at com.sun.jna.Native.register(Native.java:1443)
at com.un4seen.bass.BASSenc_MP3.<clinit>(BASSenc_MP3.java:29)
at jbass.JBass.Initialize(JBass.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:676)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:240)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.refle
ct.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
... 3 more
Suppressed: java.lang.UnsatisfiedLinkError: libbassenc.so: cannot open shared object file: No such file or directory
at com.sun.jna.Native.open(Native Method)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:191)
... 20 more
Suppressed: java.lang.UnsatisfiedLinkError: libbassenc.so: cannot open shared object file: No such file or directory
at com.sun.jna.Native.open(Native Method)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:204)
... 20 more
Suppressed: java.io.IOException: Native library (home/pi/tempjars/libbassenc_mp3.so) not found in resource path ([file:/home/pi/tempjars/AsyncInput2])
at com.sun.jna.Native.extractFromResourcePath(Native.java:1095)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:275)
... 20 more



If using latest bass (hardfp), latest bassenc (hardfp), patched with trial bassenc (hardfp), and replaced libbassenc_mp3 from old version (06/11/2018), test app didnt crash
Code: [Select]
Waiting for debugger to connect...
Program started.
OS Name : Linux
OS Architecture : arm
OS Version : 5.10.52-v7+
JVM Name : Java HotSpot(TM) Client VM
Java Lib path : /usr/java/packages/lib/arm:/lib:/usr/lib
Path Separator : [:]
Run Directory : /home/pi/tempjars
User Home : /root
User Directory : /home/pi/tempjars
Raspberry
Copied libbass.so to /home/pi/tempjars
libbass.so copied to /home/pi/tempjars
java.library.path changed from /usr/java/packages/lib/arm:/lib:/usr/lib to /home/pi/tempjars
Copied libbass_fx.so to /home/pi/tempjars
libbass_fx.so copied to /home/pi/tempjars
Copied libbassmix.so to /home/pi/tempjars
libbassmix.so copied to /home/pi/tempjars
Copied libbassenc.so to /home/pi/tempjars
libbassenc.so copied to /home/pi/tempjars
Copied libbassenc_mp3.so to /home/pi/tempjars
libbassenc_mp3.so copied to /home/pi/tempjars
BASS version=2041003
BASS_FX version=2040c01
BASSENC version=2040f03
BASSMIX version=2040a00
BASSENC MP3 version=2040100
index=0, Name=No sound, Driver=, Enabled=true
index=1, Name=Default, Driver=default, Enabled=true
index=2, Name=bcm2835 Headphones: bcm2835 Headphones, Driver=hw:0,0, Enabled=true
Bass inited
Bass Playfile success
Play Start = File = /home/pi/Channel_1_20210819100156.wav, Device=bcm2835 Headphones: bcm2835 Headphones
Play Stop = File = /home/pi/Channel_1_20210819100156.wav, Device=bcm2835 Headphones: bcm2835 Headphones