Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with android 6.0 #7

Open
dieg013 opened this issue Dec 21, 2015 · 26 comments
Open

Bug with android 6.0 #7

dieg013 opened this issue Dec 21, 2015 · 26 comments

Comments

@dieg013
Copy link

dieg013 commented Dec 21, 2015

Hello, I have a bug with the module can not start the player version 1.7.1 android 6.0 module and Nexus 5,

SDK 5.1.1GA

Thank

@blantonl
Copy link

I'm also seeing this issue

@karaoak
Copy link

karaoak commented Feb 16, 2016

This is because the lib/arm/libaacdecoder.so: has text relocations

It's fixed for the aacdecoder
tarigo/aacdecoder-android@7e08f00

I will try to compile and use the newly compiled aacdecoder lib .so's for this module.

@karaoak
Copy link

karaoak commented Feb 17, 2016

I compiled the accdecoder and included it in the 1.7.1 version of the module.
Unfortunately I got the following exception:

INFO] Decoder: start() starting native decoder - OpenCORE-MP3
[INFO] art: art/runtime/thread.cc:1336] No pending exception expected: java.lang.NoSuchMethodError: no non-static method "Lcom/spoledge/aacdecoder/Decoder$Info;.next()Lcom/spoledge/aacdecoder/BufferReader$Buffer;"
[INFO] art: art/runtime/thread.cc:1336] at int com.spoledge.aacdecoder.Decoder.nativeStart(int, com.spoledge.aacdecoder.BufferReader, com.spoledge.aacdecoder.Decoder$Info) (Decoder.java:-2)

Alternatively I found this thread: vbartacek/aacdecoder-android#76
With a link to a android.zip with new compiled accdecoder libs fixing text relocations issues, preventing the lib to run on Android 6.0 Marshmellow.

I updated the libs in the 1.7.1 version of Trevor's module. Everything works now!

@AppWerft
Copy link

@karaoak Hi Frank, awesome work!
in my app after starting of streamer the app goes slowdown. The memory runs between
to limits and this is undepending of player. Any ideas? Similar experiences?

Di you have merged this: 9331c4f ?
I have now switched to Marshmellow and used your v1.7.3 . After starting of streamer comes this error on console:
Error starting stream: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/de.appwerft.dlrmediathek-1/base.apk"],nativeLibraryDirectories=[/data/app/de.appwerft.dlrmediathek-1/lib/arm, /data/app/de.appwerft.dlrmediathek-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn't find "libaacdecoder.so"

==>> what I have to do with this android.zip?

PS last week I was in Amsterdam @TitaniumMeetup. Did we meet us?

@karaoak
Copy link

karaoak commented Feb 19, 2016

@AppWerft Hi Rainer, yes we've seen each other. At least I noticed you as our German guest, already for the second time!

I do not have any issues with a slow performance with this module.
I forked this reposository and created a new dist, however, right now I'm using the 1.7.1 version. I'm not sure whether the PR you mention is already in this version.

@AppWerft
Copy link

@karaok: what is with missing 'libaacdecoder.so'? How can I compile myself (with this patch)?

@karaoak
Copy link

karaoak commented Feb 19, 2016

@AppWerft You don't need to recompile, just copy over the the files from the linked android.zip to the correct module folders.

Or use below zip of the module I use (1.7.1 + updated aacdecoder libs).

com.woohoo.androidaudiostreamer.zip

@AppWerft
Copy link

Oh, it works! Thanks add 1 point to @karaoak .
But I think the PR is missing - I cannot switch the url. It was the sense of patch. I will build a 1.7.4 version with the patch and the copied aacdecoder.so.

@karaoak
Copy link

karaoak commented Feb 19, 2016

Ah, okay, then we have to recompile.
I have to go pick my daughter now, I can try to build a new version of a fork this weekend with the new aacdecoder libs. Will keep you posted.

karaoak added a commit to karaoak/ti-android-streamer that referenced this issue Feb 19, 2016
Unfortunately I got the following exception:

INFO] Decoder: start() starting native decoder - OpenCORE-MP3
[INFO] art: art/runtime/thread.cc:1336] No pending exception expected: java.lang.NoSuchMethodError: no non-static method "Lcom/spoledge/aacdecoder/Decoder$Info;.next()Lcom/spoledge/aacdecoder/BufferReader$Buffer;"
[INFO] art: art/runtime/thread.cc:1336] at int com.spoledge.aacdecoder.Decoder.nativeStart(int, com.spoledge.aacdecoder.BufferReader, com.spoledge.aacdecoder.Decoder$Info) (Decoder.java:-2)

Alternatively I found this thread: vbartacek/aacdecoder-android#76
With a link to a android.zip with new compiled accdecoder libs fixing text relocations issues, preventing the lib to run on Android 6.0 Marshmellow.

I updated the libs in the 1.7.1 version of Trevor's module. Everything works now!
@AppWerft
Copy link

Now it seems to work, I will check. In my radio I observe the network connectivity and try automaticly to reconnect. I have still the issue with slowdown. It is crazy! It only happens if I start the audiostreamer in my app. It also happens if I comment out all action depending of 'change' and 'metadata' event.

@karaoak
Copy link

karaoak commented Feb 19, 2016

I compiled a new version (1.7.3) compiled with Ti SDK 5.2.0.v20160216073819 / Android API 23 / NDK r10e / Google API 23.

You can download it as a zip: com.woohoo.androidaudiostreamer-android-1.7.3.zip

@dieg013
Copy link
Author

dieg013 commented Feb 20, 2016

