Android-speech-api + pocketsphinx android cause ERROR_SPEECH_TIMEOUT - pocketsphinx-android

After listening for a keyword (using pocketsphinx) i try to start the google speech recognizer but getting many calls of onRmsChanged() with negative
numbers and than get the ERROR_SPEECH_TIMEOUT.
Code:
PocketSphinxRecognizer.cancel();
GoogleSpeechRecognizer.startListening(SpeechRecognizerIntent);
I tried to run the line:
GoogleSpeechRecognizer.startListening(SpeechRecognizerIntent);
in OnError() if the error is ERROR_SPEECH_TIMEOUT but got no response.
Edit:
10-01 05:45:33.165 1739-2055/? E/dalvikvm: Could not find class 'android.net.ConnectivityManager$NetworkCallback', referenced from method com.google.android.apps.gsa.staticplugins.bc.ak.<init>
10-01 05:45:33.175 1739-2055/? E/dalvikvm: Could not find class 'android.net.NetworkRequest$Builder', referenced from method com.google.android.apps.gsa.staticplugins.bc.ak.jh
10-01 05:45:33.235 1739-2055/? E/dalvikvm: Could not find class 'android.media.AudioAttributes$Builder', referenced from method com.google.android.apps.gsa.speech.audio.c.a.<init>
10-01 05:45:33.260 1739-2055/? E/dalvikvm: Could not find class 'android.media.AudioFormat$Builder', referenced from method com.google.android.apps.gsa.speech.audio.d.a.<init>
10-01 05:45:33.320 1739-2088/? E/GmsClient: unable to connect to service: com.google.android.gms.speech.service.START on com.google.android.gms
10-01 05:45:33.430 1739-2086/? E/dalvikvm: Could not find class 'android.content.pm.LauncherApps', referenced from method com.google.android.apps.gsa.search.shared.multiuser.RemoteWorkDataClient.connect
10-01 05:45:33.650 1938-2108/? E/TinyUCM: modifier doesn't exists any more
10-01 05:45:33.995 2343-2667/? E/Watchdog: !#Sync 6447
10-01 05:45:34.535 1739-2132/? E/dalvikvm: Could not find class 'org.chromium.net.k', referenced from method org.chromium.net.NetworkChangeNotifierAutoDetect.<init>
10-01 05:45:37.280 25379-25379/? E/ctxmgr: [PlaceFenceHelper]NearbyBuffer is null!
10-01 05:45:39.160 1739-2191/? E/native: decoder_endpointer_stream.cc:23 Acoustic ep reader thread failed: *** Error status greco::STREAM_CANCELED: <no msg> ***
10-01 05:45:39.425 1938-2208/? E/AudioResampler: Unsupported sample format, 1 bits, 1 channels
10-01 05:45:39.450 1589-1589/com.example.manuel.lightbulb E/GoogleRecognitionListener: onError:6

Related

Undefined reference to symbol 'pa_context_disconnect#PULSE_0'

I'm using Raspberry pi 4, here I cloned this repo, and after I followed instructions they have given
First I run ./configure without any error
After that I tried to clean
make clean
Then I tried to make
After that I got some error as shown below:
~/qtcam/src $ make
Makefile:1725: warning: overriding recipe for target 'install_itemfolder_01'
Makefile:1716: warning: ignoring old recipe for target 'install_itemfolder_01'
Makefile:1729: warning: overriding recipe for target 'uninstall_itemfolder_01'
Makefile:1720: warning: ignoring old recipe for target 'uninstall_itemfolder_01'
g++ -Wl,-O1 -o Qtcam main.o logger.o about.o cameraproperty.o videostreaming.o uvccamera.o v4l2-api.o seecam_10cug_m.o seecam_10cug_bayer.o seecam_11cug.o seecam_cu50.o seecam_ar0130.o videoencoder.o seecam_cu51.o see3cam_cu130.o h264decoder.o ascella.o seecam_cu30.o see3cam_130.o see3cam_30.o seecam_81.o see3cam_cu135.o see3cam_cu40.o see3cam_cu20.o uvcExtCx3sni.o keyEventReceive.o nilecam20_usb.o nilecam30_usb.o h264camera.o see3cam_cu55.o see3cam_130A.o audioinput.o see3cam_cu38.o alsa.o fscam_cu135.o see3camcu55_mh.o see3cam_20cug.o see3cam_cu22.o see3cam_130d.o see3cam_24cug.o see3cam_cu81.o seecam_cu80.o see3cam_160.o ecam51_usb.o ecam82_usb.o see3cam_cu27.o see3cam_1332.o ecam83_usb.o see3cam_cu1330m.o see3cam_135m.o see3cam_cu136m.o barcode_camera.o qtquick2applicationviewer.o moc_qtquick2applicationviewer.o moc_about.o moc_cameraproperty.o moc_videostreaming.o moc_uvccamera.o moc_seecam_10cug_m.o moc_seecam_10cug_bayer.o moc_seecam_11cug.o moc_seecam_cu80.o moc_seecam_cu50.o moc_seecam_ar0130.o moc_seecam_cu51.o moc_see3cam_cu130.o moc_h264decoder.o moc_ascella.o moc_seecam_cu30.o moc_see3cam_130.o moc_common_enums.o moc_see3cam_30.o moc_seecam_81.o moc_see3cam_cu135.o moc_see3cam_cu40.o moc_see3cam_cu20.o moc_uvcExtCx3sni.o moc_keyEventReceive.o moc_nilecam30_usb.o moc_nilecam20_usb.o moc_h264camera.o moc_see3cam_cu55.o moc_see3cam_130A.o moc_audioinput.o moc_see3cam_cu38.o moc_fscam_cu135.o moc_see3camcu55_mh.o moc_see3cam_20cug.o moc_see3cam_cu22.o moc_see3cam_130d.o moc_see3cam_24cug.o moc_see3cam_cu81.o moc_see3cam_160.o moc_ecam51_usb.o moc_ecam82_usb.o moc_see3cam_cu27.o moc_see3cam_1332.o moc_ecam83_usb.o moc_see3cam_cu1330m.o moc_see3cam_135m.o moc_see3cam_cu136m.o moc_barcode_camera.o /usr/lib/arm-linux-gnueabihf/libQt5Widgets.so /usr/lib/arm-linux-gnueabihf/libQt5Multimedia.so /usr/lib/arm-linux-gnueabihf/libQt5Quick.so /usr/lib/arm-linux-gnueabihf/libQt5Gui.so /usr/lib/arm-linux-gnueabihf/libQt5Concurrent.so /usr/lib/arm-linux-gnueabihf/libQt5QmlModels.so /usr/lib/arm-linux-gnueabihf/libQt5Qml.so /usr/lib/arm-linux-gnueabihf/libQt5Network.so /usr/lib/arm-linux-gnueabihf/libQt5Core.so -lGLESv2 -lpthread -latomic
/usr/bin/ld: audioinput.o: undefined reference to symbol 'pa_context_disconnect##PULSE_0'
/usr/bin/ld: /lib/arm-linux-gnueabihf/libpulse.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:468: Qtcam] Error 1
Can anyone tell me how to solve this error?

MultiDelimiterSerDe setup in Amazon Hive

