Software Archive
Read-only legacy content

JNI Exception with Java PXCMSpeechRecognition.StartRec

Alessio_Vinerbi
Beginner
982 Views

Hello to all,

I have a problem with speech recognition in Java.

I have successfully created a AudioSource and implementation of PXCMSpeechRecognition but when I try to call the function PXCMSpeechRecognition.StartRec, an exception occurs

java.lang.NoSuchMethodError: OnRecognized 

 

If I try to add a function OnRecognized within my handler works but the callback is invoked only OnAlert

 

Can someone please help me ?

0 Kudos
10 Replies
Xavier_H_Intel
Employee
982 Views

Hi,

Can you give us details about your handler?

Did you get the prototypes like in this example ?

class MyHandler implements PXCMSpeechRecognition::Handler {

   public void OnRecognition(PXCMSpeechRecognition.RecognitionData data) {
       //process data
   }

};

 

0 Kudos
Alessio_Vinerbi
Beginner
982 Views

Thanks Xavier,

Yes, but there is also OnAlert function.

My Handler is 

class MyHandler implements PXCMSpeechRecognition::Handler
{
     public void OnRecognition(PXCMSpeechRecognition.RecognitionData data)
     {
     }

     public void OnAlert(PXCMSpeechRecognition.AlertData data) 
     {
     }
}


/////////////////// and i call StartRec

recognitionEngine.StartRect(source, new MyHandler());

 

When i call StartRec, i have an exception "java.lang.NoSuchMethodError: OnRecognized "

I had a look at the C ++ code, and actually he looks for a function called OnRecognized.

Indeed, if added, only for testing purposes, the function inside my handler:

public void OnRecognized(PXCMSpeechRecognition.RecognitionData data)
{
}

Works but i received only OnAlert callbacks.... 

Obviously the test I did was just to figure out what the problem was...

I hope I was clear and sorry for my English :)

 

Alessio

0 Kudos
Xavier_H_Intel
Employee
982 Views

Thanks for the additional info.

Indeed it seems there is a typo in the c++ wrapper for Java (C:\Program Files (x86)\Intel\RSSDK\framework\common\pxcclr.java\)

While we're fixing it, you can search and replace all occurences of "nRecognized" by "nRecognition" inside pxcmspeechrecognition.cpp, recompile the project and replace libpxcclr.*.dll for your project.

0 Kudos
Alessio_Vinerbi
Beginner
982 Views

Thanks Xavier,

I loaded the project libpxcclr.jni_vs2010 and i have edited the pxcmspeechrecognition.cpp

I have change the line 

AsyncCallback OnRecognizedCb(true, "OnRecognized", "(Lintel/rssdk/PXCMSpeechRecognition$RecognitionData;)V");

with 

AsyncCallback OnRecognizedCb(true, "OnRecognition", "(Lintel/rssdk/PXCMSpeechRecognition$RecognitionData;)V");

And i have recompiled the DLL

Now, there isn't any exception on StartRec but the OnRecognition callback is never invoked.

I have seen that in StartRec function on cpp file use an SRHandler wrapper. This handler call invoke on OnRecognizedCb when an OnRecognition occurs from the recognition engine.

Alessio

 

 

0 Kudos
Xavier_H_Intel
Employee
982 Views

Inside pxcmspeechrecognition.cpp, you need to change the other occurences of nRecognized too, more specifically to rename SRHandler::OnRecognized in SRHandler::OnRecognition

0 Kudos
Alessio_Vinerbi
Beginner
982 Views

 

Xavier thanks for your patience.
I did all the substitutions and no exceptions occur when i call the StartRec

But now, when the in the moment to invoke the OnRecognition, it takes a crash of the virtual machine

I have recompiled the DLL with x64 in release mode. 

Also, I give you another clue, when the ALERT_SPEECH_END alert occurs, application crash with JVM exception

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000007fef7e868d4, pid=3828, tid=5896
#
# JRE version: Java(TM) SE Runtime Environment (8.0_60-b27) (build 1.8.0_60-b27)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.60-b23 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [libpxcclr.jni64.dll+0x68d4]  Registration::~Registration+0x84
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x0000000055e8b000):  VMThread [stack: 0x0000000056ee0000,0x0000000056fe0000] [id=5896]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000000000000b0

Registers:
RAX=0x0000000000000000, RBX=0x000000005b265690, RCX=0x0000000055e8b1f8, RDX=0x0000000058158f08
RSP=0x0000000056fdf260, RBP=0x0000000055d75400, RSI=0x0000000000000000, RDI=0x00000000ffffff01
R8 =0x0000000000000000, R9 =0x0000000000000000, R10=0x0000000056fdf2a8, R11=0x0000000056fdf378
R12=0x00000000003cc5e0, R13=0x0000000000000040, R14=0x00000000003cc650, R15=0x0000000056fdf360
RIP=0x000007fef7e868d4, EFLAGS=0x0000000000010202

