[DEV-WIP] MIC testing (To enable GoogleNow function in JB)

Search This thread

Hashcode

Senior Recognized Developer
Sep 3, 2011
3,426
23,732
NOTE: This requires some knowledge of the ALSA subsystem. If you're not comfortable doing this, PLEASE DONT. You can in theory damage the audio hardware with bad settings.

With the migration to Jelly Bean, we can see how powerful having a working MIC would be.

On my latest AOSP Jelly Bean ROM (7/13), I have 3 new binaries so that anyone who is comfortable with the audio system can jump in and help:
tinymix
tinycap
tinyplay

Also, you can install "AlsaMixer" from the Market which gives you a bit of control over the audio system's low level devices.

I feel like if we can get a few devs / knowledgeable users looking at these settings, that we could identify where in our audio driver the mixer for the MIC is getting off track.

THE GOAL:
Get a small list of mixer changes (tinymix / AlsaMixer) which enable the MIC for use in the OS.
Then I can replicate those in the audio driver.


GAME ON.
 
Last edited:

times_infinity

Senior Member
NOTE: This requires some knowledge of the ALSA subsystem. If you're not comfortable doing this, PLEASE DONT. You can in theory damage the audio hardware with bad settings.

With the migration to Jelly Bean, we can see how powerful having a working MIC would be.

On my latest AOSP Jelly Bear ROM (7/13), I have 3 new binaries so that anyone who is comfortable with the audio system can jump in and help:
tinymix
tinycap
tinyplay

Also, you can install "AlsaMixer" from the Market which gives you a bit of control over the audio system's low level devices.

I feel like if we can get a few devs / knowledgeable users looking at these settings, that we could identify where in our audio driver the mixer for the MIC is getting off track.

THE GOAL:
Get a small list of mixer changes (tinymix / AlsaMixer) which enable the MIC for use in the OS.
Then I can replicate those in the audio driver.


GAME ON.

Perfect person to probably ask for help would be supercurio, although his specialty is wolfson codecs
 

webdroidmt

Senior Member
Dec 20, 2011
1,674
1,156
NJ
NOTE: This requires some knowledge of the ALSA subsystem. If you're not comfortable doing this, PLEASE DONT. You can in theory damage the audio hardware with bad settings.

With the migration to Jelly Bean, we can see how powerful having a working MIC would be.

On my latest AOSP Jelly Bear ROM (7/13), I have 3 new binaries so that anyone who is comfortable with the audio system can jump in and help:
tinymix
tinycap
tinyplay

Also, you can install "AlsaMixer" from the Market which gives you a bit of control over the audio system's low level devices.

I feel like if we can get a few devs / knowledgeable users looking at these settings, that we could identify where in our audio driver the mixer for the MIC is getting off track.

THE GOAL:
Get a small list of mixer changes (tinymix / AlsaMixer) which enable the MIC for use in the OS.
Then I can replicate those in the audio driver.


GAME ON.

This would be great! Btw, is your rom's codename Jelly Bear? :D

Mike T
 

roothorick

Senior Member
May 2, 2012
348
98
I don't think the Google Now crash is related to the microphone....


Here's the logcat I'm getting:
Code:
W/dalvikvm( 3429): threadid=1: thread exiting with uncaught exception (group=0x41199300)
E/AndroidRuntime( 3429): FATAL EXCEPTION: main
E/AndroidRuntime( 3429): java.lang.IllegalArgumentException: requested provider network doesn't exisit
E/AndroidRuntime( 3429): 	at android.os.Parcel.readException(Parcel.java:1429)
E/AndroidRuntime( 3429): 	at android.os.Parcel.readException(Parcel.java:1379)
E/AndroidRuntime( 3429): 	at android.location.ILocationManager$Stub$Proxy.requestLocationUpdates(ILocationManager.java:646)
E/AndroidRuntime( 3429): 	at android.location.LocationManager._requestLocationUpdates(LocationManager.java:660)
E/AndroidRuntime( 3429): 	at android.location.LocationManager.requestLocationUpdates(LocationManager.java:482)
E/AndroidRuntime( 3429): 	at com.google.android.apps.sidekick.inject.SystemLocationManagerInjectable.requestLocationUpdates(SystemLocationManagerInjectable.java:33)
E/AndroidRuntime( 3429): 	at com.google.android.apps.sidekick.LocationOracleImpl.registerForAndroidNlpFix(LocationOracleImpl.java:495)
E/AndroidRuntime( 3429): 	at com.google.android.apps.sidekick.LocationOracleImpl.start(LocationOracleImpl.java:139)
E/AndroidRuntime( 3429): 	at com.google.android.velvet.VelvetApplication.startTgServices(VelvetApplication.java:175)
E/AndroidRuntime( 3429): 	at com.google.android.velvet.tg.FirstRunActivity.completeOptIn(FirstRunActivity.java:350)
E/AndroidRuntime( 3429): 	at com.google.android.velvet.tg.FirstRunActivity$OptInHander.handleMessage(FirstRunActivity.java:421)
E/AndroidRuntime( 3429): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 3429): 	at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 3429): 	at android.app.ActivityThread.main(ActivityThread.java:4745)
E/AndroidRuntime( 3429): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 3429): 	at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 3429): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
E/AndroidRuntime( 3429): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime( 3429): 	at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager(  257):   Force finishing activity com.google.android.googlequicksearchbox/com.google.android.velvet.tg.FirstRunActivity

That doesn't look microphone-related. I think our smoking gun is Wi-Fi location. Unfortunately, disabling location services didn't help :/ Hash, when you get the 2nd part of Wi-Fi location working, try Now and see what it does.
 

Jaimemex

Senior Member
Jan 11, 2010
407
55
I don't think the Google Now crash is related to the microphone....


Here's the logcat I'm getting:
Code:
W/dalvikvm( 3429): threadid=1: thread exiting with uncaught exception (group=0x41199300)
E/AndroidRuntime( 3429): FATAL EXCEPTION: main
E/AndroidRuntime( 3429): java.lang.IllegalArgumentException: requested provider network doesn't exisit
E/AndroidRuntime( 3429): at android.os.Parcel.readException(Parcel.java:1429)
E/AndroidRuntime( 3429): at android.os.Parcel.readException(Parcel.java:1379)
E/AndroidRuntime( 3429): at android.location.ILocationManager$Stub$Proxy.requestLocationUpdates(ILocationManager.java:646)
E/AndroidRuntime( 3429): at android.location.LocationManager._requestLocationUpdates(LocationManager.java:660)
E/AndroidRuntime( 3429): at android.location.LocationManager.requestLocationUpdates(LocationManager.java:482)
E/AndroidRuntime( 3429): at com.google.android.apps.sidekick.inject.SystemLocationManagerInjectable.requestLocationUpdates(SystemLocationManagerInjectable.java:33)
E/AndroidRuntime( 3429): at com.google.android.apps.sidekick.LocationOracleImpl.registerForAndroidNlpFix(LocationOracleImpl.java:495)
E/AndroidRuntime( 3429): at com.google.android.apps.sidekick.LocationOracleImpl.start(LocationOracleImpl.java:139)
E/AndroidRuntime( 3429): at com.google.android.velvet.VelvetApplication.startTgServices(VelvetApplication.java:175)
E/AndroidRuntime( 3429): at com.google.android.velvet.tg.FirstRunActivity.completeOptIn(FirstRunActivity.java:350)
E/AndroidRuntime( 3429): at com.google.android.velvet.tg.FirstRunActivity$OptInHander.handleMessage(FirstRunActivity.java:421)
E/AndroidRuntime( 3429): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 3429): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 3429): at android.app.ActivityThread.main(ActivityThread.java:4745)
E/AndroidRuntime( 3429): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 3429): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 3429): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
E/AndroidRuntime( 3429): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime( 3429): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager(  257):   Force finishing activity com.google.android.googlequicksearchbox/com.google.android.velvet.tg.FirstRunActivity

That doesn't look microphone-related. I think our smoking gun is Wi-Fi location. Unfortunately, disabling location services didn't help :/ Hash, when you get the 2nd part of Wi-Fi location working, try Now and see what it does.

Even if the mic isn't the issue I would still like to see this implemented this would let many more apps function like shazam, voice typing and of course voice search...

Sent from my Amazon Kindle Fire using xda premium
 

Hashcode

Senior Recognized Developer
Sep 3, 2011
3,426
23,732
I don't think the Google Now crash is related to the microphone....


Here's the logcat I'm getting:
Code:
{removed}

That doesn't look microphone-related. I think our smoking gun is Wi-Fi location. Unfortunately, disabling location services didn't help :/ Hash, when you get the 2nd part of Wi-Fi location working, try Now and see what it does.

Ah, I was seeing an "AudioRecord" error talking about trying to use a non-existant device. This error above I can work on.
 

dadeo1111

Senior Member
NOTE: This requires some knowledge of the ALSA subsystem. If you're not comfortable doing this, PLEASE DONT. You can in theory damage the audio hardware with bad settings.

With the migration to Jelly Bean, we can see how powerful having a working MIC would be.

On my latest AOSP Jelly Bean ROM (7/13), I have 3 new binaries so that anyone who is comfortable with the audio system can jump in and help:
tinymix
tinycap
tinyplay

Also, you can install "AlsaMixer" from the Market which gives you a bit of control over the audio system's low level devices.

I feel like if we can get a few devs / knowledgeable users looking at these settings, that we could identify where in our audio driver the mixer for the MIC is getting off track.

THE GOAL:
Get a small list of mixer changes (tinymix / AlsaMixer) which enable the MIC for use in the OS.
Then I can replicate those in the audio driver.


GAME ON.

No ALSA experience other than ticking a box or two on my Puppy Linux install - sure wish I did.

This needs to be nailed down for Jelly Bean to work well.

bump.jpg
 

roothorick

Senior Member
May 2, 2012
348
98
Ah, I was seeing an "AudioRecord" error talking about trying to use a non-existant device. This error above I can work on.

This is purely speculation, but did the other stacktrace come from the 7/11 build? Maybe your half-fix for Wi-Fi location actually broke things, and we actually have TWO blockers here. We won't know for sure until you get location working all the way though.
 
  • Like
Reactions: Jaimemex

chupchae

Senior Member
Jul 24, 2006
82
7
Skopje
chupchae.tumblr.com
Alsa mixer keeps installing

I had no luck trying to experiment with alsa mixer sound variables - I installed it from store successfully, but anytime I leave alsa mixer in a way to check is external mic working with some recording app, when I come back to alsa mixer it demands to be again installed. Someone went further with alsa mixer on Kindle JB?
 
On my latest AOSP Jelly Bean ROM (7/13), I have 3 new binaries so that anyone who is comfortable with the audio system can jump in and help:
tinymix
tinycap
tinyplay

Hi Hash,

I've no idea wether anybody else tried, but I just did on your CM10.1 ROM (actually no nightly, I've build one myself as I wanted to learn more about the build process, but it's very close to the latest nightly). And guess what... 2 minutes into trying... it WORKS!!!!! :good::good::good:

Here's what I did:
tinycap xxx.wav -d 3 -c 1 -r 16000 -b 16

I used some regular white Apple iPhone Headset I had lying around (those with the 4-ring plug and the mic in the vol +/- housing).

Except for trying the other capture devices, I promise... I did nothing else, not even played around with tinymix. -d 3 was important... 0 doesn't have capture and the other capture devices didn't even like these simple settings. Now, let's get the audio routed to Google Voice Search ;).

Best,
STYLON

P.S.: please check out my backlight fix... :D I fear that what we've there now drains the batteries as even though it seems to be off (screen really completely dark), it's not off very often for me.
 

BrooklynNY

Senior Member
Nov 16, 2012
374
85
Hi Hash, I've no idea wether anybody else tried, but I just did on your CM10.1 ROM (actually no nightly, I've build one myself as I wanted to learn more about the build process, but it's very close to the latest nightly). And guess what... 2 minutes into trying... it WORKS!!!!! :good::good::good:
Here's what I did: tinycap xxx.wav -d 3 -c 1 -r 16000 -b 16......
Can it be done with this ROM?
 
Last edited:
A

AndroidSlave

Guest
Hi Hash,

I've no idea wether anybody else tried, but I just did on your CM10.1 ROM (actually no nightly, I've build one myself as I wanted to learn more about the build process, but it's very close to the latest nightly). And guess what... 2 minutes into trying... it WORKS!!!!! :good::good::good:

Here's what I did:
tinycap xxx.wav -d 3 -c 1 -r 16000 -b 16

I used some regular white Apple iPhone Headset I had lying around (those with the 4-ring plug and the mic in the vol +/- housing).

Except for trying the other capture devices, I promise... I did nothing else, not even played around with tinymix. -d 3 was important... 0 doesn't have capture and the other capture devices didn't even like these simple settings. Now, let's get the audio routed to Google Voice Search ;).

Best,
STYLON

P.S.: please check out my backlight fix... :D I fear that what we've there now drains the batteries as even though it seems to be off (screen really completely dark), it's not off very often for me.

I'm not sure hashcode follows this thread anymore...you may want to PM him or try him on another thread

Sent from my GT-N7000 using Tapatalk 2
 

Top Liked Posts

  • There are no posts matching your filters.
  • 30
    NOTE: This requires some knowledge of the ALSA subsystem. If you're not comfortable doing this, PLEASE DONT. You can in theory damage the audio hardware with bad settings.

    With the migration to Jelly Bean, we can see how powerful having a working MIC would be.

    On my latest AOSP Jelly Bean ROM (7/13), I have 3 new binaries so that anyone who is comfortable with the audio system can jump in and help:
    tinymix
    tinycap
    tinyplay

    Also, you can install "AlsaMixer" from the Market which gives you a bit of control over the audio system's low level devices.

    I feel like if we can get a few devs / knowledgeable users looking at these settings, that we could identify where in our audio driver the mixer for the MIC is getting off track.

    THE GOAL:
    Get a small list of mixer changes (tinymix / AlsaMixer) which enable the MIC for use in the OS.
    Then I can replicate those in the audio driver.


    GAME ON.
    11
    It's the part of the Android operating system that interacts directly with the kernel software driver. This piece is changed out (potentially) for each device where the rest of Android's audio system is the same.

    The audio changes aren't just for the MIC alone. I'm working on finishing the kernel 3.4 upgrade and the source in the kernel for the audio codec chip is a complete re-write.
    8
    Hi Stylon,

    Got the PM. I'm buried at the moment developing a 3.4 kernel for the RAZR-HD. However, I did plan to revisit backlight / light sensor changes and the audio issues once I free up. (As well as the 3.4 kernel for the KFire's -- tho it may be a 3.8 kernel by the look of things.)

    Great work on testing the audio input w/ tinycap. :)
    7
    Hi Hash,

    I've no idea wether anybody else tried, but I just did on your CM10.1 ROM (actually no nightly, I've build one myself as I wanted to learn more about the build process, but it's very close to the latest nightly). And guess what... 2 minutes into trying... it WORKS!!!!! :good::good::good:

    Here's what I did:
    tinycap xxx.wav -d 3 -c 1 -r 16000 -b 16

    I used some regular white Apple iPhone Headset I had lying around (those with the 4-ring plug and the mic in the vol +/- housing).

    Except for trying the other capture devices, I promise... I did nothing else, not even played around with tinymix. -d 3 was important... 0 doesn't have capture and the other capture devices didn't even like these simple settings. Now, let's get the audio routed to Google Voice Search ;).

    Best,
    STYLON

    P.S.: please check out my backlight fix... :D I fear that what we've there now drains the batteries as even though it seems to be off (screen really completely dark), it's not off very often for me.

    Thanks, with the changing the device from 2 to 3 (see below) it looks like Google Now will work. I haven't tried any other apps yet, but you can give this a try in device/amazon/otter-common for testing.

    diff --git a/audio/audio_hw.c b/audio/audio_hw.c
    index 22ebe47..7cc597d 100644
    --- a/audio/audio_hw.c
    +++ b/audio/audio_hw.c
    @@ -2245,7 +2245,7 @@ static int start_input_stream(struct omap_stream_in *in)
    {
    int ret = 0;
    unsigned int card = CARD_OMAP_DEFAULT;
    - unsigned int device = PORT_MM2_UL;
    + unsigned int device = PORT_MM_LEGACY;
    struct omap_audio_device *adev = in->dev;
    unsigned int vx_rec_ul_on = (in->source == AUDIO_SOURCE_VOICE_UPLINK) ||
    (in->source == AUDIO_SOURCE_VOICE_CALL);

    and use the audio_policy.conf from the audio directory.

    Attached is a zip for those interested in testing.
    6
    I don't think the Google Now crash is related to the microphone....


    Here's the logcat I'm getting:
    Code:
    {removed}

    That doesn't look microphone-related. I think our smoking gun is Wi-Fi location. Unfortunately, disabling location services didn't help :/ Hash, when you get the 2nd part of Wi-Fi location working, try Now and see what it does.

    Ah, I was seeing an "AudioRecord" error talking about trying to use a non-existant device. This error above I can work on.