[Q] BluetoothSocket_MTK error on ICS - Android Q&A, Help & Troubleshooting

I was able to easily connect/disconnect and receive from my bluetooth remote device with my android phone running ICS (4.0.4).
Recently, somehow, my app doesn't work anymore.
There's no error, just no data is sent or received, because there's no socket created in connection.
My first guess is my hardware, but it's not.
I tried my basic bluetooth connection apps and they won't work neither.
Here is the logcat :
Code:
01-05 22:04:42.576: D/bluetooth2(5316): ...Connecting...
01-05 22:04:42.576: I/BluetoothSocket_MTK(5316): [JSR82] connect: do SDP
01-05 22:04:42.577: I/BluetoothSocket_MTK(5316): [JSR82] close
01-05 22:04:42.577: I/BluetoothSocket_MTK(5316): [JSR82] readLock got.
01-05 22:04:42.577: I/BluetoothSocket_MTK(5316): [JSR82] Start to aquire writeLock.
01-05 22:04:42.577: I/BluetoothSocket_MTK(5316): [JSR82] writeLock got.
01-05 22:04:42.578: D/bluetooth2(5316): ...Create Socket...
01-05 22:04:42.584: D/dalvikvm(5316): threadid=14: interp stack at 0x4d1b5000
01-05 22:04:42.587: D/dalvikvm(5316): threadid=14 (Thread-371): calling run()
01-05 22:04:42.594: D/Buffer read(5316): ...[[email protected]
01-05 22:04:42.594: D/dalvikvm(5316): threadid=14: exiting
01-05 22:04:42.594: D/dalvikvm(5316): threadid=14: bye!
01-05 22:04:42.594: D/dalvikvm(5316): threadid=0: freeing
01-05 22:04:43.135: I/BluetoothSocket_MTK(5316): [JSR82] SdpHelper::onRfcommChannelFound: channel=-1
01-05 22:04:43.135: I/BluetoothSocket_MTK(5316): [JSR82] close
01-05 22:04:43.135: I/BluetoothSocket_MTK(5316): [JSR82] readLock got.
01-05 22:04:43.135: D/bluetooth2(5316): ...Create Socket...
01-05 22:04:43.138: D/dalvikvm(5316): threadid=14: interp stack at 0x4d1b5000
01-05 22:04:43.138: D/dalvikvm(5316): threadid=14 (Thread-372): calling run()
01-05 22:04:43.138: D/Buffer read(5316): ...[[email protected]
01-05 22:04:43.138: D/dalvikvm(5316): threadid=14: exiting
01-05 22:04:43.138: D/dalvikvm(5316): threadid=14: bye!
01-05 22:04:43.138: D/dalvikvm(5316): threadid=0: freeing
01-05 22:04:43.149: I/BluetoothSocket_MTK(5316): [JSR82] close
01-05 22:04:43.149: I/BluetoothSocket_MTK(5316): [JSR82] readLock got.
01-05 22:04:46.149: I/BluetoothSocket_MTK(5316): [JSR82] Bluetooth Socket Constructor
01-05 22:04:46.150: I/BluetoothSocket_MTK(5316): [JSR82] type=1 fd=-1 auth=false encrypt=false port=-1
I use this UUID
Code:
// SPP UUID service
private static final UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
My snippet bluetooth connection
Code:
private BluetoothSocket createBluetoothSocket(BluetoothDevice device) throws IOException {
if(Build.VERSION.SDK_INT >= 10){
try {
final Method m = device.getClass().getMethod("createInsecureRfcommSocketToServiceRecord", new Class[] { UUID.class });
return (BluetoothSocket) m.invoke(device, MY_UUID);
} catch (Exception e) {
Log.e(TAG, "Could not create Insecure RFComm Connection",e);
}
}
return device.createRfcommSocketToServiceRecord(MY_UUID);
}
public void bluetoothDisconnect(){
try {
btSocket.close();
} catch (IOException e2) {
errorExit("Fatal Error", "In onPause() and failed to close socket." + e2.getMessage() + ".");
}
}
public void bluetoothConnect(){
BluetoothDevice device = btAdapter.getRemoteDevice(address);
try {
btSocket = createBluetoothSocket(device);
} catch (IOException e) {
errorExit("Fatal Error", "In onResume() and socket create failed: " + e.getMessage() + ".");
}
btAdapter.cancelDiscovery();
Log.d(TAG, "...Connecting...");
try {
btSocket.connect();
Log.d(TAG, "....Connection ok...");
} catch (IOException e) {
try {
btSocket.close();
} catch (IOException e2) {
errorExit("Fatal Error", "In onResume() and unable to close socket during connection failure" + e2.getMessage() + ".");
}
}
// Create a data stream so we can talk to server.
Log.d(TAG, "...Create Socket...");
mConnectedThread = new ConnectedThread(btSocket);
mConnectedThread.start();
}
I guess there's no socket created, but I don't know why. It was fine before for a month.
Some people also have this similar issue. I have tried several solution there but zero result.
Any idea would be appreciate

Hello,
I am also facing this issue.Have you found a solution to this Pl help.
oneitusatu said:
I was able to easily connect/disconnect and receive from my bluetooth remote device with my android phone running ICS (4.0.4).
Recently, somehow, my app doesn't work anymore.
There's no error, just no data is sent or received, because there's no socket created in connection.
My first guess is my hardware, but it's not.
I tried my basic bluetooth connection apps and they won't work neither.
Here is the logcat :
Code:
01-05 22:04:42.576: D/bluetooth2(5316): ...Connecting...
01-05 22:04:42.576: I/BluetoothSocket_MTK(5316): [JSR82] connect: do SDP
01-05 22:04:42.577: I/BluetoothSocket_MTK(5316): [JSR82] close
01-05 22:04:42.577: I/BluetoothSocket_MTK(5316): [JSR82] readLock got.
01-05 22:04:42.577: I/BluetoothSocket_MTK(5316): [JSR82] Start to aquire writeLock.
01-05 22:04:42.577: I/BluetoothSocket_MTK(5316): [JSR82] writeLock got.
01-05 22:04:42.578: D/bluetooth2(5316): ...Create Socket...
01-05 22:04:42.584: D/dalvikvm(5316): threadid=14: interp stack at 0x4d1b5000
01-05 22:04:42.587: D/dalvikvm(5316): threadid=14 (Thread-371): calling run()
01-05 22:04:42.594: D/Buffer read(5316): ...[[email protected]
01-05 22:04:42.594: D/dalvikvm(5316): threadid=14: exiting
01-05 22:04:42.594: D/dalvikvm(5316): threadid=14: bye!
01-05 22:04:42.594: D/dalvikvm(5316): threadid=0: freeing
01-05 22:04:43.135: I/BluetoothSocket_MTK(5316): [JSR82] SdpHelper::onRfcommChannelFound: channel=-1
01-05 22:04:43.135: I/BluetoothSocket_MTK(5316): [JSR82] close
01-05 22:04:43.135: I/BluetoothSocket_MTK(5316): [JSR82] readLock got.
01-05 22:04:43.135: D/bluetooth2(5316): ...Create Socket...
01-05 22:04:43.138: D/dalvikvm(5316): threadid=14: interp stack at 0x4d1b5000
01-05 22:04:43.138: D/dalvikvm(5316): threadid=14 (Thread-372): calling run()
01-05 22:04:43.138: D/Buffer read(5316): ...[[email protected]
01-05 22:04:43.138: D/dalvikvm(5316): threadid=14: exiting
01-05 22:04:43.138: D/dalvikvm(5316): threadid=14: bye!
01-05 22:04:43.138: D/dalvikvm(5316): threadid=0: freeing
01-05 22:04:43.149: I/BluetoothSocket_MTK(5316): [JSR82] close
01-05 22:04:43.149: I/BluetoothSocket_MTK(5316): [JSR82] readLock got.
01-05 22:04:46.149: I/BluetoothSocket_MTK(5316): [JSR82] Bluetooth Socket Constructor
01-05 22:04:46.150: I/BluetoothSocket_MTK(5316): [JSR82] type=1 fd=-1 auth=false encrypt=false port=-1
I use this UUID
Code:
// SPP UUID service
private static final UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
My snippet bluetooth connection
Code:
private BluetoothSocket createBluetoothSocket(BluetoothDevice device) throws IOException {
if(Build.VERSION.SDK_INT >= 10){
try {
final Method m = device.getClass().getMethod("createInsecureRfcommSocketToServiceRecord", new Class[] { UUID.class });
return (BluetoothSocket) m.invoke(device, MY_UUID);
} catch (Exception e) {
Log.e(TAG, "Could not create Insecure RFComm Connection",e);
}
}
return device.createRfcommSocketToServiceRecord(MY_UUID);
}
public void bluetoothDisconnect(){
try {
btSocket.close();
} catch (IOException e2) {
errorExit("Fatal Error", "In onPause() and failed to close socket." + e2.getMessage() + ".");
}
}
public void bluetoothConnect(){
BluetoothDevice device = btAdapter.getRemoteDevice(address);
try {
btSocket = createBluetoothSocket(device);
} catch (IOException e) {
errorExit("Fatal Error", "In onResume() and socket create failed: " + e.getMessage() + ".");
}
btAdapter.cancelDiscovery();
Log.d(TAG, "...Connecting...");
try {
btSocket.connect();
Log.d(TAG, "....Connection ok...");
} catch (IOException e) {
try {
btSocket.close();
} catch (IOException e2) {
errorExit("Fatal Error", "In onResume() and unable to close socket during connection failure" + e2.getMessage() + ".");
}
}
// Create a data stream so we can talk to server.
Log.d(TAG, "...Create Socket...");
mConnectedThread = new ConnectedThread(btSocket);
mConnectedThread.start();
}
I guess there's no socket created, but I don't know why. It was fine before for a month.
Some people also have this similar issue. I have tried several solution there but zero result.
Any idea would be appreciate
Click to expand...
Click to collapse

Related

Unable to instantiate activity

Hello guys. So i'm trying to make a app that will play a aac stream from an online radio station. I managed to build the project but i get this error when running it.
Code:
05-27 06:12:00.734: E/AndroidRuntime(450): FATAL EXCEPTION: main
05-27 06:12:00.734: E/AndroidRuntime(450): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.spoledge.aacplay/com.spoledge.aacplay.AACPlayerActivity}: java.lang.ClassNotFoundException: com.spoledge.aacplay.AACPlayerActivity in loader dalvik.system.PathClassLoader[/data/app/com.spoledge.aacplay-2.apk]
05-27 06:12:00.734: E/AndroidRuntime(450): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
05-27 06:12:00.734: E/AndroidRuntime(450): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
05-27 06:12:00.734: E/AndroidRuntime(450): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
05-27 06:12:00.734: E/AndroidRuntime(450): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
05-27 06:12:00.734: E/AndroidRuntime(450): at android.os.Handler.dispatchMessage(Handler.java:99)
05-27 06:12:00.734: E/AndroidRuntime(450): at android.os.Looper.loop(Looper.java:123)
05-27 06:12:00.734: E/AndroidRuntime(450): at android.app.ActivityThread.main(ActivityThread.java:3683)
05-27 06:12:00.734: E/AndroidRuntime(450): at java.lang.reflect.Method.invokeNative(Native Method)
05-27 06:12:00.734: E/AndroidRuntime(450): at java.lang.reflect.Method.invoke(Method.java:507)
05-27 06:12:00.734: E/AndroidRuntime(450): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-27 06:12:00.734: E/AndroidRuntime(450): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-27 06:12:00.734: E/AndroidRuntime(450): at dalvik.system.NativeStart.main(Native Method)
05-27 06:12:00.734: E/AndroidRuntime(450): Caused by: java.lang.ClassNotFoundException: com.spoledge.aacplay.AACPlayerActivity in loader dalvik.system.PathClassLoader[/data/app/com.spoledge.aacplay-2.apk]
05-27 06:12:00.734: E/AndroidRuntime(450): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
05-27 06:12:00.734: E/AndroidRuntime(450): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
05-27 06:12:00.734: E/AndroidRuntime(450): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
05-27 06:12:00.734: E/AndroidRuntime(450): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
05-27 06:12:00.734: E/AndroidRuntime(450): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
05-27 06:12:00.734: E/AndroidRuntime(450): ... 11 more
This is my project AACPlayerActivity.java code:
Code:
package com.spoledge.aacplay;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.spoledge.aacdecoder.AACPlayer;
import com.spoledge.aacdecoder.PlayerCallback;
/**
* This is the main activity.
*/
public class AACPlayerActivity extends Activity implements View.OnClickListener, PlayerCallback {
private History history;
private AutoCompleteTextView urlView;
private Button btnPlay;
private Button btnStop;
private TextView txtStatus;
private EditText txtBufAudio;
private EditText txtBufDecode;
private ProgressBar progress;
private Handler uiHandler;
private AACPlayer aacPlayer;
////////////////////////////////////////////////////////////////////////////
// PlayerCallback
////////////////////////////////////////////////////////////////////////////
private boolean playerStarted;
public void playerStarted() {
uiHandler.post( new Runnable() {
public void run() {
txtBufAudio.setEnabled( false );
txtBufDecode.setEnabled( false );
btnPlay.setEnabled( false );
btnStop.setEnabled( true );
txtStatus.setText( R.string.text_buffering );
progress.setProgress( 0 );
progress.setVisibility( View.VISIBLE );
playerStarted = true;
}
});
}
/**
* This method is called periodically by PCMFeed.
*
* @param isPlaying false means that the PCM data are being buffered,
* but the audio is not playing yet
*
* @param audioBufferSizeMs the buffered audio data expressed in milliseconds of playing
* @param audioBufferCapacityMs the total capacity of audio buffer expressed in milliseconds of playing
*/
public void playerPCMFeedBuffer( final boolean isPlaying,
final int audioBufferSizeMs, final int audioBufferCapacityMs ) {
uiHandler.post( new Runnable() {
public void run() {
progress.setProgress( audioBufferSizeMs * progress.getMax() / audioBufferCapacityMs );
if (isPlaying) txtStatus.setText( R.string.text_playing );
}
});
}
public void playerStopped( final int perf ) {
uiHandler.post( new Runnable() {
public void run() {
btnPlay.setEnabled( true );
btnStop.setEnabled( false );
txtBufAudio.setEnabled( true );
txtBufDecode.setEnabled( true );
// txtStatus.setText( R.string.text_stopped );
txtStatus.setText( "" + perf + " %" );
progress.setVisibility( View.INVISIBLE );
playerStarted = false;
}
});
}
public void playerException( final Throwable t) {
uiHandler.post( new Runnable() {
public void run() {
new AlertDialog.Builder( AACPlayerActivity.this )
.setTitle( R.string.text_exception )
.setMessage( t.toString())
.setNeutralButton( R.string.button_close,
new DialogInterface.OnClickListener() {
public void onClick( DialogInterface dialog, int id) {
dialog.cancel();
}
}
)
.show();
txtStatus.setText( R.string.text_stopped );
if (playerStarted) playerStopped( 0 );
}
});
}
////////////////////////////////////////////////////////////////////////////
// OnClickListener
////////////////////////////////////////////////////////////////////////////
/**
* Called when a view has been clicked.
*/
public void onClick( View v ) {
try {
switch (v.getId()) {
case R.id.view_main_button_play: start(); break;
case R.id.view_main_button_stop: stop(); break;
}
}
catch (Exception e) {
Log.e( "AACPlayerActivity", "exc" , e );
}
}
////////////////////////////////////////////////////////////////////////////
// Protected
////////////////////////////////////////////////////////////////////////////
@Override
protected void onCreate( Bundle savedInstanceState ) {
super.onCreate( savedInstanceState );
setContentView( R.layout.main );
btnPlay = (Button) findViewById( R.id.view_main_button_play );
btnStop = (Button) findViewById( R.id.view_main_button_stop );
urlView = (AutoCompleteTextView) findViewById( R.id.view_main_edit_url );
txtStatus = (TextView) findViewById( R.id.view_main_text_status );
txtBufAudio = (EditText) findViewById( R.id.view_main_text_bufaudio );
txtBufDecode = (EditText) findViewById( R.id.view_main_text_bufdecode );
progress = (ProgressBar) findViewById( R.id.view_main_progress );
txtBufAudio.setText( String.valueOf( AACPlayer.DEFAULT_AUDIO_BUFFER_CAPACITY_MS ));
txtBufDecode.setText( String.valueOf( AACPlayer.DEFAULT_DECODE_BUFFER_CAPACITY_MS ));
btnPlay.setOnClickListener( this );
btnStop.setOnClickListener( this );
history = new History( this );
history.read();
if (history.size() == 0 ) {
history.addUrl( "/sdcard/local/cro2-32.aac" );
history.addUrl( "netshow.play.cz:8000/crocb32aac" );
history.addUrl( "62.44.1.26:8000/cro2-128aac" );
history.addUrl( "2483.live.streamtheworld.com:80/KFTZFMAACCMP3" );
history.addUrl( "yourmuze.com:8000/play/paradise/l.aac" );
history.addUrl( "yourmuze.com:8000/play/paradise/m.aac" );
history.addUrl( "yourmuze.com:8000/play/paradise/h.aac" );
}
urlView.setAdapter( history.getArrayAdapter());
uiHandler = new Handler();
}
@Override
protected void onPause() {
super.onPause();
history.write();
}
@Override
protected void onDestroy() {
super.onDestroy();
stop();
}
////////////////////////////////////////////////////////////////////////////
// Private
////////////////////////////////////////////////////////////////////////////
private void start() {
stop();
aacPlayer = new AACPlayer( this, getInt( txtBufAudio ), getInt( txtBufDecode ));
aacPlayer.playAsync( getUrl());
}
private void stop() {
if (aacPlayer != null) {
aacPlayer.stop();
aacPlayer = null;
}
}
private String getUrl() {
String ret = urlView.getText().toString();
history.addUrl( ret );
return ret;
}
private int getInt( EditText et ) {
return Integer.parseInt( et.getText().toString());
}
}
And this is my AndroidManifest.xml:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="schemas.android.com/apk/res/android"
package="com.spoledge.aacplay"
android:versionCode="1"
android:versionName="@string/app_version"
>
<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk android:minSdkVersion="10"/>
<application
android:label="@string/app_name"
android:debuggable="true"
>
<activity
android:name="com.spoledge.aacplay.AACPlayerActivity"
android:label="@string/app_name"
android:launchMode="singleTask"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
So can someone help me solve this out? Thanks!
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums & Read the Forum Rules
Moving to Q&A
Here is your problem:
05-27 06:12:00.734: E/AndroidRuntime(450): Caused by: java.lang.ClassNotFoundException: com.spoledge.aacplay.AACPlayerActivity in loader dalvik.system.PathClassLoader[/data/app/com.spoledge.aacplay-2.apk]
Click to expand...
Click to collapse
are you using any external libraries?
are they exactly in libs directory in your project?

Android External UVC camera issue /dev/video0 can't open resource busy..

Hello,
I have been struggling with an issue related to v4l enabling in Android Kernel. Please suggest me appropriate place to post my question i found this email for contacting on linux-media website. I am trying to connect external UVC camera with android device.
What i have done so far , I enabled v4l configuration in kernel and i do see in log UVC driver get loaded after enabling as well as video_device_register return 0 and picked up video node 0. But what is the problem is when i application trying to access /dev/video0 it always shows device busy can not open.
I have tried all permutation combination by assigning 0666 permission in init.rc , init.<board>.rc or uevetd.<board>.rc .
But no luck please guide me how can i do it ? I am trying with Logitech C270 webcam and it does support v4l.
Kernel is 3.0.31 and Device is Galaxy Nexus
Thank you
kill $( lsof |grep /dev/video|awk '{print $2}')
kill $( lsof |grep /dev/video*|awk '{print $2}')
---------- Post added at 04:29 PM ---------- Previous post was at 04:16 PM ----------
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <getopt.h> /* getopt_long() */
#include <fcntl.h> /* low-level i/o */
#include <unistd.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <linux/videodev2.h>
#define CLEAR(x) memset(&(x), 0, sizeof(x))
enum io_method {
IO_METHOD_READ,
IO_METHOD_MMAP,
IO_METHOD_USERPTR,
};
struct buffer {
void *start;
size_t length;
};
static char *dev_name;
static enum io_method io = IO_METHOD_MMAP;
static int fd = -1;
struct buffer *buffers;
static unsigned int n_buffers;
static int out_buf;
static int force_format;
static int frame_count = 70;
static void errno_exit(const char *s)
{
fprintf(stderr, "43 %s error %d, %s\n", s, errno, strerror(errno));
exit(EXIT_FAILURE);
}
static int xioctl(int fh, int request, void *arg)
{
int r;
do {
r = ioctl(fh, request, arg);
} while (-1 == r && EINTR == errno);
return r;
}
//process_image(数据指针,大小)
static void process_image(const void *p, int size)
{
if (out_buf)
fwrite(p, size, 1, stdout);
fflush(stderr);
fprintf(stderr, ".");
fflush(stdout);
}
static int read_frame(void)
{
struct v4l2_buffer buf;
unsigned int i;
switch (io) {
case IO_METHOD_READ:
if (-1 == read(fd, buffers[0].start, buffers[0].length)) {
switch (errno) {
case EAGAIN:
return 0;
case EIO:
/* Could ignore EIO, see spec. */
/* fall through */
default:
errno_exit("read");
}
}
process_image(buffers[0].start, buffers[0].length);
break;
case IO_METHOD_MMAP:
CLEAR(buf);
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
if (-1 == xioctl(fd, VIDIOC_DQBUF, &buf)) {
switch (errno) {
case EAGAIN:
return 0;
case EIO:
/* Could ignore EIO, see spec. */
/* fall through */
default:
errno_exit("VIDIOC_DQBUF");
}
}
assert(buf.index < n_buffers);
process_image(buffers[buf.index].start, buf.bytesused);
if (-1 == xioctl(fd, VIDIOC_QBUF, &buf))
errno_exit("VIDIOC_QBUF");
break;
case IO_METHOD_USERPTR:
CLEAR(buf);
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_USERPTR;
if (-1 == xioctl(fd, VIDIOC_DQBUF, &buf)) {
switch (errno) {
case EAGAIN:
return 0;
case EIO:
/* Could ignore EIO, see spec. */
/* fall through */
default:
errno_exit("VIDIOC_DQBUF");
}
}
for (i = 0; i < n_buffers; ++i)
if (buf.m.userptr == (unsigned long)buffers.start
&& buf.length == buffers.length)
break;
assert(i < n_buffers);
process_image((void *)buf.m.userptr, buf.bytesused);
if (-1 == xioctl(fd, VIDIOC_QBUF, &buf))
errno_exit("VIDIOC_QBUF");
break;
}
return 1;
}
static void mainloop(void)
{
unsigned int count;
count = frame_count;
while (count-- > 0) {
for (; {
fd_set fds;
struct timeval tv;
int r;
FD_ZERO(&fds);
FD_SET(fd, &fds);
/* Timeout. */
tv.tv_sec = 2;
tv.tv_usec = 0;
r = select(fd + 1, &fds, NULL, NULL, &tv);
if (-1 == r) {
if (EINTR == errno)
continue;
errno_exit("select");
}
if (0 == r) {
fprintf(stderr, "190 select timeout\n");
exit(EXIT_FAILURE);
}
if (read_frame())
break;
/* EAGAIN - continue select loop. */
}
}
}
//VIDIOC_STREAMOFF
static void stop_capturing(void)
{
enum v4l2_buf_type type;
switch (io) {
case IO_METHOD_READ:
/* Nothing to do. */
break;
case IO_METHOD_MMAP:
case IO_METHOD_USERPTR:
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (-1 == xioctl(fd, VIDIOC_STREAMOFF, &type))
errno_exit("VIDIOC_STREAMOFF");
break;
}
}
//VIDIOC_STREAMON
static void start_capturing(void)
{
unsigned int i;
enum v4l2_buf_type type;
switch (io) {
case IO_METHOD_READ:
/* Nothing to do. */
break;
case IO_METHOD_MMAP:
for (i = 0; i < n_buffers; ++i) {
struct v4l2_buffer buf;
CLEAR(buf);
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
buf.index = i;
if (-1 == xioctl(fd, VIDIOC_QBUF, &buf))
errno_exit("VIDIOC_QBUF");
}
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (-1 == xioctl(fd, VIDIOC_STREAMON, &type))
errno_exit("VIDIOC_STREAMON");
break;
case IO_METHOD_USERPTR:
for (i = 0; i < n_buffers; ++i) {
struct v4l2_buffer buf;
CLEAR(buf);
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_USERPTR;
buf.index = i;
buf.m.userptr = (unsigned long)buffers.start;
buf.length = buffers.length;
if (-1 == xioctl(fd, VIDIOC_QBUF, &buf))
errno_exit("VIDIOC_QBUF");
}
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (-1 == xioctl(fd, VIDIOC_STREAMON, &type))
errno_exit("VIDIOC_STREAMON");
break;
}
}
//释放申请的内存
static void uninit_device(void)
{
unsigned int i;
switch (io) {
case IO_METHOD_READ:
free(buffers[0].start);
break;
case IO_METHOD_MMAP:
for (i = 0; i < n_buffers; ++i)
if (-1 == munmap(buffers.start, buffers.length))
errno_exit("munmap");
break;
case IO_METHOD_USERPTR:
for (i = 0; i < n_buffers; ++i)
free(buffers.start);
break;
}
free(buffers);
}
static void init_read(unsigned int buffer_size)
{
buffers = calloc(1, sizeof(*buffers));
if (!buffers) {
fprintf(stderr, "302 Out of memory\n");
exit(EXIT_FAILURE);
}
buffers[0].length = buffer_size;
buffers[0].start = malloc(buffer_size);
if (!buffers[0].start) {
fprintf(stderr, "310 Out of memory\n");
exit(EXIT_FAILURE);
}
}
static void init_mmap(void)
{
struct v4l2_requestbuffers req;
CLEAR(req);
req.count = 4;
req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
req.memory = V4L2_MEMORY_MMAP;
if (-1 == xioctl(fd, VIDIOC_REQBUFS, &req)) {
if (EINVAL == errno) {
fprintf(stderr, "327 %s does not support "
"memory mappingn", dev_name);
exit(EXIT_FAILURE);
} else {
errno_exit("VIDIOC_REQBUFS");
}
}
if (req.count < 2) {
fprintf(stderr, "336 Insufficient buffer memory on %s\n",
dev_name);
exit(EXIT_FAILURE);
}
buffers = calloc(req.count, sizeof(*buffers));
if (!buffers) {
fprintf(stderr, "344 Out of memory\n");
exit(EXIT_FAILURE);
}
for (n_buffers = 0; n_buffers < req.count; ++n_buffers) {
struct v4l2_buffer buf;
CLEAR(buf);
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
buf.index = n_buffers;
if (-1 == xioctl(fd, VIDIOC_QUERYBUF, &buf))
errno_exit("VIDIOC_QUERYBUF");
buffers[n_buffers].length = buf.length;
buffers[n_buffers].start =
mmap(NULL /* start anywhere */,
buf.length,
PROT_READ | PROT_WRITE /* required */,
MAP_SHARED /* recommended */,
fd, buf.m.offset);
if (MAP_FAILED == buffers[n_buffers].start)
errno_exit("mmap");
}
}
static void init_userp(unsigned int buffer_size)
{
struct v4l2_requestbuffers req;
CLEAR(req);
req.count = 4;
req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
req.memory = V4L2_MEMORY_USERPTR;
if (-1 == xioctl(fd, VIDIOC_REQBUFS, &req)) {
if (EINVAL == errno) {
fprintf(stderr, "385 %@s does not support "
"user pointer i/on", dev_name);
exit(EXIT_FAILURE);
} else {
errno_exit("VIDIOC_REQBUFS");
}
}
buffers = calloc(4, sizeof(*buffers));
if (!buffers) {
fprintf(stderr, "396 Out of memory\n");
exit(EXIT_FAILURE);
}
for (n_buffers = 0; n_buffers < 4; ++n_buffers) {
buffers[n_buffers].length = buffer_size;
buffers[n_buffers].start = malloc(buffer_size);
if (!buffers[n_buffers].start) {
fprintf(stderr, "405 Out of memory\n");
exit(EXIT_FAILURE);
}
}
}
static void init_device(void)
{
struct v4l2_capability cap;
struct v4l2_cropcap cropcap;
struct v4l2_crop crop;
struct v4l2_format fmt;
unsigned int min;
if (-1 == xioctl(fd, VIDIOC_QUERYCAP, &cap)) {
if (EINVAL == errno) {
fprintf(stderr, "421 @%s is no V4L2 device\n",
dev_name);
exit(EXIT_FAILURE);
} else {
errno_exit("VIDIOC_QUERYCAP");
}
}
if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
fprintf(stderr, "430 %s is no video capture device\n",
dev_name);
exit(EXIT_FAILURE);
}
switch (io) {
case IO_METHOD_READ:
if (!(cap.capabilities & V4L2_CAP_READWRITE)) {
fprintf(stderr, "438 %s does not support read i/o\n",
dev_name);
exit(EXIT_FAILURE);
}
break;
case IO_METHOD_MMAP:
case IO_METHOD_USERPTR:
if (!(cap.capabilities & V4L2_CAP_STREAMING)) {
fprintf(stderr, "447 %s does not support streaming i/o\n",
dev_name);
exit(EXIT_FAILURE);
}
break;
}
/* Select video input, video standard and tune here. */
CLEAR(cropcap);
cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (0 == xioctl(fd, VIDIOC_CROPCAP, &cropcap)) {
crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
crop.c = cropcap.defrect; /* reset to default */
if (-1 == xioctl(fd, VIDIOC_S_CROP, &crop)) {
switch (errno) {
case EINVAL:
/* Cropping not supported. */
break;
default:
/* Errors ignored. */
break;
}
}
} else {
/* Errors ignored. */
}
CLEAR(fmt);
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (force_format) {
fmt.fmt.pix.width = 640;
fmt.fmt.pix.height = 480;
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;
if (-1 == xioctl(fd, VIDIOC_S_FMT, &fmt))
errno_exit("VIDIOC_S_FMT");
/* Note VIDIOC_S_FMT may change width and height. */
} else {
/* Preserve original settings as set by v4l2-ctl for example */
if (-1 == xioctl(fd, VIDIOC_G_FMT, &fmt))
errno_exit("VIDIOC_G_FMT");
}
/* Buggy driver paranoia. */
min = fmt.fmt.pix.width * 2;
if (fmt.fmt.pix.bytesperline < min)
fmt.fmt.pix.bytesperline = min;
min = fmt.fmt.pix.bytesperline * fmt.fmt.pix.height;
if (fmt.fmt.pix.sizeimage < min)
fmt.fmt.pix.sizeimage = min;
switch (io) {
case IO_METHOD_READ:
init_read(fmt.fmt.pix.sizeimage);
break;
case IO_METHOD_MMAP:
init_mmap();
break;
case IO_METHOD_USERPTR:
init_userp(fmt.fmt.pix.sizeimage);
break;
}
}
static void close_device(void)
{
if (-1 == close(fd))
errno_exit("close");
fd = -1;
}
static void open_device(void)
{
struct stat st;
if (-1 == stat(dev_name, &st)) {
fprintf(stderr, "536 Cannot identify '%s': %d, %s\n",
dev_name, errno, strerror(errno));
exit(EXIT_FAILURE);
}
if (!S_ISCHR(st.st_mode)) {
fprintf(stderr, "542 %s is no devicen", dev_name);
exit(EXIT_FAILURE);
}
fd = open(dev_name, O_RDWR /* required */ | O_NONBLOCK, 0);
if (-1 == fd) {
fprintf(stderr, "548 Cannot open '%s': %d, %s\n",
dev_name, errno, strerror(errno));
exit(EXIT_FAILURE);
}
}
static void usage(FILE *fp, int argc, char **argv)
{
fprintf(fp,
"Usage: %s [options]\n\n"
"Version 1.3\n"
"Options:\n"
"-d | --device name Video device name [%s]n"
"-h | --help Print this messagen"
"-m | --mmap Use memory mapped buffers [default]n"
"-r | --read Use read() callsn"
"-u | --userp Use application allocated buffersn"
"-o | --output Outputs stream to stdoutn"
"-f | --format Force format to 640x480 YUYVn"
"-c | --count Number of frames to grab [%i]n"
"",
argv[0], dev_name, frame_count);
}
static const char short_options[] = "d:hmruofc:";
static const struct option
long_options[] = {
{ "device", required_argument, NULL, 'd' },
{ "help", no_argument, NULL, 'h' },
{ "mmap", no_argument, NULL, 'm' },
{ "read", no_argument, NULL, 'r' },
{ "userp", no_argument, NULL, 'u' },
{ "output", no_argument, NULL, 'o' },
{ "format", no_argument, NULL, 'f' },
{ "count", required_argument, NULL, 'c' },
{ 0, 0, 0, 0 }
};
int main(int argc, char **argv)
{
dev_name = "/dev/video0";
for (; {
int idx;
int c;
c = getopt_long(argc, argv,
short_options, long_options, &idx);
if (-1 == c)
break;
switch (c) {
case 0: /* getopt_long() flag */
break;
case 'd':
dev_name = optarg;
break;
case 'h':
usage(stdout, argc, argv);
exit(EXIT_SUCCESS);
case 'm':
io = IO_METHOD_MMAP;
break;
case 'r':
io = IO_METHOD_READ;
break;
case 'u':
io = IO_METHOD_USERPTR;
break;
case 'o':
out_buf++;
break;
case 'f':
force_format++;
break;
case 'c':
errno = 0;
frame_count = strtol(optarg, NULL, 0);
if (errno)
errno_exit(optarg);
break;
default:
usage(stderr, argc, argv);
exit(EXIT_FAILURE);
}
}
open_device();
init_device();
start_capturing();
mainloop();
stop_capturing();
uninit_device();
close_device();
fprintf(stderr, "\n");
return 0;
}
[email protected]:/data # gcc /sdcard/camera.c
[email protected]:/data #
[email protected]:/data # ./a.out
43 VIDIOC_QUERYCAP error 25, Not a typewriter

[Q] Really confused and annoyed right now

Can somebody please tell me how these bits of code
Code:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
Uri originalUri = data.getData();
selectedImageImageView.setImageURI(originalUri);
selectedImageImageView.setVisibility(View.VISIBLE);
progressDialog.setProgress(0);
progressDialog.show();
new GetImageFileTask(this).execute(imageHelper,
selectedImageImageView);
}
super.onActivityResult(requestCode, resultCode, data);
}
Code:
public static final int GALLERY_KITKAT_INTENT_CALLED = 2;
public static final int GALLERY_INTENT_CALLED = 1;
private final int PREF_WIDTH_IMAGE = 500;
private Activity activity;
public ImageHelper(Activity activity) {
this.activity = activity;
}
public void getImage() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
activity.startActivityForResult(intent, GALLERY_INTENT_CALLED);
} else {
showKitKatGallery();
}
}
private void showKitKatGallery() {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image/*");
activity.startActivityForResult(intent, GALLERY_KITKAT_INTENT_CALLED);
}
public File getFileFromImageView(ImageView imageView) throws IOException {
int preferredWidth = PREF_WIDTH_IMAGE;
Bitmap origBitmap = drawableToBitmap(imageView.getDrawable());
int origWidth = origBitmap.getWidth();
int origHeight = origBitmap.getHeight();
int destHeight, destWidth;
if (origWidth <= preferredWidth || origHeight <= preferredWidth) {
destWidth = origWidth;
destHeight = origHeight;
} else {
destWidth = PREF_WIDTH_IMAGE;
destHeight = origHeight / (origWidth / destWidth);
}
File tempFile = new File(activity.getCacheDir(), "temp.png");
tempFile.createNewFile();
Bitmap bitmap = resizeBitmap(origBitmap, destWidth, destHeight);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 0, bos);
byte[] bitmapData = bos.toByteArray();
FileOutputStream fos = new FileOutputStream(tempFile);
fos.write(bitmapData);
fos.close();
return tempFile;
}
public static Bitmap drawableToBitmap(Drawable drawable) {
if (drawable == null) {
return null;
}
if (drawable instanceof BitmapDrawable) {
return ((BitmapDrawable) drawable).getBitmap();
}
int width = drawable.getIntrinsicWidth();
width = width > 0 ? width : 1;
int height = drawable.getIntrinsicHeight();
height = height > 0 ? height : 1;
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
return bitmap;
}
private Bitmap resizeBitmap(Bitmap inputBitmap, int newWidth, int newHeight) {
return Bitmap.createScaledBitmap(inputBitmap, newWidth, newHeight, true);
}
}
have managed to come up with this error:
Code:
05-15 02:10:01.199: E/AndroidRuntime(17169): FATAL EXCEPTION: main
05-15 02:10:01.199: E/AndroidRuntime(17169): Process: com.simplistic.bloxbackup, PID: 17169
05-15 02:10:01.199: E/AndroidRuntime(17169): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2, result=-1, data=Intent { dat=content://com.android.providers.media.documents/document/image:13985 flg=0x43 }} to activity {com.simplistic.bloxbackup/com.simplistic.bloxbackup.activities.GalleryActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setImageURI(android.net.Uri)' on a null object reference
05-15 02:10:01.199: E/AndroidRuntime(17169): at android.app.ActivityThread.deliverResults(ActivityThread.java:3637)
05-15 02:10:01.199: E/AndroidRuntime(17169): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3680)
05-15 02:10:01.199: E/AndroidRuntime(17169): at android.app.ActivityThread.access$1300(ActivityThread.java:149)
05-15 02:10:01.199: E/AndroidRuntime(17169): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
05-15 02:10:01.199: E/AndroidRuntime(17169): at android.os.Handler.dispatchMessage(Handler.java:102)
05-15 02:10:01.199: E/AndroidRuntime(17169): at android.os.Looper.loop(Looper.java:211)
05-15 02:10:01.199: E/AndroidRuntime(17169): at android.app.ActivityThread.main(ActivityThread.java:5321)
05-15 02:10:01.199: E/AndroidRuntime(17169): at java.lang.reflect.Method.invoke(Native Method)
05-15 02:10:01.199: E/AndroidRuntime(17169): at java.lang.reflect.Method.invoke(Method.java:372)
05-15 02:10:01.199: E/AndroidRuntime(17169): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1016)
05-15 02:10:01.199: E/AndroidRuntime(17169): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
05-15 02:10:01.199: E/AndroidRuntime(17169): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setImageURI(android.net.Uri)' on a null object reference
05-15 02:10:01.199: E/AndroidRuntime(17169): at com.simplistic.bloxbackup.activities.GalleryActivity.onActivityResult(GalleryActivity.java:101)
05-15 02:10:01.199: E/AndroidRuntime(17169): at android.app.Activity.dispatchActivityResult(Activity.java:6135)
05-15 02:10:01.199: E/AndroidRuntime(17169): at android.app.ActivityThread.deliverResults(ActivityThread.java:3633)
Because i don't know if any of you have seen my thread about my new app "Blox Backup" but the launch has been a big massive flop due this problem.
Now what i don't get is that it was all working as it should before i signed then published it?! I mean i know that apps don't work on every phone but this simply will not work at all no matter the phone!
So can someone please review the code and see where the null pointer is coming from because it shouldn't be coming up as null especially when it didn't before. I have tried to get an answer on Stack but nobody has bothered
So yeah please give me hand because i need this app back on Gplay
Thanks
I'm on my phone right now and have just taken a quick look, but my understanding is that "selectedImageView" is null. You could use something like Eclipse's debugging tool to check in real time where the crash happens and due to what.
So I've been playing around with it and it doesn't crash any more but it'll just finish the intent then do nothing. so nothing is being uploaded...
Code:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == imageHelper.GALLERY_KITKAT_INTENT_CALLED) {
Uri originalUri = data.getData();
selectedImageImageView.setImageURI(originalUri);
selectedImageImageView.setVisibility(View.VISIBLE);
progressDialog.setProgress(0);
progressDialog.show();
new GetImageFileTask(this).execute(imageHelper,
selectedImageImageView);
}else{
if(resultCode == imageHelper.GALLERY_INTENT_CALLED){
Uri originalUri = data.getData();
selectedImageImageView.setImageURI(originalUri);
selectedImageImageView.setVisibility(View.VISIBLE);
progressDialog.setProgress(0);
progressDialog.show();
new GetImageFileTask(this).execute(imageHelper,
selectedImageImageView);
}
}
super.onActivityResult(requestCode, resultCode, data);
}
Code:
public int GALLERY_KITKAT_INTENT_CALLED = 2;
public int GALLERY_INTENT_CALLED = 1;
public ImageHelper(Activity activity) {
this.activity = activity;
}
public void getImage() {
if (Build.VERSION.SDK_INT < 19) {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
activity.startActivityForResult(intent, 2);
} else {
showKitKatGallery();
}
}
private void showKitKatGallery() {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image/*");
activity.startActivityForResult(intent, 1);
}
I also have a feeling this
Code:
public class GetImageFileTask extends AsyncTask<Object, Object, Object> {
private OnGetImageFileListener listener;
public GetImageFileTask(OnGetImageFileListener listener) {
this.listener = listener;
}
@Override
protected Object doInBackground(Object[] params) {
File imageFile = null;
ImageHelper imageHelper = (ImageHelper) params[0];
ImageView imageView = (ImageView) params[1];
try {
imageFile = imageHelper.getFileFromImageView(imageView);
} catch (IOException e) {
e.printStackTrace();
}
return imageFile;
}
@Override
protected void onPostExecute(Object imageFile) {
listener.onGotImageFile((File) imageFile);
}
}
may have something to do with the problem but i could be wrong
X10_minipro said:
I'm on my phone right now and have just taken a quick look, but my understanding is that "selectedImageView" is null. You could use something like Eclipse's debugging tool to check in real time where the crash happens and due to what.
Click to expand...
Click to collapse
I done but it didn't show anything that i didn't already know
Right i give up, I've tried every single "solution" but absolutely nothing works, so i have no idea what's happened but it won't work so this app, unless someone can actually fix it, is going to off the play store
Okay, I'm feeling very very stupid right now, it turns out i forgot i deleted the imageview from the layout but made a rookie mistake and left the code. I'm such a twat.

resigned quickpic 4.5.2 - Google Drive " access not configured "

Log story short.
RE-SIGNING the original quickpic 4.5.2 from the original developers website solves the updating issue on the playstore BUT also makes google drive cloud backup unusable. This is the logcat:
Code:
01-05 16:52:26.289 I/ActivityManager(797): START u0 {dat=content://com.alensw.PicFolder.CloudProvider/document/[email protected]:root cmp=com.alensw.PicFolder/com.alensw.cloud.CloudConfigActivity (has extras)} from uid 10141 on display 0
01-05 16:52:26.297 I/art (4767): Background sticky concurrent mark sweep GC freed 24503(2MB) AllocSpace objects, 33(2MB) LOS objects, 23% free, 16MB/21MB, paused 7.549ms total 61.083ms
01-05 16:52:26.345 W/InputMethodManagerService(797): Starting input on non-focused client [email protected] (uid=10141 pid=4767)
01-05 16:52:26.368 E/SQLiteLog(4767): (1) no such table: nodes
01-05 16:52:26.396 V/GLSActivity(1688): AuthDelegateWrapperCreated with selected intent: Intent { cmp=com.google.android.gms/.auth.DefaultAuthDelegateService }
01-05 16:52:26.398 V/GLSActivity(1688): AuthDelegateWrapperCreated with selected intent: Intent { cmp=com.google.android.gms/.auth.DefaultAuthDelegateService }
01-05 16:52:26.441 I/ActivityManager(797): Displayed com.alensw.PicFolder/com.alensw.cloud.CloudConfigActivity: +109ms
01-05 16:52:26.940 E/CloudProvider(4767): query failed:
01-05 16:52:26.940 E/CloudProvider(4767): java.net.ProtocolException: {
01-05 16:52:26.940 E/CloudProvider(4767): "error": {
01-05 16:52:26.940 E/CloudProvider(4767): "errors": [
01-05 16:52:26.940 E/CloudProvider(4767): {
01-05 16:52:26.940 E/CloudProvider(4767): "domain": "usageLimits",
01-05 16:52:26.940 E/CloudProvider(4767): "reason": "accessNotConfigured",
01-05 16:52:26.940 E/CloudProvider(4767): "message": "Access Not Configured. The API (Drive API) is not enabled for your project. Please use the Google Developers Console to update your configuration.",
01-05 16:52:26.940 E/CloudProvider(4767): "extendedHelp": "https://console.developers.google.com"
01-05 16:52:26.940 E/CloudProvider(4767): }
01-05 16:52:26.940 E/CloudProvider(4767): ],
01-05 16:52:26.940 E/CloudProvider(4767): "code": 403,
01-05 16:52:26.940 E/CloudProvider(4767): "message": "Access Not Configured. The API (Drive API) is not enabled for your project. Please use the Google Developers Console to update your configuration."
01-05 16:52:26.940 E/CloudProvider(4767): }
01-05 16:52:26.940 E/CloudProvider(4767): }
01-05 16:52:26.940 E/CloudProvider(4767):
01-05 16:52:26.940 E/CloudProvider(4767): at com.alensw.cloud.a.am.a(Unknown Source)
01-05 16:52:26.940 E/CloudProvider(4767): at com.alensw.cloud.a.by.a(Unknown Source)
01-05 16:52:26.940 E/CloudProvider(4767): at com.alensw.b.e.g.a(Unknown Source)
01-05 16:52:26.940 E/CloudProvider(4767): at com.alensw.b.e.g.a(Unknown Source)
01-05 16:52:26.940 E/CloudProvider(4767): at com.alensw.b.e.b.a(Unknown Source)
01-05 16:52:26.940 E/CloudProvider(4767): at com.alensw.cloud.a.am.a(Unknown Source)
01-05 16:52:26.940 E/CloudProvider(4767): at com.alensw.PicFolder.h.c(Unknown Source)
01-05 16:52:26.940 E/CloudProvider(4767): at com.alensw.PicFolder.h.call(Unknown Source)
01-05 16:52:26.940 E/CloudProvider(4767): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
01-05 16:52:26.940 E/CloudProvider(4767): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
01-05 16:52:26.940 E/CloudProvider(4767): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
01-05 16:52:26.940 E/CloudProvider(4767): at java.lang.Thread.run(Thread.java:818)
01-05 16:52:26.940 E/CloudProvider(4767): at com.alensw.b.k.j.run(Unknown Source)
01-05 16:52:27.065 V/GLSActivity(1688): AuthDelegateWrapperCreated with selected intent: Intent { cmp=com.google.android.gms/.auth.DefaultAuthDelegateService }
01-05 16:52:27.069 V/GLSActivity(1688): AuthDelegateWrapperCreated with selected intent: Intent { cmp=com.google.android.gms/.auth.DefaultAuthDelegateService }
01-05 16:52:27.764 E/CloudProvider(4767): query failed:
01-05 16:52:27.764 E/CloudProvider(4767): java.net.ProtocolException: {
01-05 16:52:27.764 E/CloudProvider(4767): "error": {
01-05 16:52:27.764 E/CloudProvider(4767): "errors": [
01-05 16:52:27.764 E/CloudProvider(4767): {
01-05 16:52:27.764 E/CloudProvider(4767): "domain": "usageLimits",
01-05 16:52:27.764 E/CloudProvider(4767): "reason": "accessNotConfigured",
01-05 16:52:27.764 E/CloudProvider(4767): "message": "Access Not Configured. The API (Drive API) is not enabled for your project. Please use the Google Developers Console to update your configuration.",
01-05 16:52:27.764 E/CloudProvider(4767): "extendedHelp": "https://console.developers.google.com"
01-05 16:52:27.764 E/CloudProvider(4767): }
01-05 16:52:27.764 E/CloudProvider(4767): ],
01-05 16:52:27.764 E/CloudProvider(4767): "code": 403,
01-05 16:52:27.764 E/CloudProvider(4767): "message": "Access Not Configured. The API (Drive API) is not enabled for your project. Please use the Google Developers Console to update your configuration."
01-05 16:52:27.764 E/CloudProvider(4767): }
01-05 16:52:27.764 E/CloudProvider(4767): }
01-05 16:52:27.764 E/CloudProvider(4767):
01-05 16:52:27.764 E/CloudProvider(4767): at com.alensw.cloud.a.am.a(Unknown Source)
01-05 16:52:27.764 E/CloudProvider(4767): at com.alensw.cloud.a.by.a(Unknown Source)
01-05 16:52:27.764 E/CloudProvider(4767): at com.alensw.b.e.g.a(Unknown Source)
01-05 16:52:27.764 E/CloudProvider(4767): at com.alensw.b.e.g.a(Unknown Source)
01-05 16:52:27.764 E/CloudProvider(4767): at com.alensw.b.e.b.a(Unknown Source)
01-05 16:52:27.764 E/CloudProvider(4767): at com.alensw.cloud.a.am.a(Unknown Source)
01-05 16:52:27.764 E/CloudProvider(4767): at com.alensw.PicFolder.h.c(Unknown Source)
01-05 16:52:27.764 E/CloudProvider(4767): at com.alensw.PicFolder.h.call(Unknown Source)
01-05 16:52:27.764 E/CloudProvider(4767): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
01-05 16:52:27.764 E/CloudProvider(4767): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
01-05 16:52:27.764 E/CloudProvider(4767): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
01-05 16:52:27.764 E/CloudProvider(4767): at java.lang.Thread.run(Thread.java:818)
01-05 16:52:27.764 E/CloudProvider(4767): at com.alensw.b.k.j.run(Unknown Source)
can anyone provide the steps (in detail) to solve this issue?
Code:
"message": "Access Not Configured. The API (Drive API) is not enabled for your project. Please use the Google Developers Console to update your configuration.",
I'm sure this is the problem, but how to solve it has become a nightmare for me.
original quickpic 4.5.2
The thing is you can't. Without the source code for the app the best you can do is hack around the smali code.

Nexus 9 - general problem with sound & youtube

Hi, I have problem with Nexus 9 that belongs to my parents. Device was working without problems for over 2 years but after update to 7.1 something really bad happened. Device cannot play any video in youtube app, and there is some problem with sound - for example I cannot play any music in google play music. There are some other troubles as well - for example voice search doesn't work at all - when I try to run voice search there is a message "Device cannot connect to Google". Firstly I thought that something happened in 7.1 and even flashed CM 14.1 but everything was the same, then I tried stock image of android 6 but without success, still same situation. Now I returned to stock 7.1. Today connected logcat and below is sample log of what happens when I try to play some video in YT app:
01-05 15:14:20.147 19721 19769 W YouTube : Pinging https://s.youtube.com/api/stats/qoe...ps=32.223:N&fmt=136&cache_bytes=30.001:235719
01-05 15:14:20.226 11930 22191 V Avrcp : Active sessions changed, 1 sessions
01-05 15:14:20.226 11930 22191 V Avrcp : Updating media controller to [email protected]
01-05 15:14:20.233 11930 22191 V Avrcp : Updated [MediaAttributes: UK - kierowca autobusu to Polak - by switcher44 (0/0) ] but no change!
01-05 15:14:20.293 256 12530 I MediaPlayerService: MediaPlayerService::getOMX
01-05 15:14:20.294 19721 21432 I OMXClient: MuxOMX ctor
01-05 15:14:20.295 253 26224 I OMXMaster: makeComponentInstance(OMX.google.aac.decoder) in mediacodec process
01-05 15:14:20.327 253 21433 I SoftAAC2: Reconfiguring decoder: 0->44100 Hz, 0->2 channels
01-05 15:14:20.334 19721 19726 I art : Do full code cache collection, code=505KB, data=440KB
01-05 15:14:20.359 19721 19726 I art : Starting a blocking GC JitCodeCache
01-05 15:14:20.359 19721 19726 I art : After code cache collection, code=386KB, data=332KB
01-05 15:14:20.371 256 12529 I MediaPlayerService: MediaPlayerService::getOMX
01-05 15:14:20.371 19721 21436 I OMXClient: MuxOMX ctor
01-05 15:14:20.372 253 1377 I OMXMaster: makeComponentInstance(OMX.Nvidia.h264.decode) in mediacodec process
01-05 15:14:20.381 19721 21435 I MediaCodec: [OMX.Nvidia.h264.decode] setting surface generation to 20194313
01-05 15:14:20.384 253 1377 E OMXNodeInstance: getConfig(fd008f:Nvidia.h264.decode, ConfigCommonOutputCrop(0x700000f)) ERROR: BadParameter(0x80001005)
01-05 15:14:20.390 19721 21436 D SurfaceUtils: set up nativeWindow 0x7a42b8da10 for 1280x720, color 0x106, rotation 0, usage 0x2b00
01-05 15:14:20.393 253 21437 D NvOsDebugPrintf: NvMMLiteOpen : Block : BlockType = 261
01-05 15:14:20.393 253 21437 D NvOsDebugPrintf: TVMR: NvMMLiteTVMRDecBlockOpen: 5008: NvMMLiteBlockOpen
01-05 15:14:20.402 253 21437 D NvOsDebugPrintf: NvMMLiteBlockCreate : Block : BlockType = 261
01-05 15:14:20.424 248 248 W APM_AudioPolicyManager: getOutput() could not find output for stream 3, samplingRate 0,format 0, channels 3, flags 0
01-05 15:14:20.424 19721 21428 E AudioTrack: Unable to query output sample rate for stream type -1; status -1
01-05 15:14:20.424 19721 21428 E AudioTrack-JNI: AudioTrack::getMinFrameCount() for sample rate 44100 failed with status -1
01-05 15:14:20.425 19721 21428 E android.media.AudioTrack: getMinBufferSize(): error querying hardware
01-05 15:14:20.426 248 18502 W APM_AudioPolicyManager: getOutput() could not find output for stream 3, samplingRate 44100,format 1, channels 3, flags 0
01-05 15:14:20.426 19721 21428 E AudioTrack: Could not get audio output for session 16305, stream type -1, usage 1, sample rate 44100, format 0x1, channel mask 0x3, flags 0
01-05 15:14:20.427 19721 21428 E AudioTrack-JNI: Error -22 initializing AudioTrack
01-05 15:14:20.427 19721 21428 E android.media.AudioTrack: Error code -20 when initializing AudioTrack.
01-05 15:14:20.429 19721 19721 E YouTube : Error with ExoPlayer audio track initialization.
01-05 15:14:20.429 19721 19721 E YouTube : hgx: AudioTrack init failed: 0, Config(44100, 12, 44100)
01-05 15:14:20.429 19721 19721 E YouTube : at hgs.a(SourceFile:2930)
01-05 15:14:20.429 19721 19721 E YouTube : at hfe.a(SourceFile:3453)
01-05 15:14:20.429 19721 19721 E YouTube : at hfl.a(SourceFile:12954)
01-05 15:14:20.429 19721 19721 E YouTube : at hgj.a(SourceFile:128)
01-05 15:14:20.429 19721 19721 E YouTube : at hfa.handleMessage(SourceFile:1432)
01-05 15:14:20.429 19721 19721 E YouTube : at android.os.Handler.dispatchMessage(Handler.java:98)
01-05 15:14:20.429 19721 19721 E YouTube : at android.os.Looper.loop(Looper.java:154)
01-05 15:14:20.429 19721 19721 E YouTube : at android.os.HandlerThread.run(HandlerThread.java:61)
01-05 15:14:20.429 19721 19721 E YouTube : at hsu.run(SourceFile:40)
01-05 15:14:20.429 19721 21428 E ExoPlayerImplInternal: Internal track renderer error.
01-05 15:14:20.429 19721 21428 E ExoPlayerImplInternal: het: hgx: AudioTrack init failed: 0, Config(44100, 12, 44100)
01-05 15:14:20.429 19721 21428 E ExoPlayerImplInternal: at hfe.a(SourceFile:395)
01-05 15:14:20.429 19721 21428 E ExoPlayerImplInternal: at hfl.a(SourceFile:12954)
01-05 15:14:20.429 19721 21428 E ExoPlayerImplInternal: at hgj.a(SourceFile:128)
01-05 15:14:20.429 19721 21428 E ExoPlayerImplInternal: at hfa.handleMessage(SourceFile:1432)
01-05 15:14:20.429 19721 21428 E ExoPlayerImplInternal: at android.os.Handler.dispatchMessage(Handler.java:98)
01-05 15:14:20.429 19721 21428 E ExoPlayerImplInternal: at android.os.Looper.loop(Looper.java:154)
01-05 15:14:20.429 19721 21428 E ExoPlayerImplInternal: at android.os.HandlerThread.run(HandlerThread.java:61)
01-05 15:14:20.429 19721 21428 E ExoPlayerImplInternal: at hsu.run(SourceFile:40)
01-05 15:14:20.429 19721 21428 E ExoPlayerImplInternal: Caused by: hgx: AudioTrack init failed: 0, Config(44100, 12, 44100)
01-05 15:14:20.429 19721 21428 E ExoPlayerImplInternal: at hgs.a(SourceFile:2930)
01-05 15:14:20.429 19721 21428 E ExoPlayerImplInternal: at hfe.a(SourceFile:3453)
01-05 15:14:20.429 19721 21428 E ExoPlayerImplInternal: ... 7 more
01-05 15:14:20.444 11930 22191 V Avrcp : MediaController playback changed: PlaybackState {state=7, position=0, buffered position=0, speed=1.0, updated=65833230, actions=262, custom actions=[], active item id=-1, error=null}
01-05 15:14:20.454 253 21439 D NvOsDebugPrintf: TVMR: cbBeginSequence: 655: BeginSequence 1280x720, bVPR = 0
01-05 15:14:20.454 253 21439 D NvOsDebugPrintf: TVMR: cbBeginSequence: 918: DecodeBuffers = 4
01-05 15:14:20.457 253 21439 D NvOsDebugPrintf: TVMR: cbBeginSequence: 938: Display Resolution : (1280x720)
01-05 15:14:20.457 253 21439 D NvOsDebugPrintf: TVMR: cbBeginSequence: 939: Display Aspect Ratio : (1280x720)
01-05 15:14:20.457 253 21439 D NvOsDebugPrintf: TVMR: cbBeginSequence: 1041: SurfaceLayout = 3
01-05 15:14:20.457 253 21439 D NvOsDebugPrintf: TVMR: cbBeginSequence: 1071: NumOfSurfaces = 8, InteraceStream = 0, InterlaceEnabled = 0, bSecure = 0, MVC = 0 Semiplanar = 1, bReinit = 1
01-05 15:14:20.457 253 21439 D NvOsDebugPrintf: Allocating new output: 1280x720 (x 10), ThumbnailMode = 0
01-05 15:14:20.465 19721 21436 D SurfaceUtils: set up nativeWindow 0x7a42b8da10 for 1280x720, color 0x106, rotation 0, usage 0x2b00
01-05 15:14:20.466 253 26224 E OMXNodeInstance: setParameter(fd008f:Nvidia.h264.decode, ParamPortDefinition(0x2000001)) ERROR: UnsupportedSetting(0x80001019)
01-05 15:14:20.466 19721 21436 W ACodec : [OMX.Nvidia.h264.decode] setting nBufferCountActual to 14 failed: -1010
01-05 15:14:20.466 253 19218 E OMXNodeInstance: setParameter(fd008f:Nvidia.h264.decode, ParamPortDefinition(0x2000001)) ERROR: UnsupportedSetting(0x80001019)
01-05 15:14:20.466 19721 21436 W ACodec : [OMX.Nvidia.h264.decode] setting nBufferCountActual to 13 failed: -1010
01-05 15:14:20.509 253 21440 D NvOsDebugPrintf: TVMR: TVMRFrameDelivery: 3741: Closing TVMR Frame Delivery Thread -------------
01-05 15:14:20.513 253 21437 D NvOsDebugPrintf: TVMR: NvMMDecTVMRDestroyParser: 4224: NvAvpClose
01-05 15:14:20.513 253 21437 D NvOsDebugPrintf: TVMR: NvMMLiteTVMRDecBlockClose: 5163: Done
01-05 15:14:20.540 19721 19742 W YouTube : Pinging https://s.youtube.com/api/stats/qoe...,0.037:B,0.252:ER&fmt=136&view=0.158:1536:864
01-05 15:14:20.626 254 254 W mediadrmserver: type=1400 audit(0.0:478): avc: denied { read write } for name="nvmap" dev="tmpfs" ino=9815 scontext=u:r:mediadrmserver:s0 tcontext=ubject_r:gpu_device:s0 tclass=chr_file permissive=0
01-05 15:14:20.606 254 3645 D WVCdm : Instantiating CDM.
01-05 15:14:20.608 254 254 I WVCdm : CdmEngine:penSession
01-05 15:14:20.608 254 254 I WVCdm : Level3 Library 4445 Sep 10 2016 21:30:01
01-05 15:14:20.632 254 254 D NvOsDebugPrintf:
01-05 15:14:20.632 254 254 D NvOsDebugPrintf:
01-05 15:14:20.632 254 254 D NvOsDebugPrintf:
01-05 15:14:20.632 254 254 D NvOsDebugPrintf: ****NvRmMemInit failed****
01-05 15:14:20.632 254 254 D NvOsDebugPrintf:
01-05 15:14:20.632 254 254 D NvOsDebugPrintf:
01-05 15:14:20.632 254 254 D oemcrypto_cenc: >> OEMCrypto_Initialize: modular drm 6.00
01-05 15:14:20.633 254 254 D oemcrypto_cenc: << OEMCrypto_Initialize
01-05 15:14:20.633 254 254 E oemcrypto_cenc: OEMCrypto_APIVersion: 11
01-05 15:14:20.633 254 254 D oemcrypto_cenc: >> OEMCrypto_IsKeyboxValid
01-05 15:14:20.633 254 254 D oemcrypto_cenc: << OEMCrypto_IsKeyboxValid
01-05 15:14:20.634 254 254 D WVCdm : OEMCrypto_Initialize Level 1 success. I will use level 1.
01-05 15:14:20.634 254 254 D oemcrypto_cenc: >> OEMCryptpenSession
01-05 15:14:20.634 254 254 D oemcrypto_cenc: bool AddSessionHandle(OEMCrypto_SESSION): session:0xee394570, status: 1
01-05 15:14:20.634 254 254 D oemcrypto_cenc: << OEMCryptpenSession
01-05 15:14:20.634 254 254 D oemcrypto_cenc: >> OEMCrypto_GetRandom
01-05 15:14:20.634 254 254 D oemcrypto_cenc: << OEMCrypto_GetRandom
01-05 15:14:20.634 254 254 E oemcrypto_cenc: OEMCrypto_SecurityLevel
01-05 15:14:20.635 254 254 D oemcrypto_cenc: >> OEMCrypto_LoadDeviceRSAKey
01-05 15:14:20.635 254 254 D oemcrypto_cenc: << OEMCrypto_LoadDeviceRSAKey
01-05 15:14:20.635 254 254 D oemcrypto_cenc: >> OEMCrypto_GetRandom
01-05 15:14:20.635 254 254 D oemcrypto_cenc: << OEMCrypto_GetRandom
01-05 15:14:20.635 254 254 I WVCdm : CdmEngine::QueryKeyControlInfo
01-05 15:14:20.636 254 16171 I WVCdm : CdmEngine::GenerateKeyRequest
01-05 15:14:20.636 254 16171 D oemcrypto_cenc: >> OEMCrypto_GetDeviceID
01-05 15:14:20.636 254 16171 D oemcrypto_cenc: << OEMCrypto_GetDeviceID
01-05 15:14:20.636 254 16171 D oemcrypto_cenc: >> OEMCrypto_SupportsUsageTable
01-05 15:14:20.660 254 16171 D oemcrypto_cenc: << OEMCrypto_SupportsUsageTable
01-05 15:14:20.660 254 16171 E oemcrypto_cenc: OEMCrypto_APIVersion: 11
01-05 15:14:20.660 254 16171 D oemcrypto_cenc: OEMCrypto_GetHDCPCapability
01-05 15:14:20.660 254 16171 D oemcrypto_cenc: >> OEMCrypto_GenerateNonce
01-05 15:14:20.660 254 16171 D oemcrypto_cenc: << OEMCrypto_GenerateNonce
01-05 15:14:20.660 254 16171 D WVCdm : PrepareKeyRequest: nonce=749983962
01-05 15:14:20.660 254 16171 D oemcrypto_cenc: >> OEMCrypto_GenerateRSASignature
01-05 15:14:20.714 5588 5612 W Herrevad: Invalid mccmnc
01-05 15:14:20.719 254 16171 D oemcrypto_cenc: << OEMCrypto_GenerateRSASignature
01-05 15:14:20.720 254 3644 I WVCdm : CdmEngine::CloseSession
01-05 15:14:20.721 254 3644 D oemcrypto_cenc: >> OEMCrypto_CloseSession
01-05 15:14:20.721 254 3644 D oemcrypto_cenc: bool RemoveSessionHandle(OEMCrypto_SESSION): session: 0xee394570, status: 1
01-05 15:14:20.723 254 3644 D oemcrypto_cenc: << OEMCrypto_CloseSession
01-05 15:14:20.723 254 3644 D oemcrypto_cenc: >> OEMCrypto_Terminate
01-05 15:14:20.724 254 3644 D oemcrypto_cenc: << OEMCrypto_Terminate
01-05 15:14:20.757 5588 5612 W Herrevad: Invalid mccmnc
01-05 15:14:20.854 19721 19788 I qtaguid : Tagging socket -1 with tag 0(0) for uid -1 failed errno=-9
01-05 15:14:20.854 19721 19788 I NetworkManagementSocketTagger: tagSocketFd(-1, 0, -1) failed with errno-9
01-05 15:14:20.876 19721 19787 I qtaguid : Tagging socket -1 with tag 0(0) for uid -1 failed errno=-9
01-05 15:14:20.877 19721 19787 I NetworkManagementSocketTagger: tagSocketFd(-1, 0, -1) failed with errno-9
01-05 15:14:20.950 19721 19788 I qtaguid : Untagging socket -1 failed errno=-9
01-05 15:14:20.950 19721 19788 W NetworkManagementSocketTagger: untagSocket(-1) failed with errno -9
01-05 15:14:20.975 19721 19787 I qtaguid : Untagging socket -1 failed errno=-9
01-05 15:14:20.975 19721 19787 W NetworkManagementSocketTagger: untagSocket(-1) failed with errno -9
01-05 15:14:21.538 11930 22177 D HeadsetPhoneState: sendDeviceStateChanged. mService=0 mSignal=0 mRoam=0 mBatteryCharge=2
01-05 15:14:21.574 1212 1212 E PhoneInterfaceManager: [PhoneIntfMgr] queryModemActivityInfo: Empty response
01-05 15:14:21.606 596 624 E BatteryStatsService: power: Missing API
01-05 15:14:21.622 596 624 E BatteryStatsService: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs[]=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}
01-05 15:14:22.170 21227 21233 I art : Do partial code cache collection, code=30KB, data=25KB
01-05 15:14:22.172 21227 21233 I art : After code cache collection, code=30KB, data=25KB
01-05 15:14:22.172 21227 21233 I art : Increasing code cache capacity to 128KB
Can someone point me what might be wrong with device? This might be hardware malfunction?

Categories

Resources