Top of Stack: (sp=0x0000000056fdf260)
0x0000000056fdf260:   0000000055d75400 000007fef7f02200
0x0000000056fdf270:   000000005b265690 000000003d00003d
0x0000000056fdf280:   fffffffffffffffe 00000000003cff00
0x0000000056fdf290:   000000005b265690 000007fef7e86790
0x0000000056fdf2a0:   000000005b230640 0000000055e8b1f8
0x0000000056fdf2b0:   000007fef7f02200 00000000003d0dd0
0x0000000056fdf2c0:   000007fef7ed38a0 000007fef7eb7993
0x0000000056fdf2d0:   00000000003cc648 00000000003cc5e0
0x0000000056fdf2e0:   0000000000000200 0000000000000001
0x0000000056fdf2f0:   00000000003cc648 00000000003cc5e0
0x0000000056fdf300:   00000000003cc5e0 00000000003cc650
0x0000000056fdf310:   0000000000000001 0000000000000000
0x0000000056fdf320:   000007fffffae000 000007fffffd7000
0x0000000056fdf330:   0000d4a3df016b4c 000007fef7eb7ea5
0x0000000056fdf340:   0000000000000000 0000000000000001
0x0000000056fdf350:   0000000000000000 0000000056fdf390 

Instructions: (pc=0x000007fef7e868d4)
0x000007fef7e868b4:   24 48 eb 05 48 8b 4c 24 48 83 ff fe 40 0f 94 c7
0x000007fef7e868c4:   48 85 c9 74 31 48 8b 13 48 85 d2 74 12 48 8b 01
0x000007fef7e868d4:   ff 90 b0 00 00 00 90 48 89 33 48 8b 4c 24 48 48
0x000007fef7e868e4:   8b 53 08 48 85 d2 74 0e 48 8b 01 ff 90 b0 00 00 


Register to memory mapping:

RAX=0x0000000000000000 is an unknown value
RBX=0x000000005b265690 is an unknown value
RCX=0x0000000055e8b1f8 is an unknown value
RDX=0x0000000058158f08 is a global jni handle
RSP=0x0000000056fdf260 is an unknown value
RBP=0x0000000055d75400 is an unknown value
RSI=0x0000000000000000 is an unknown value
RDI=0x00000000ffffff01 is an unallocated location in the heap
R8 =0x0000000000000000 is an unknown value
R9 =0x0000000000000000 is an unknown value
R10=0x0000000056fdf2a8 is an unknown value
R11=0x0000000056fdf378 is an unknown value
R12=0x00000000003cc5e0 is an unknown value
R13=0x0000000000000040 is an unknown value
R14=0x00000000003cc650 is an unknown value
R15=0x0000000056fdf360 is an unknown value


Stack: [0x0000000056ee0000,0x0000000056fe0000],  sp=0x0000000056fdf260,  free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libpxcclr.jni64.dll+0x68d4]  Registration::~Registration+0x84
C  [libpxcclr.jni64.dll+0x6790]  AsyncCallback::~AsyncCallback+0x30
C  [libpxcclr.jni64.dll+0x37993]  __crt_seh_guarded_call<int>::operator()<<lambda_e24bbb7b643b32fcea6fa61b31d4c984>,<lambda_275893d493268fdec8709772e3fcec0e> & __ptr64,<lambda_9d71df4d7cf3f480f8d633942495c3b0> >+0x11b
C  [libpxcclr.jni64.dll+0x37ea5]  _execute_onexit_table+0x35
C  [libpxcclr.jni64.dll+0x36aec]  common_exit+0xf4
C  [libpxcclr.jni64.dll+0xfbff]  __scrt_dllmain_uninitialize_c+0x2b
C  [libpxcclr.jni64.dll+0x1015e]  dllmain_crt_process_detach+0x4e
C  [libpxcclr.jni64.dll+0x10267]  dllmain_dispatch+0xd3
C  [ntdll.dll+0x23a81]
C  [ntdll.dll+0x23890]
C  [msvcr100.dll+0x20ccd]
V  [jvm.dll+0x210a25]
V  [jvm.dll+0x249747]
V  [jvm.dll+0x2489e6]
V  [jvm.dll+0x248e81]
V  [jvm.dll+0x24909e]
V  [jvm.dll+0x299f6a]
C  [msvcr100.dll+0x21d9f]
C  [msvcr100.dll+0x21e3b]
C  [kernel32.dll+0x15a4d]
C  [ntdll.dll+0x2b831]

VM_Operation (0x00000000589acbd0): Exit, mode: safepoint, requested by thread 0x0000000058117800


---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x0000000001fbd800 JavaThread "DestroyJavaVM" [_thread_blocked, id=220, stack(0x0000000002100000,0x0000000002200000)]
  0x0000000058117800 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=4340, stack(0x00000000588b0000,0x00000000589b0000)]
  0x00000000580b8000 JavaThread "AWT-Shutdown" [_thread_blocked, id=2232, stack(0x0000000058bf0000,0x0000000058cf0000)]
  0x00000000580b7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=2096, stack(0x0000000058a80000,0x0000000058b80000)]
  0x0000000057984000 JavaThread "Service Thread" daemon [_thread_blocked, id=5544, stack(0x0000000057d80000,0x0000000057e80000)]
  0x000000005790b000 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=5492, stack(0x0000000057700000,0x0000000057800000)]
  0x0000000055ef7800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=5880, stack(0x0000000057480000,0x0000000057580000)]
  0x0000000055eef800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=968, stack(0x0000000057800000,0x0000000057900000)]
  0x0000000055efe000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3368, stack(0x00000000575b0000,0x00000000576b0000)]
  0x0000000055efc800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=5488, stack(0x0000000057330000,0x0000000057430000)]
  0x0000000055e97800 JavaThread "Finalizer" daemon [_thread_blocked, id=3728, stack(0x0000000057060000,0x0000000057160000)]
  0x0000000055e90800 JavaThread "Reference Handler" daemon [_thread_blocked, id=964, stack(0x0000000057190000,0x0000000057290000)]

Other Threads:
=>0x0000000055e8b000 VMThread [stack: 0x0000000056ee0000,0x0000000056fe0000] [id=5896]

VM state:at safepoint (shutting down)

VM Mutex/Monitor currently owned by a thread:  ([mutex/lock_event])
[0x0000000001fbbfa0] Threads_lock - owner thread: 0x0000000055e8b000

Heap:
 PSYoungGen      total 28672K, used 8860K [0x00000000e0180000, 0x00000000e2180000, 0x0000000100000000)
  eden space 24576K, 36% used [0x00000000e0180000,0x00000000e0a271a0,0x00000000e1980000)
  from space 4096K, 0% used [0x00000000e1d80000,0x00000000e1d80000,0x00000000e2180000)
  to   space 4096K, 0% used [0x00000000e1980000,0x00000000e1980000,0x00000000e1d80000)
 ParOldGen       total 65536K, used 0K [0x00000000a0400000, 0x00000000a4400000, 0x00000000e0180000)
  object space 65536K, 0% used [0x00000000a0400000,0x00000000a0400000,0x00000000a4400000)
 Metaspace       used 11180K, capacity 11354K, committed 11648K, reserved 1058816K
  class space    used 1443K, capacity 1541K, committed 1664K, reserved 1048576K

Card table byte_map: [0x0000000011890000,0x0000000011b90000] byte_map_base: 0x000000001138e000

Marking Bits: (ParMarkBitMap*) 0x000000006516a5b0
 Begin Bits: [0x0000000012220000, 0x0000000013a10000)
 End Bits:   [0x0000000013a10000, 0x0000000015200000)

Polling page: 0x0000000000110000

CodeCache: size=245760Kb used=2373Kb max_used=2373Kb free=243386Kb
 bounds [0x00000000024d0000, 0x0000000002740000, 0x00000000114d0000]
 total_blobs=1098 nmethods=604 adapters=408
 compilation: enabled

Compilation events (10 events):
Event: 8.073 Thread 0x000000005790b000  599       3       sun.java2d.loops.RenderCache$Entry::matches (30 bytes)
Event: 8.073 Thread 0x000000005790b000 nmethod 599 0x000000000271ff50 code [0x00000000027200c0, 0x00000000027202f0]
Event: 8.074 Thread 0x000000005790b000  600       3       java.awt.geom.AffineTransform::<init> (69 bytes)
Event: 8.074 Thread 0x000000005790b000 nmethod 600 0x000000000271fb10 code [0x000000000271fc80, 0x000000000271fe90]
Event: 8.074 Thread 0x000000005790b000  601       3       sun.java2d.SurfaceData::getTransparency (8 bytes)
Event: 8.074 Thread 0x000000005790b000 nmethod 601 0x000000000271f650 code [0x000000000271f7c0, 0x000000000271fa68]
Event: 8.190 Thread 0x000000005790b000  602       3       java.lang.Thread::interrupted (8 bytes)
Event: 8.190 Thread 0x000000005790b000 nmethod 602 0x000000000271f290 code [0x000000000271f400, 0x000000000271f588]
Event: 8.208 Thread 0x000000005790b000  603   !   3       java.awt.EventQueue::postEventPrivate (104 bytes)
Event: 8.209 Thread 0x000000005790b000 nmethod 603 0x000000000271e450 code [0x000000000271e660, 0x000000000271eee8]