I'm trying to use a multidelimiter in a table insert for a hive job in emr on amazon aws. As explained in this link. The delimiter for the file is "|".
https://cwiki.apache.org/confluence/display/Hive/MultiDelimitSerDe
However, I ended up having to use...
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.MultiDelimitSerDe'
Instead of the documented...
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.MultiDelimitSerDe'
in order for it to not give me this error.
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Cannot validate serde: org.apache.hadoop.hive.serde2.MultiDelimitSerDe
OK. So when I don't get that error, by adding the .contrib, I get this error which is caused by Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassNotFoundException: Class org.apache.hadoop.hive.contrib.serde2.MultiDelimitSerDe not found
Status: Failed
Vertex failed, vertexName=Map 1, vertexId=vertex_1548264520414_0027_1_00, diagnostics=[Task failed, taskId=task_1548264520414_0027_1_00_000021, diagnostics=[TaskAttempt 0 failed, info=[Error: Error while running task ( failure ) : attempt_1548264520414_0027_1_00_000021_0:java.lang.RuntimeException: java.lang.RuntimeException: Map operator initialization failed
at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:211)
at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.run(TezProcessor.java:168)
at org.apache.tez.runtime.LogicalIOProcessorRuntimeTask.run(LogicalIOProcessorRuntimeTask.java:370)
at org.apache.tez.runtime.task.TaskRunner2Callable$1.run(TaskRunner2Callable.java:73)
at org.apache.tez.runtime.task.TaskRunner2Callable$1.run(TaskRunner2Callable.java:61)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1840)
at org.apache.tez.runtime.task.TaskRunner2Callable.callInternal(TaskRunner2Callable.java:61)
at org.apache.tez.runtime.task.TaskRunner2Callable.callInternal(TaskRunner2Callable.java:37)
at org.apache.tez.common.CallableWithNdc.call(CallableWithNdc.java:36)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: Map operator initialization failed
at org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor.init(MapRecordProcessor.java:354)
at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:184)
... 14 more
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassNotFoundException: Class org.apache.hadoop.hive.contrib.serde2.MultiDelimitSerDe not found
at org.apache.hadoop.hive.ql.exec.MapOperator.getConvertedOI(MapOperator.java:328)
at org.apache.hadoop.hive.ql.exec.MapOperator.setChildren(MapOperator.java:420)
at org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor.init(MapRecordProcessor.java:286)
... 15 more
So I've been reading that you have to add the .jar file.
https://community.hortonworks.com/questions/82189/hive-cannot-see-jar.html
And so I've tried all kinds of things to get this to work. It says that it is adding it it to the class path.
hive> add jar /usr/lib/hive/lib/hive-contrib-2.3.3-amzn-1.jar
> ;
Added [/usr/lib/hive/lib/hive-contrib-2.3.3-amzn-1.jar] to class path
Added resources: [/usr/lib/hive/lib/hive-contrib-2.3.3-amzn-1.jar]
hive> add jar /usr/lib/hive/lib/hive-contrib.jar
> ;
Added [/usr/lib/hive/lib/hive-contrib.jar] to class path
Added resources: [/usr/lib/hive/lib/hive-contrib.jar]
hive> exit;
So I'm not sure what to do. It's acting as if the .jar file for hive-contrib isn't in the class path despite me adding it. I've also tried running...
export HADOOP_USER_CLASSPATH_FIRST=true
which is found here...
How to include jars in Hive (Amazon Hadoop env)
And that doesn't fix it either.
How can I use a multidelimiter SerDe property for a hive job on aws?
Thank you.
I could not get MultiDelimitSerDe to work. Instead, I was lucky in that the delimiter had quotations on either side of the pipe. So it looks like "|". This turns the values between the quotes into strings, so the additional pipes in those column values don't act as delimiters.
"Test | Test2 "|" Test3 | Test 4 | Test 5 "|" Test 6 "
You can see an explanation in the link below. The part that talks about it is in the comments, not the article.
https://www.ericlin.me/2015/07/how-to-create-a-hive-multi-character-delimitered-table/
If I didn't have those quotation marks around the delimiter, I'm not sure how I would have been able to work with a multi delimiter. Especially if I had quotations in any of my fields, but after checking, out of the billions of rows, there is not a single quote.

OpenStreetMap POIs with Nominatim - error

I'm using this tutorial: https://github.com/MKergall/osmbonuspack/wiki/Tutorial_2
I set this Code in my Project:
NominatimPOIProvider poiProvider = new NominatimPOIProvider();
ArrayList<POI> pois = poiProvider.getPOICloseTo(startPoint, "cinema", 50, 0.1);
But I get some Errors:
NominatimPOIProvider (String) in NominatimPOIProvider cannot be applied to ()
and
java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/Request$Builder;
at org.osmdroid.bonuspack.utils.HttpConnection.doGet(HttpConnection.java:65)
at org.osmdroid.bonuspack.utils.BonusPackHelper.requestStringFromUrl(BonusPackHelper.java:70)
at org.osmdroid.bonuspack.location.NominatimPOIProvider.getThem(NominatimPOIProvider.java:83)
at org.osmdroid.bonuspack.location.NominatimPOIProvider.getPOICloseTo(NominatimPOIProvider.java:133)
at x.x.UserArea.onCreate(UserArea.java:152)
at android.app.Activity.performCreate(Activity.java:6876)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3207)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)
at android.app.ActivityThread.access$1100(ActivityThread.java:222)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.Request$Builder"
Error:
NominatimPOIProvider (String) in NominatimPOIProvider cannot be
applied to ()
is caused by an absence of nonparametric constructor for NominatimPOIProvider. You are required to specify user agent which will be used in headers sent to a Nominatim service provider. More details can be found in this issue and in usage policy of openstreetmap.
Use something like:
NominatimPOIProvider poiProvider = new NominatimPOIProvider("YourUserAgentSpecificForYourApplicationOrWhatever");
resolved with:
compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0#aar'
compile 'com.squareup.okhttp3:okhttp:3.2.0'

How to build C++ program with libjpeg library

I'd like to build C++ program with libjpeg library, but when I try to build it, I get errors below.
g++ main.cpp -o main.o
main.cpp:26:22: warning: conversion from string literal to 'char *' is deprecated [- Wdeprecated-writable-strings]
char *filename = "output.jpg";
^
1 warning generated.
Undefined symbols for architecture x86_64:
"_jpeg_CreateCompress", referenced from:
_main in main-sUpMU6.o
"_jpeg_destroy_compress", referenced from:
_main in main-sUpMU6.o
"_jpeg_finish_compress", referenced from:
_main in main-sUpMU6.o
"_jpeg_set_defaults", referenced from:
_main in main-sUpMU6.o
"_jpeg_set_quality", referenced from:
_main in main-sUpMU6.o
"_jpeg_start_compress", referenced from:
_main in main-sUpMU6.o
"_jpeg_std_error", referenced from:
_main in main-sUpMU6.o
"_jpeg_stdio_dest", referenced from:
_main in main-sUpMU6.o
"_jpeg_write_scanlines", referenced from:
_main in main-sUpMU6.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [main.o] Error 1
The structure of my project is like this.
./myCodes
main.h main.cpp Makefile
./jpeg-9
libjpeg src and build outputs
Make file is like this.
ulibjpeg: main.o
g++ -v -L../jpeg-9/cjpeg -L../jpeg-9/djpeg -L../jpeg-9 -l../jpeg-9 -ljpeg main.o -o ulibjpeg
main.o: main.cpp
g++ main.cpp -o main.o
I think I have to add libraries of libjpeg, but which files do I have to add and how can I add add that libraries in g++ options?
Here's the files of ./jpeg-9 directories.
Makefile jccoefct.c jcprepct.lo jdmarker.o jmemmgr.lo makefile.bcc rdjpgcom.1
Makefile.am jccoefct.lo jcprepct.o jdmaster.c jmemmgr.o makefile.dj rdjpgcom.c
Makefile.in jccoefct.o jcsample.c jdmaster.lo jmemname.c makefile.manx rdjpgcom.o
README jccolor.c jcsample.lo jdmaster.o jmemnobs.c makefile.mc6 rdppm.c
aclocal.m4 jccolor.lo jcsample.o jdmerge.c jmemnobs.lo makefile.mms rdppm.o
ar-lib jccolor.o jctrans.c jdmerge.lo jmemnobs.o makefile.sas rdrle.c
cderror.h jcdctmgr.c jctrans.lo jdmerge.o jmemsys.h makefile.unix rdrle.o
cdjpeg.c jcdctmgr.lo jctrans.o jdpostct.c jmorecfg.h makefile.vc rdswitch.c
cdjpeg.h jcdctmgr.o jdapimin.c jdpostct.lo jpegint.h makefile.vms rdswitch.o
cdjpeg.o jchuff.c jdapimin.lo jdpostct.o jpeglib.h makefile.wat rdtarga.c
change.log jchuff.lo jdapimin.o jdsample.c jpegtran makejdep.vc6 rdtarga.o
cjpeg jchuff.o jdapistd.c jdsample.lo jpegtran.1 makejdsp.vc6 stamp-h1
cjpeg.1 jcinit.c jdapistd.lo jdsample.o jpegtran.c makejdsw.vc6 structure.txt
cjpeg.c jcinit.lo jdapistd.o jdtrans.c jpegtran.o makejfil.v10 testimg.bmp
cjpeg.o jcinit.o jdarith.c jdtrans.lo jquant1.c makejmak.vc6 testimg.jpg
ckconfig.c jcmainct.c jdarith.lo jdtrans.o jquant1.lo makejsln.v10 testimg.ppm
coderules.txt jcmainct.lo jdarith.o jerror.c jquant1.o makejvcx.v10 testimgp.jpg
config.guess jcmainct.o jdatadst.c jerror.h jquant2.c makeproj.mac testorig.jpg
config.log jcmarker.c jdatadst.lo jerror.lo jquant2.lo makerdep.vc6 testprog.jpg
config.status jcmarker.lo jdatadst.o jerror.o jquant2.o makerdsp.vc6 transupp.c
config.sub jcmarker.o jdatasrc.c jfdctflt.c jutils.c makerfil.v10 transupp.h
configure jcmaster.c jdatasrc.lo jfdctflt.lo jutils.lo makermak.vc6 transupp.o
configure.ac jcmaster.lo jdatasrc.o jfdctflt.o jutils.o makervcx.v10 usage.txt
depcomp jcmaster.o jdcoefct.c jfdctfst.c jversion.h maketdep.vc6 wizard.txt
djpeg jcomapi.c jdcoefct.lo jfdctfst.lo libjpeg.la maketdsp.vc6 wrbmp.c
djpeg.1 jcomapi.lo jdcoefct.o jfdctfst.o libjpeg.map maketfil.v10 wrbmp.o
djpeg.c jcomapi.o jdcolor.c jfdctint.c libjpeg.txt maketmak.vc6 wrgif.c
djpeg.o jconfig.bcc jdcolor.lo jfdctint.lo libtool maketvcx.v10 wrgif.o
example.c jconfig.cfg jdcolor.o jfdctint.o ltmain.sh makewdep.vc6 wrjpgcom
filelist.txt jconfig.dj jdct.h jidctflt.c makcjpeg.st makewdsp.vc6 wrjpgcom.1
install-sh jconfig.h jddctmgr.c jidctflt.lo makdjpeg.st makewfil.v10 wrjpgcom.c
install.txt jconfig.mac jddctmgr.lo jidctflt.o makeadsw.vc6 makewmak.vc6 wrjpgcom.o
jaricom.c jconfig.manx jddctmgr.o jidctfst.c makeasln.v10 makewvcx.v10 wrppm.c
jaricom.lo jconfig.mc6 jdhuff.c jidctfst.lo makecdep.vc6 makljpeg.st wrppm.o
jaricom.o jconfig.sas jdhuff.lo jidctfst.o makecdsp.vc6 maktjpeg.st wrrle.c
jcapimin.c jconfig.st jdhuff.o jidctint.c makecfil.v10 makvms.opt wrrle.o
jcapimin.lo jconfig.txt jdinput.c jidctint.lo makecmak.vc6 missing wrtarga.c
jcapimin.o jconfig.vc jdinput.lo jidctint.o makecvcx.v10 rdbmp.c wrtarga.o
jcapistd.c jconfig.vms jdinput.o jinclude.h makeddep.vc6 rdbmp.o
jcapistd.lo jconfig.wat jdmainct.c jmemansi.c makeddsp.vc6 rdcolmap.c
jcapistd.o jcparam.c jdmainct.lo jmemdos.c makedfil.v10 rdcolmap.o
jcarith.c jcparam.lo jdmainct.o jmemdosa.asm makedmak.vc6 rdgif.c
jcarith.lo jcparam.o jdmarker.c jmemmac.c makedvcx.v10 rdgif.o
jcarith.o jcprepct.c jdmarker.lo jmemmgr.c makefile.ansi rdjpgcom
I'd like to use the program on multi-platform, so I'd rather not installed libjpeg library.
Use libjpeg in the compile command:
gcc main.c -ljpeg -o main.o
I wrote a tutorial for C: http://www.staerk.de/thorsten/C_Programming_Tutorial