@karaoak Hello,I tried your module version 1.7.3 but it still does the log here.

Thank !

02-20 09:15:35.814 30649-30678/? E/linker: /data/app/com.myapp-1/lib/arm/libaacdecoder.so: has text relocations 02-20 09:15:35.814 199-815/? D/audio_hw_primary: enable_audio_route: apply and update mixer path: low-latency-playback 02-20 09:15:35.814 30649-30678/? E/AAS: Error starting stream: java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.myapp-1/lib/arm/libaacdecoder.so: has text relocations

@dieg013
Copy link
Author

dieg013 commented Feb 20, 2016

@karaoak Your module (1.7.1 + updated aacdecoder libs) it's Good Thank !!!!

@AppWerft
Copy link

@karaoak Hi Frank, I have still the problem with frozen UI. If I never start the audiostreamer then the app run forever. If I start the streamer then after a couple of minutes the UI becomes tough and gets slower. The radio runs without problems. The system (bottom navigationbar) works without problems. Any ideas where I can looking for? I have comment out all streamer listeners -- no success.

@karaoak
Copy link

karaoak commented Feb 22, 2016

@AppWerft Hi Rainer, what do you use as your android:targetSdkVersion?

@AppWerft
Copy link

@karaoak I'm using version 23. At weekend I built a javascript wrapper to control the module. All problems keep inside, only 3 functions: https://github.com/AppWerft/DLRmediathek/blob/master/Resources/controls/audiostreamer.adapter.js With this module it works very well.

Last problem: if the smartphone goes offline and the net comes back we cannot restart. I think this snippet https://github.com/trevorf/ti-android-streamer/blob/master/src/com/woohoo/androidaudiostreamer/AndroidaudiostreamerModule.java#L124-L127 is evil. Only onCreate the code is running and after net interruption the streamhandler is broken. The command play() is without effect and never comes an event. Ideas?

@karaoak
Copy link

karaoak commented Feb 22, 2016

I already had similar code like your adapter code in my apps. I do not experience the 'last problem' you describe. (not yet, that is... :~)
I'll give it a test later this week. But I think, my app code might also handles this. I'll keep you posted.

@AppWerft
Copy link

Maybe you are solved the issue. My observation:

  1. streamer is playing (every second comes an event PLAYING)
  2. I kill the internet ;-)
  3. after a time the streamer fires STOPPED
  4. switching on the internet
  5. try to start
  6. on adb console I see:
    E/AAS (13906): Player was currently playing
    This text comes from by patch: https://github.com/AppWerft/ti-android-streamer/blob/master/src/com/woohoo/androidaudiostreamer/AndroidaudiostreamerModule.java#L187
    After disconnecting and connecting of net the variable 'isCurrentlyPlaying' has wrong state.

It is impossible to restart.

@AppWerft
Copy link

Now I found a solution.
After loosing of net the isCurrentlyPlaying is in wrong state. To fix it I'm hooking the change::STOPPED event. If the state is offline, the the status is not wanted and I call .stop() and all is fine. Now I can restart after the net comes back.

@blantonl
Copy link

Do you have a patch submitted for this yet? I think i've seen a lot of
crash bugs reported for this exact same scenario.

Lindsay C. Blanton III
CEO - RadioReference.com / Broadcastify
Mobile: +1 210-593-8685
Email: lindsay@radioreference.com

On Mon, Feb 22, 2016 at 9:38 AM, Rainer Schleevoigt <
notifications@github.com> wrote:

Now I found a solution.
After loosing of net the isCurrentlyPlaying is in wrong state. To fix it
I'm hooking the change::STOPPED event. If the state is offline, the the
status is not wanted and I call .stop() and all is fine. Now I can restart
after the net comes back.


Reply to this email directly or view it on GitHub
#7 (comment)
.

@AppWerft
Copy link

AppWerft commented Feb 23, 2016

@blantonl I wrote a wrapper. This module handles the issue. Here is it: https://github.com/AppWerft/DLRmediathek/blob/master/Resources/controls/audiostreamer.adapter.js#L73-L77
The marked lines show the trick.

next time I will send a PR. This could avoid JS stuff to fix it.

@AppWerft
Copy link

AppWerft commented Mar 2, 2016

Now I see an issue with charsets. Partly senders use LATIN1 instead UTF8. This part https://github.com/vbartacek/aacdecoder-android/blob/master/decoder/src/com/spoledge/aacdecoder/IcyInputStream.java#L98-L112 allowes to set a second parameter (charset).

@AppWerft
Copy link

AppWerft commented Apr 23, 2016

I solved the issue with charset. Here the new code:

@Kroll.method
    public void play(String url, @Kroll.argument(optional=true) String charset) {
        if (charset == null)
            charset = "UTF-8";
        if (!isCurrentlyPlaying) {
            try {
                if (aacPlayer == null) {
                    aacPlayer = new MultiPlayer(clb);
                }
                currentUrl = url;
                currentCharset = charset;
                aacPlayer.playAsync(url);
                aacPlayer.setMetadataCharEnc(charset);

                isCurrentlyPlaying = true;
            } catch (Throwable t) {
                Log.e(LOG, "Error starting stream: " + t);
            }
        } else {
            Log.e(LOG, "Player was currently playing");
        }
    }

Edit: for this I have made a PR

@willsazon
Copy link

@AppWerft I did not understand the use of your code.
How do I check if the network crashed and came back to restart my player?

@AppWerft
Copy link

My comment is one year old. Please gibe me time to figure out …

@willsazon
Copy link

@AppWerft thanks for answering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants