serial in Android crash in most chips

Report any Hollywood bugs here
Post Reply
plouf
Posts: 462
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

serial in Android crash in most chips

Post by plouf »

Hi

Serial port under android crash app using any chip but FTDI as long as you READ data
safe to write in pl2303 / ch340 / mcp221 / ftdi

but as long as you read it crash, app is offcourse safe working under windows

test app, i use it to comment out read/write for testing
OpenSerialPort(1, "COM5")
byte=65
Repeat
;FlushSerialPort(1)
Wait(25)
serdata$, coount =ReadSerialData(1, 1,100)
Print(serdata$)
Print(",")

;FlushSerialPort(1)
Wait(25)
WriteSerialData(1,ByteChr(byte),100)
byte=byte+1
If byte=91
byte=64
EndIf
Print("("..StrStr(byte)..")")
Forever
Christos
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: serial in Android crash in most chips

Post by airsoftsoftwair »

What's the debug output after the crash (from adb logcat)?
plouf
Posts: 462
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: serial in Android crash in most chips

Post by plouf »

how can i get this ?

i try opening adb logcat, activating option in android
but command "adb logcat" runs forever throwing data on screen, so i guess this is live debugging
Christos
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: serial in Android crash in most chips

Post by airsoftsoftwair »

You need to add a filter that logcat so that it only shows Hollywood's debug output, e.g. something like:

Code: Select all

./adb logcat -s Hollywood
plouf
Posts: 462
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: serial in Android crash in most chips

Post by plouf »

crashes and working
D:\Android\Android_SDK_data\platform-tools>adb logcat -s Hollywood
--------- beginning of crash
--------- beginning of system
--------- beginning of main
09-30 21:01:11.684 28501 28501 V Hollywood: Device: daisy_sprout
09-30 21:01:11.684 28501 28501 V Hollywood: Model: Mi A2 Lite
09-30 21:01:11.684 28501 28501 V Hollywood: onCreate()
09-30 21:01:11.789 28501 28501 I Hollywood: nativeSetupJNI()
09-30 21:01:11.796 28501 28501 V Hollywood: onStart()
09-30 21:01:11.797 28501 28501 I Hollywood: nativeStart()
09-30 21:01:11.798 28501 28501 V Hollywood: onResume()
09-30 21:01:11.835 28501 28501 V Hollywood: onWindowFocusChanged(): true
09-30 21:01:11.841 28501 28540 I Hollywood: Got device parameters: 1080 2043 258
1
09-30 21:01:11.842 28501 28540 I Hollywood: HollywoodPlayer 8.0 [Android] [64-bi
t] (c) by Andreas Falkenhahn
09-30 21:01:11.842 28501 28540 I Hollywood: The Cross-Platform Multimedia Applic
ation Layer
09-30 21:01:11.842 28501 28540 I Hollywood:
09-30 21:01:11.851 28501 28540 I Hollywood: Loading applet serial-test.hwa...
09-30 21:01:11.853 28501 28540 I Hollywood: done
09-30 21:01:11.864 28501 28540 I Hollywood: Preparing display...
09-30 21:01:11.868 28501 28540 I Hollywood: done
09-30 21:01:11.868 28501 28540 I Hollywood: And Action!
09-30 21:01:11.868 28501 28540 I Hollywood:
09-30 21:01:11.890 28501 28501 V Hollywood: onPrepareOptionsMenu()
09-30 21:01:11.909 28501 28501 V Hollywood: surfaceCreated()
09-30 21:01:11.909 28501 28501 V Hollywood: surfaceChanged()
09-30 21:01:11.909 28501 28501 V Hollywood: Got new surface size: 1080x1875
09-30 21:01:11.910 28501 28501 I Hollywood: onNativeSurfaceChanged()
09-30 21:01:11.910 28501 28501 I Hollywood: onNativeSurfaceChanged() out
09-30 21:01:11.910 28501 28540 I Hollywood: Got size: 1080 1875 (1)
09-30 21:01:11.910 28501 28540 I Hollywood: First call. Need to allocate rendere
r!
09-30 21:01:11.910 28501 28540 I Hollywood: Allocating surface for: 640 480 -- 1
080 1875
09-30 21:01:11.911 28501 28540 V Hollywood: getNativeSurface(): Surface(name=nul
l)/@0xda2d35b
09-30 21:01:11.996 28501 28501 V Hollywood: onPause()
09-30 21:01:11.996 28501 28501 I Hollywood: nativePause()
09-30 21:01:12.010 28501 28501 V Hollywood: onWindowFocusChanged(): false
09-30 21:01:13.347 28501 28501 V Hollywood: onWindowFocusChanged(): true
09-30 21:01:13.385 28501 28501 V Hollywood: onResume()
09-30 21:01:15.862 28501 28501 V Hollywood: onWindowFocusChanged(): false