GC Heap History (0 events):
No events

Deoptimization events (5 events):
Event: 0.410 Thread 0x0000000058117800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x000000000269fc4c method=java.util.HashMap.putVal(ILjava/lang/Object;Ljava/lang/Object;ZZ)Ljava/lang/Object; @ 56
Event: 0.415 Thread 0x0000000058117800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x000000000269fc4c method=java.util.HashMap.putVal(ILjava/lang/Object;Ljava/lang/Object;ZZ)Ljava/lang/Object; @ 56
Event: 0.419 Thread 0x0000000058117800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x000000000269fc4c method=java.util.HashMap.putVal(ILjava/lang/Object;Ljava/lang/Object;ZZ)Ljava/lang/Object; @ 56
Event: 0.445 Thread 0x0000000058117800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x000000000269fc4c method=java.util.HashMap.putVal(ILjava/lang/Object;Ljava/lang/Object;ZZ)Ljava/lang/Object; @ 56
Event: 0.445 Thread 0x0000000058117800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x000000000269eb00 method=java.util.HashMap.putVal(ILjava/lang/Object;Ljava/lang/Object;ZZ)Ljava/lang/Object; @ 56

Internal exceptions (10 events):
Event: 0.295 Thread 0x0000000001fbd800 Exception <a 'java/lang/ClassNotFoundException': ToolBar> (0x00000000e05b2bd0) thrown at
Event: 0.295 Thread 0x0000000001fbd800 Exception <a 'java/lang/ClassNotFoundException': ToggleButton> (0x00000000e05b3180) thrown at
Event: 0.295 Thread 0x0000000001fbd800 Exception <a 'java/lang/ClassNotFoundException': javax/swing/JToolBarSeparator> (0x00000000e05b35e0) thrown at
Event: 0.295 Thread 0x0000000001fbd800 Exception <a 'java/lang/ClassNotFoundException': ToolBarSeparator> (0x00000000e05b3a78) thrown at
Event: 0.296 Thread 0x0000000001fbd800 Exception <a 'java/lang/ClassNotFoundException': ToolTip> (0x00000000e05b41b8) thrown at
Event: 0.296 Thread 0x0000000001fbd800 Exception <a 'java/lang/ClassNotFoundException': Tree> (0x00000000e05b4dd8) thrown at
Event: 0.296 Thread 0x0000000001fbd800 Exception <a 'java/lang/ClassNotFoundException': Tree> (0x00000000e05b5518) thrown at
Event: 0.296 Thread 0x0000000001fbd800 Exception <a 'java/lang/ClassNotFoundException': javax/swing/JTreeCell> (0x00000000e05b5898) thrown at
Event: 0.297 Thread 0x0000000001fbd800 Exception <a 'java/lang/ClassNotFoundException': TreeCell> (0x00000000e05b5d20) thrown at
Event: 0.297 Thread 0x0000000001fbd800 Exception <a 'java/lang/ClassNotFoundException': RootPane> (0x00000000e05b6780) thrown at

Events (10 events):
Event: 8.226 loading class java/awt/LightweightDispatcher$2 done
Event: 9.217 Thread 0x0000000057ce0000 Thread added: 0x0000000057ce0000
Event: 9.217 Thread 0x0000000058422000 Thread added: 0x0000000058422000
Event: 9.217 Thread 0x0000000058422000 Thread exited: 0x0000000058422000
Event: 9.217 Thread 0x00000000581cb800 Thread exited: 0x00000000581cb800
Event: 9.218 loading class sun/java2d/pipe/hw/AccelDeviceEventNotifier
Event: 9.225 loading class sun/java2d/pipe/hw/AccelDeviceEventNotifier done
Event: 9.256 Thread 0x00000000580b9800 Thread exited: 0x00000000580b9800
Event: 9.325 Thread 0x0000000057ce0000 Thread exited: 0x0000000057ce0000
Event: 9.325 Executing VM operation: Exit


