diff --git a/core/hw/maple/maple_devs.cpp b/core/hw/maple/maple_devs.cpp index 2532133e4..0bd2d06c4 100755 --- a/core/hw/maple/maple_devs.cpp +++ b/core/hw/maple/maple_devs.cpp @@ -781,7 +781,7 @@ struct maple_microphone: maple_base { case 0x01: { - LOGI("maple_microphone::dma MDCF_MICControl someone wants some data! (2nd word) %#010x\n", subcommand); + //LOGI("maple_microphone::dma MDCF_MICControl someone wants some data! (2nd word) %#010x\n", secondword); w32(MFID_4_Mic); @@ -804,8 +804,6 @@ struct maple_microphone: maple_base } case 0x02: LOGI("maple_microphone::dma MDCF_MICControl toggle recording %#010x\n",secondword); - //this is where i should start recording... - return MDRS_DeviceReply; case 0x03: LOGI("maple_microphone::dma MDCF_MICControl set gain %#010x\n",secondword); diff --git a/shell/android/jni/src/Android.cpp b/shell/android/jni/src/Android.cpp index 3d1fdcfc8..115c6000d 100644 --- a/shell/android/jni/src/Android.cpp +++ b/shell/android/jni/src/Android.cpp @@ -348,7 +348,7 @@ int get_mic_data(u8* buffer) { jbyteArray jdata = (jbyteArray)jenv->CallObjectMethod(sipemu,getmicdata); if(jdata==NULL){ - LOGW("get_mic_data NULL"); + //LOGW("get_mic_data NULL"); return 0; } jenv->GetByteArrayRegion(jdata, 0, SIZE_OF_MIC_DATA, (jbyte*)buffer); diff --git a/shell/android/src/com/reicast/emulator/SipEmulator.java b/shell/android/src/com/reicast/emulator/SipEmulator.java index 11edae6bc..828fa4917 100644 --- a/shell/android/src/com/reicast/emulator/SipEmulator.java +++ b/shell/android/src/com/reicast/emulator/SipEmulator.java @@ -1,6 +1,7 @@ package com.reicast.emulator; import java.util.LinkedList; +import java.util.concurrent.ConcurrentLinkedQueue; import android.media.AudioFormat; import android.media.AudioRecord; @@ -19,9 +20,8 @@ public class SipEmulator extends Thread { static final int ONE_BLIP_SIZE = 480; //ALSO DEFINED IN maple_devs.h private AudioRecord record; - private LinkedList bytesReadBuffer; + private ConcurrentLinkedQueue bytesReadBuffer; - //private Thread recordThread; private boolean continueRecording; private boolean firstGet; @@ -50,7 +50,7 @@ public class SipEmulator extends Thread { AudioFormat.ENCODING_PCM_16BIT, BUFFER_SIZE); - bytesReadBuffer = new LinkedList(); + bytesReadBuffer = new ConcurrentLinkedQueue(); continueRecording = false; firstGet = true; @@ -75,7 +75,7 @@ public class SipEmulator extends Thread { public byte[] getData(){ //Log.d(TAG, "SipEmulator getData called"); - Log.d(TAG, "SipEmulator getData bytesReadBuffer size: "+bytesReadBuffer.size()); + //Log.d(TAG, "SipEmulator getData bytesReadBuffer size: "+bytesReadBuffer.size()); if(firstGet || bytesReadBuffer.size()>50){//50 blips is about 2 seconds! firstGet = false; return catchUp(); @@ -85,7 +85,7 @@ public class SipEmulator extends Thread { private byte[] catchUp(){ Log.d(TAG, "SipEmulator catchUp"); - byte[] last = bytesReadBuffer.removeLast(); + byte[] last = bytesReadBuffer.poll(); bytesReadBuffer.clear(); return last; }