Jni exception ---- Bogus method descriptor?

I try to call a java method in cpp code:
In cpp code:
jclass m_cls = env->FindClass("icm/bdroid/jni/Element");
jmethodID m_mid_addElement = env->GetMethodID(m_cls,"AddElement","(icm/bdroid/jni/Element:)V");
The Java code:
public void AddElement(Element e) {
Get following exception:
12-07 04:21:00.051: W/dalvikvm(31880): Bogus method descriptor:
(icm/bdroid/jni/Element:)V
12-07 04:21:00.051: W/dalvikvm(31880): Bogus method descriptor:
(icm/bdroid/jni/Element:)V
12-07 04:21:00.051: D/dalvikvm(31880): GetMethodID: method not found:
Licm/bdroid/jni/Element;.AddElement:(icm/bdroid/jni/Element:)V
12-07 04:21:00.051: W/dalvikvm(31880): JNI WARNING: JNI method called
with exception raised
12-07 04:21:00.051: W/dalvikvm(31880): in
Licm/bdroid/jni/Jni;.parseScore (J)Licm/bdroid/jni/Element;
(NewObjectV)
I think it should be:
env->GetMethodID(m_cls,"AddElement","(Licm/bdroid/jni/Element;)V");
Check "Type Signatures" section of https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/types.html
L fully-qualified-class ; fully-qualified-class
An easy way to get method signatures is the javap utility:
javap -cp your.jar -s fully.qualified.class.Name