Dynamic libraries:
0x000000013f860000 - 0x000000013f897000     C:\Program Files\Java\jdk1.8.0_60\bin\java.exe
0x00000000773d0000 - 0x0000000077579000     C:\Windows\SYSTEM32\ntdll.dll
0x00000000771b0000 - 0x00000000772cf000     C:\Windows\system32\kernel32.dll
0x000007fefd4d0000 - 0x000007fefd53c000     C:\Windows\system32\KERNELBASE.dll
0x000007fefda30000 - 0x000007fefdb0b000     C:\Windows\system32\ADVAPI32.dll
0x000007fefd910000 - 0x000007fefd9af000     C:\Windows\system32\msvcrt.dll
0x000007fefe170000 - 0x000007fefe18f000     C:\Windows\SYSTEM32\sechost.dll
0x000007fefd690000 - 0x000007fefd7bd000     C:\Windows\system32\RPCRT4.dll
0x00000000772d0000 - 0x00000000773ca000     C:\Windows\system32\USER32.dll
0x000007fefe7d0000 - 0x000007fefe837000     C:\Windows\system32\GDI32.dll
0x000007fefdb30000 - 0x000007fefdb3e000     C:\Windows\system32\LPK.dll
0x000007fefd540000 - 0x000007fefd609000     C:\Windows\system32\USP10.dll
0x000007fefbc70000 - 0x000007fefbe64000     C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_fa3b1e3d17594757\COMCTL32.dll
0x000007fefd9b0000 - 0x000007fefda21000     C:\Windows\system32\SHLWAPI.dll
0x000007feff6b0000 - 0x000007feff6de000     C:\Windows\system32\IMM32.DLL
0x000007fefe460000 - 0x000007fefe569000     C:\Windows\system32\MSCTF.dll
0x0000000065630000 - 0x0000000065702000     C:\Program Files\Java\jdk1.8.0_60\jre\bin\msvcr100.dll
0x0000000064960000 - 0x00000000651e9000     C:\Program Files\Java\jdk1.8.0_60\jre\bin\server\jvm.dll
0x000007fef4f80000 - 0x000007fef4f89000     C:\Windows\system32\WSOCK32.dll
0x000007fefd860000 - 0x000007fefd8ad000     C:\Windows\system32\WS2_32.dll
0x000007fefdd20000 - 0x000007fefdd28000     C:\Windows\system32\NSI.dll
0x000007fefa7f0000 - 0x000007fefa82b000     C:\Windows\system32\WINMM.dll
0x000007fefc240000 - 0x000007fefc24c000     C:\Windows\system32\VERSION.dll
0x00000000775a0000 - 0x00000000775a7000     C:\Windows\system32\PSAPI.DLL
0x000000006e130000 - 0x000000006e13f000     C:\Program Files\Java\jdk1.8.0_60\jre\bin\verify.dll
0x0000000065cb0000 - 0x0000000065cd9000     C:\Program Files\Java\jdk1.8.0_60\jre\bin\java.dll
0x0000000065c90000 - 0x0000000065ca6000     C:\Program Files\Java\jdk1.8.0_60\jre\bin\zip.dll
0x000007fefe840000 - 0x000007feff5c9000     C:\Windows\system32\SHELL32.dll
0x000007fefdec0000 - 0x000007fefe0c3000     C:\Windows\system32\ole32.dll
0x000007fefd190000 - 0x000007fefd19f000     C:\Windows\system32\profapi.dll
0x0000000065490000 - 0x0000000065628000     C:\Program Files\Java\jdk1.8.0_60\jre\bin\awt.dll
0x000007feff5d0000 - 0x000007feff6a7000     C:\Windows\system32\OLEAUT32.dll
0x000007fef4530000 - 0x000007fef45af000     C:\Program Files\Common Files\microsoft shared\ink\tiptsf.dll
0x000007fefd020000 - 0x000007fefd02f000     C:\Windows\system32\CRYPTBASE.dll
0x000007fefb160000 - 0x000007fefb178000     C:\Windows\system32\DWMAPI.DLL
0x0000000064910000 - 0x0000000064957000     C:\Program Files\Java\jdk1.8.0_60\jre\bin\fontmanager.dll
0x000007fefdb40000 - 0x000007fefdd17000     C:\Windows\system32\SETUPAPI.dll
0x000007fefd430000 - 0x000007fefd466000     C:\Windows\system32\CFGMGR32.dll
0x000007fefd480000 - 0x000007fefd49a000     C:\Windows\system32\DEVOBJ.dll
0x0000000180000000 - 0x000000018013a000     C:\Program Files (x86)\NVIDIA Corporation\3D Vision\nvSCPAPI64.dll
0x0000000065c70000 - 0x0000000065c8a000     C:\Program Files\Java\jdk1.8.0_60\jre\bin\net.dll
0x000007fefc900000 - 0x000007fefc955000     C:\Windows\system32\mswsock.dll
0x000007fefcb50000 - 0x000007fefcb57000     C:\Windows\System32\wship6.dll
0x0000000065c50000 - 0x0000000065c61000     C:\Program Files\Java\jdk1.8.0_60\jre\bin\nio.dll
0x00000000648c0000 - 0x0000000064902000     C:\Program Files\Java\jdk1.8.0_60\jre\bin\t2k.dll
0x000007fef7e80000 - 0x000007fef7f0d000     C:\Users\touch\Desktop\RealSenseSpeech\libpxcclr.jni64.dll
0x000007fef7190000 - 0x000007fef7193000     C:\Windows\system32\api-ms-win-core-synch-l1-2-0.DLL
0x000007fef9c20000 - 0x000007fef9cd8000     C:\Program Files\Common Files\Intel\RSSDK\v6\bin\x64\libpxcsession.dll
0x000007fef7e20000 - 0x000007fef7e72000     C:\Program Files\Common Files\Intel\RSSDK\v6\bin\x64\tbb.dll
0x000007fef3dc0000 - 0x000007fef3e67000     C:\Windows\system32\MSVCP110.dll
0x000007fef3e70000 - 0x000007fef3f44000     C:\Windows\system32\MSVCR110.dll
0x000007fef0700000 - 0x000007fef08e2000     C:\Program Files\Common Files\Intel\RSSDK\v6\bin\x64\libpxccore.dll
0x000007fefcf90000 - 0x000007fefcfb5000     C:\Windows\system32\SspiCli.dll
0x000007fef51e0000 - 0x000007fef52e1000     C:\Program Files\Common Files\Intel\RSSDK\v6\bin\x64\intel-ias2.dll
0x000007fef7dd0000 - 0x000007fef7e1a000     C:\Program Files\Common Files\Intel\RSSDK\v6\bin\x64\libpxclanternrock.dll
0x000007fef50f0000 - 0x000007fef51d4000     C:\Program Files\Common Files\Intel\RSSDK\v6\bin\x64\libpxcpipelineutils.dll
0x000007fef7b10000 - 0x000007fef7b67000     C:\Program Files\Common Files\Intel\RSSDK\v6\bin\x64\libpxcmfaudio.dll
0x000007feec180000 - 0x000007feec571000     C:\Windows\system32\MF.dll
0x000007fefa650000 - 0x000007fefa669000     C:\Windows\system32\ATL.DLL
0x000007fef5020000 - 0x000007fef508d000     C:\Windows\system32\MFPlat.DLL
0x000007fefb060000 - 0x000007fefb069000     C:\Windows\system32\AVRT.dll
0x00000000748a0000 - 0x00000000748a6000     C:\Windows\system32\ksuser.dll
0x000007fef9b50000 - 0x000007fef9b92000     C:\Windows\system32\MFReadWrite.dll
0x000007fefe0d0000 - 0x000007fefe169000     C:\Windows\system32\CLBCatQ.DLL
0x000007fefb2b0000 - 0x000007fefb2fb000     C:\Windows\System32\MMDevApi.dll
0x000007fefb180000 - 0x000007fefb2ac000     C:\Windows\System32\PROPSYS.dll
0x000007fefa4d0000 - 0x000007fefa51f000     C:\Windows\system32\AUDIOSES.DLL
0x000007feef9e0000 - 0x000007feefa63000     C:\Program Files\Common Files\Intel\RSSDK\v6\bin\x64\libpxcvoice_nuance.dll
0x000007fefcb70000 - 0x000007fefcb88000     C:\Windows\system32\CRYPTSP.dll
0x000007fefc650000 - 0x000007fefc697000     C:\Windows\system32\rsaenh.dll
0x000007fefd0d0000 - 0x000007fefd0e4000     C:\Windows\system32\RpcRtRemote.dll
0x000007fefd030000 - 0x000007fefd0c1000     C:\Windows\system32\SXS.DLL
0x000007fefaa20000 - 0x000007fefaa74000     C:\Windows\system32\oleacc.dll
0x0000000064890000 - 0x00000000648ba000     C:\Program Files\Java\jdk1.8.0_60\jre\bin\dcpr.dll
0x000007fef50b0000 - 0x000007fef50eb000     C:\Windows\System32\resampledmo.dll
0x000007feeee40000 - 0x000007feeee4d000     C:\Windows\System32\msdmo.dll
0x000007fefd270000 - 0x000007fefd2ab000     C:\Windows\system32\WINTRUST.dll
0x000007fefd2b0000 - 0x000007fefd41d000     C:\Windows\system32\CRYPT32.dll
0x000007fefd180000 - 0x000007fefd18f000     C:\Windows\system32\MSASN1.dll
0x000007fefbaa0000 - 0x000007fefbbc5000     C:\Windows\system32\dbghelp.dll