=-=-=-=-=-=-MCP2221_FAIL=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

09-30 21:02:57.931 28641 28641 V Hollywood: Device: daisy_sprout
09-30 21:02:57.931 28641 28641 V Hollywood: Model: Mi A2 Lite
09-30 21:02:57.931 28641 28641 V Hollywood: onCreate()
09-30 21:02:57.936 28641 28641 I Hollywood: nativeSetupJNI()
09-30 21:02:57.944 28641 28641 V Hollywood: onStart()
09-30 21:02:57.945 28641 28641 I Hollywood: nativeStart()
09-30 21:02:57.952 28641 28641 V Hollywood: onResume()
09-30 21:02:58.000 28641 28641 V Hollywood: onWindowFocusChanged(): true
09-30 21:02:58.005 28641 28671 I Hollywood: Got device parameters: 1080 2043 258
1
09-30 21:02:58.007 28641 28671 I Hollywood: HollywoodPlayer 8.0 [Android] [64-bi
t] (c) by Andreas Falkenhahn
09-30 21:02:58.007 28641 28671 I Hollywood: The Cross-Platform Multimedia Applic
ation Layer
09-30 21:02:58.007 28641 28671 I Hollywood:
09-30 21:02:58.016 28641 28671 I Hollywood: Loading applet serial-test.hwa...
09-30 21:02:58.018 28641 28671 I Hollywood: done
09-30 21:02:58.021 28641 28671 I Hollywood: Preparing display...
09-30 21:02:58.024 28641 28671 I Hollywood: done
09-30 21:02:58.024 28641 28671 I Hollywood: And Action!
09-30 21:02:58.024 28641 28671 I Hollywood:
09-30 21:02:58.051 28641 28641 V Hollywood: onPrepareOptionsMenu()
09-30 21:02:58.059 28641 28641 V Hollywood: surfaceCreated()
09-30 21:02:58.059 28641 28641 V Hollywood: surfaceChanged()
09-30 21:02:58.059 28641 28641 V Hollywood: Got new surface size: 1080x1875
09-30 21:02:58.060 28641 28641 I Hollywood: onNativeSurfaceChanged()
09-30 21:02:58.060 28641 28641 I Hollywood: onNativeSurfaceChanged() out
09-30 21:02:58.061 28641 28671 I Hollywood: Got size: 1080 1875 (1)
09-30 21:02:58.061 28641 28671 I Hollywood: First call. Need to allocate rendere
r!
09-30 21:02:58.061 28641 28671 I Hollywood: Allocating surface for: 640 480 -- 1
080 1875
09-30 21:02:58.061 28641 28671 V Hollywood: getNativeSurface(): Surface(name=nul
l)/@0xc7c926a
09-30 21:02:58.121 28641 28641 V Hollywood: onPause()
09-30 21:02:58.121 28641 28641 I Hollywood: nativePause()
09-30 21:02:58.136 28641 28641 V Hollywood: onWindowFocusChanged(): false
09-30 21:02:59.597 28641 28641 V Hollywood: onResume()
09-30 21:02:59.634 28641 28641 V Hollywood: onWindowFocusChanged(): true

=-=-=-=-=-=-CH340_FAIL=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

09-30 21:08:45.717 29097 29097 V Hollywood: Device: daisy_sprout
09-30 21:08:45.717 29097 29097 V Hollywood: Model: Mi A2 Lite
09-30 21:08:45.717 29097 29097 V Hollywood: onCreate()
09-30 21:08:45.723 29097 29097 I Hollywood: nativeSetupJNI()
09-30 21:08:45.728 29097 29097 V Hollywood: onStart()
09-30 21:08:45.729 29097 29097 I Hollywood: nativeStart()
09-30 21:08:45.730 29097 29097 V Hollywood: onResume()
09-30 21:08:45.783 29097 29097 V Hollywood: onWindowFocusChanged(): true
09-30 21:08:45.788 29097 29131 I Hollywood: Got device parameters: 1080 2043 258
1
09-30 21:08:45.791 29097 29131 I Hollywood: HollywoodPlayer 8.0 [Android] [64-bi
t] (c) by Andreas Falkenhahn
09-30 21:08:45.791 29097 29131 I Hollywood: The Cross-Platform Multimedia Applic
ation Layer
09-30 21:08:45.791 29097 29131 I Hollywood:
09-30 21:08:45.803 29097 29131 I Hollywood: Loading applet serial-test.hwa...
09-30 21:08:45.804 29097 29131 I Hollywood: done
09-30 21:08:45.806 29097 29131 I Hollywood: Preparing display...
09-30 21:08:45.809 29097 29131 I Hollywood: done
09-30 21:08:45.809 29097 29131 I Hollywood: And Action!
09-30 21:08:45.809 29097 29131 I Hollywood:
09-30 21:08:45.831 29097 29097 V Hollywood: onPrepareOptionsMenu()
09-30 21:08:45.839 29097 29097 V Hollywood: surfaceCreated()
09-30 21:08:45.839 29097 29097 V Hollywood: surfaceChanged()
09-30 21:08:45.839 29097 29097 V Hollywood: Got new surface size: 1080x1875
09-30 21:08:45.839 29097 29097 I Hollywood: onNativeSurfaceChanged()
09-30 21:08:45.840 29097 29097 I Hollywood: onNativeSurfaceChanged() out
09-30 21:08:45.840 29097 29131 I Hollywood: Got size: 1080 1875 (1)
09-30 21:08:45.840 29097 29131 I Hollywood: First call. Need to allocate rendere
r!
09-30 21:08:45.840 29097 29131 I Hollywood: Allocating surface for: 640 480 -- 1
080 1875
09-30 21:08:45.840 29097 29131 V Hollywood: getNativeSurface(): Surface(name=nul
l)/@0xc7c926a
09-30 21:08:45.892 29097 29097 V Hollywood: onPause()
09-30 21:08:45.893 29097 29097 I Hollywood: nativePause()
09-30 21:08:45.905 29097 29097 V Hollywood: onWindowFocusChanged(): false
09-30 21:08:48.074 29097 29097 V Hollywood: onWindowFocusChanged(): true
09-30 21:08:48.110 29097 29097 V Hollywood: onResume()
09-30 21:08:53.225 29097 29097 V Hollywood: onPrepareOptionsMenu()
09-30 21:08:53.385 29097 29097 V Hollywood: onWindowFocusChanged(): false
09-30 21:08:54.235 29097 29097 V Hollywood: onOptionsItemSelected()
09-30 21:08:54.248 29097 29097 V Hollywood: onPrepareOptionsMenu()
09-30 21:08:54.272 29097 29097 V Hollywood: onWindowFocusChanged(): true
09-30 21:08:54.314 29097 29097 V Hollywood: surfaceChanged()
09-30 21:08:54.314 29097 29097 V Hollywood: Got new surface size: 1080x2043
09-30 21:08:54.316 29097 29097 I Hollywood: onNativeSurfaceChanged()
09-30 21:08:54.316 29097 29097 I Hollywood: onNativeSurfaceChanged() out
09-30 21:08:54.355 29097 29131 I Hollywood: Got size: 1080 2043 (1)
09-30 21:08:54.355 29097 29131 I Hollywood: We already have a renderer -- dimens
ions have probably changed!
09-30 21:08:56.367 29097 29097 V Hollywood: onPause()
09-30 21:08:56.368 29097 29097 I Hollywood: nativePause()
09-30 21:08:56.374 29097 29097 V Hollywood: onWindowFocusChanged(): false
09-30 21:08:56.766 29097 29097 V Hollywood: surfaceDestroyed()
09-30 21:08:56.776 29097 29097 I Hollywood: onNativeSurfaceDestroyed()
09-30 21:08:56.777 29097 29097 I Hollywood: onNativeSurfaceDestroyed() out
09-30 21:08:56.793 29097 29097 V Hollywood: onStop()
09-30 21:08:56.793 29097 29097 I Hollywood: nativeStop()
09-30 21:08:57.107 29097 29097 V Hollywood: onDestroy()
09-30 21:08:57.121 29097 29097 V Hollywood: Finished waiting for Hollywood threa
d
09-30 21:08:57.123 29097 29097 I Hollywood: nativeCleanupJNI()

=-=-=-=-=-=-FTDI_Working=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Christos
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: serial in Android crash in most chips

Post by airsoftsoftwair »

I don't see anything unusual there. How does it crash? Does it lock up, close or does Android show some error dialog?
plouf
Posts: 462
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: serial in Android crash in most chips

Post by plouf »

app (screen ) either close and disappear , and desktop show up
or rarely (depended in code in hollywood app i guess) just remain black showing no data

(it should normally shows numbering by example app like ,(2),(3) ...)
Christos
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: serial in Android crash in most chips

Post by airsoftsoftwair »

Ok, this is fixed now. The timeout value is the culprit. If you set that to 0, there should be no more crashes but of course it will block everything until data arrives. In the next version the timeout value will work correctly on Android too.

Code: Select all

- Fix [Android]: Passing a timeout value different than 0 to ReadSerialData() usually crashed Hollywood
Post Reply