VM Arguments:
jvm_args: -Dfile.encoding=UTF-8 
java_command: MainFrame
java_class_path (initial): C:\Users\touch\Desktop\RealSenseSpeech\libpxcclr.java.jar;C:\Users\touch\Desktop\RealSenseSpeech\build\classes
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\ffmpeg\bin;C:\Windows\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\
USERNAME=touch
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 26 Stepping 5, GenuineIntel

 

---------------  S Y S T E M  ---------------

OS: Windows 7 , 64 bit Build 7601 (6.1.7601.18939)

CPU:total 4 (4 cores per cpu, 2 threads per core) family 6 model 26 stepping 5, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, ht, tsc, tscinvbit, tscinv

Memory: 4k page, physical 6274276k(3083164k free), swap 12546712k(8511496k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (25.60-b23) for windows-amd64 JRE (1.8.0_60-b27), built on Aug  4 2015 11:06:27 by "java_re" with MS VC++ 10.0 (VS2010)

time: Wed Oct 07 17:38:55 2015
elapsed time: 10 seconds (0d 0h 0m 10s)

 

 

 

0 Kudos
Alessio_Vinerbi
Beginner
982 Views

Hello Xavier,
I went ahead in the debug and I think I've found the cause.
Once made all substitutions (OnRecognized -> OnRecognition) the JVM crashed during the call to the callback OnRecognition

From my analysis it seems that the problem is the function Marshal :: initialize

When the function analyzes the fields of RecognitionData struct, tries to retrieve fieldID (fid) but  the JNI GetFieldID fails when it encounters the field "Results" why can not encode the type ([Lintel/rssdk/PXCMSpeechRecognition$NBest;)

The function returns a FID equals 0 and print 

intel/rssdk/PXCMSpeechRecognition$RecognitionData.GetFieldID(results,[Lintel/rssdk/PXCMSpeechRecognition$NBest;) not found

The crash happens during the actual copy Marshal :: why can not retrieve the array without a valid FID

In the Copy_s function of Marshal class at the end there is a switch :

jobject field=jni->GetObjectField(jdata,st->fields.fid);  // FID = 0
...
...
case 'L':
                    for (int j=0;j<st->fields.e_num;j++,offset+=st->fields.e_size) {
                        jobject element=jni->GetObjectArrayElement((jobjectArray)field,j);
                        Copy_s(jni,st->fields.element,element,offset, csize - st->fields.offset);
                    }
                }
...
...

the function GetObjectArrayElement crash with field named "Results" (Array of NBest[]) because  st->fields.fid = 0 and field object is incorrect

I hope it can be of help my little analysis.

Anyway I will go on with the analysis

Alessio

0 Kudos
Alessio_Vinerbi
Beginner
982 Views

Hello Xavier, I'm your nightmare :)

I have some good news,

In the previous post I told you that, during initialization of the function copy_s, was not recognized the variable "scores"  (NBest [4]) of RecognitionData struct

The reason is that the field names of NBest array differ between the Marshal :: Struct and structure RecognitionData 

// Marshal::Field

static Marshal::Field PXCMSpeechRecognition_RecognitionData_fields[]={
	   {"timeStamp", offsetof(PXCSpeechRecognition::RecognitionData,timeStamp),"J"},
	   {"grammar", offsetof(PXCSpeechRecognition::RecognitionData,grammar),"I"},
	   {"duration", offsetof(PXCSpeechRecognition::RecognitionData,duration),"I"},
	   {"scores", offsetof(PXCSpeechRecognition::RecognitionData, scores), "[Lintel/rssdk/PXCMSpeechRecognition$NBest;", sizeof(PXCSpeechRecognition::NBest), 4, &PXCMSpeechRecognition_NBest},
	  {0},
};


// RecognitionData struct

    struct RecognitionData {
        pxcI64  timeStamp;               
        pxcUID  grammar;           
        pxcI32  duration;                
        NBest   results[NBEST_SIZE]; 
        pxcI32  reserved[16];         
    };

What I did was to realign the names using "scores"

Now I went over,

Now it is properly recognized the array NBest but inside the function copy_s fails to pull the single element from the array NBest

In Marshal.cpp : 155

case '[':
            {   
                jobject field=jni->GetObjectField(jdata,st->fields.fid);
				 
                switch (st->fields.sig[1]) {
                case 'I':
                case 'F':
                    Copy(jni,offset,st->fields.e_size,st->fields.e_num,(jarray)field);
                    break;
                case 'L':
                    for (int j=0;j<st->fields.e_num;j++,offset+=st->fields.e_size) {
                        jobject element=jni->GetObjectArrayElement((jobjectArray)field,j);
                        Copy_s(jni,st->fields.element,offset,element, csize - st->fields.offset);
                    }
                }
            }
            break;
        }

When he meets the array "scores" the loop executes but GetObjectArrayElement function returns a null value (0x0)
and the recursive call to copy_sfunction is not executed 

Do you have any idea ?
Meanwhile, I try to solve it.

Thanks,

Alessio

0 Kudos
anton_f_
Beginner
982 Views

Thanks Alessio and Xavier!

Initializing the "scores" array with NBest() objects in class intel.rssdk.PXCMSpeechRecognition finally works for me.

    public static class RecognitionData {
        public long     timeStamp;	 /** The time stamp of the recognition, in 100ns. */
		public int      grammar;	 /** The grammar identifier for command and control, or zero for dictation. */
        public int      duration;	 /** The duration of the speech, in ms. */
		public NBest[] 	scores;      /** @size = NBEST_SIZE; The top-N recognition results for command and control. */        

        public RecognitionData()
        {
            scores = new NBest[NBEST_SIZE];   
            for(int i=0; i<scores.length; i++){
            	scores=new NBest();
            }
        }
    };

 

Best,

Anton

 

 

0 Kudos
Dat_N_
Beginner
982 Views

Hi All,

I got this error today and so lucky, I fixed it.

Error: intel/rssdk/PXCMSpeechRecognition$RecognitionData.GetFieldID(results,[Lintel/rssdk/PXCMSpeechRecognition$NBest;) not found

SDK: Build Number: 10.0.26.0396 (1.8GB)
         Version: 2016 R2

Solution:

PXCMSpeechRecognition.java, change this

    public static class RecognitionData {
        public long     timeStamp;	 /** The time stamp of the recognition, in 100ns. */
		public int      grammar;	 /** The grammar identifier for command and control, or zero for dictation. */
        public int      duration;	 /** The duration of the speech, in ms. */
		public NBest[] 	scores;      /** @size = NBEST_SIZE; The top-N recognition results for command and control. */        

        public RecognitionData()
        {
            scores = new NBest[NBEST_SIZE];            
        }
    };

 to this:

public static class RecognitionData {
    public long     timeStamp;   /** The time stamp of the recognition, in 100ns. */
    public int      grammar;     /** The grammar identifier for command and control, or zero for dictation. */
    public int      duration;    /** The duration of the speech, in ms. */
    public NBest[]  scores;      /** @size = NBEST_SIZE; The top-N recognition results for command and control. */       
    public RecognitionData()
    {
        scores = new NBest[NBEST_SIZE];  
        for(int i=0; i<scores.length; i++){
            scores=new NBest();
        }
    }
};

pxcmspeechrecognition.cpp,

from 

static Marshal::Field PXCMSpeechRecognition_RecognitionData_fields[]={
	{"timeStamp", offsetof(PXCSpeechRecognition::RecognitionData,timeStamp),"J"},
	{"grammar", offsetof(PXCSpeechRecognition::RecognitionData,grammar),"I"},
	{"duration", offsetof(PXCSpeechRecognition::RecognitionData,duration),"I"},
	{"results", offsetof(PXCSpeechRecognition::RecognitionData, scores), "[Lintel/rssdk/PXCMSpeechRecognition$NBest;", sizeof(PXCSpeechRecognition::NBest), 4, &PXCMSpeechRecognition_NBest},
	{0},
};

to

static Marshal::Field PXCMSpeechRecognition_RecognitionData_fields[]={
	{"timeStamp", offsetof(PXCSpeechRecognition::RecognitionData,timeStamp),"J"},
	{"grammar", offsetof(PXCSpeechRecognition::RecognitionData,grammar),"I"},
	{"duration", offsetof(PXCSpeechRecognition::RecognitionData,duration),"I"},
	{"scores", offsetof(PXCSpeechRecognition::RecognitionData, scores), "[Lintel/rssdk/PXCMSpeechRecognition$NBest;", sizeof(PXCSpeechRecognition::NBest), 4, &PXCMSpeechRecognition_NBest},
	{0},
};

Thanks you,

Dat Nguyen.

0 Kudos
Reply