[Samsung Gear 2] biktor_gj:
Slowly getting back in business

Hi everyone,

Now that I have things more or less reorganized, I'm slowly getting back to work. Yesterday I spent a good time debugging the stupid translate app. It crashes because it doesn't open the microphone! Better than explaining it, I will show you (PG is the translate app):

This is when you activate a voice search:

V/AudioHardwareSample( 1331): AudioHardwareSample::openInputStream(devices=80000004h)
V/AudioStreamInSample( 1331): AudioStreamInSample::AudioStreamInSample() +
V/AudioStreamInSample( 1331): AudioStreamInSample::AudioStreamInSample() -
V/AudioStreamInSample( 1331): AudioStreamInSample::set(format=1, channels=16, samplingRate=8000)
I/AudioStreamInSample( 1331): set pcmConfig.mSamplingRate 48000, out samplerate 48000
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::setStreamConfig(channels=2, samplingRate=48000, format=1)
I/AudioStreamInSample( 1331): virtual android::status_t android::AudioStreamInSample::set(int*, uint32_t*, uint32_t*) mChannels:12 mSamplingRate:8000 mFormat:1 mPeriodSize:960
V/AudioStreamInSample( 1331): create_resampler mSamplingRate:8000 AUDIO_HW_IN_SAMPLERATE:48000 channelCount():2 mPeriodSize:960
I/AudioFlinger( 1331): AudioFlinger's thread 0x42d4a008 ready to run
V/AudioStreamInSample( 1331): AudioStreamInSample::standby()
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::standby()
V/AudioStreamInSample( 1331): AudioStreamInSample::standby()
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::standby()
I/Sensors ( 1657): AccSensor (0) old sensor_state 2228224, new sensor_state : 2228225 en : 1
[B]V/AudioStreamInSample( 1331): AudioStreamInSample::setParameters(keyValuePairs="input_source=6;routing=-2147483644")
I/samsungRecord( 1331): [samsungrecord] SamsungRecInit
I/samsungRecord( 1331): [samsungrecordMIC]Use HardCoding Values
I/samsungRecord( 1331): 1[/B]
I/AudioHardwareSample( 1331): AudioHardwareSample::setInputInfo(0x80000004, 0x6) +
V/AudioHardwareSample( 1331): setProcType(6,0)
I/AudioHardwareSample( 1331): AudioHardwareSample::doRouting() for CAPTURE mode:0 dev:0x80000004
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::setRoute(mode=0, device=80000004h, source=6)
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::_update_route(state=(null), mode=0, device=80000004h, source=6
V/yamaha::media::PcmCtrlImpl( 1331): direction=CAPTURE
V/yamaha::media::PcmCtrlImpl( 1331): old_scenario_name=""
V/yamaha::media::PcmCtrlImpl( 1331): new_scenario_name=""
V/yamaha::media::PcmCtrlImpl( 1331): Same scenario as old.
I/AudioHardwareSample( 1331): AudioHardwareSample::setInputInfo(0x80000004, 0x6) -
V/AudioHardwareSample( 1331): AudioHardwareSample::getInfo()
V/AudioStreamInSample( 1331): start_input_stream
V/AudioStreamInSample( 1331): start_input_stream(): period_size:[960],period_count:[4]
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::_update_route(state=1, mode=(null), device=(null), source=(null)
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::_get_scenario_name(state=1, mode=0, device=80000004h, source=6)
V/yamaha::media::Manager( 1331): Manager::getInstance()
I/AudioHardwareSample( 1331): makeInputName(direction=1, mode=0, outputDevice=2h, inputDevice=80000004h, source=6, samplingRate=48000, playing=false, capturing=true, incallRate=0, streams=0x0)
V/AudioHardwareSample( 1331): Input(AndroidCapture_VoiceSearch_MainMic_Normal)
V/yamaha::media::PcmCtrlImpl( 1331): direction=CAPTURE
V/yamaha::media::PcmCtrlImpl( 1331): old_scenario_name=""
V/yamaha::media::PcmCtrlImpl( 1331): new_scenario_name="AndroidCapture_VoiceSearch_MainMic_Normal"
V/yamaha::media::PcmCtrlImpl( 1331): old_scenario_group=(no group)
V/yamaha::media::PcmCtrlImpl( 1331): Begin setting the scenario. ("AndroidCapture_VoiceSearch_MainMic_Normal")
V/yamaha::media::PcmCtrlImpl( 1331): End setting the scenario.
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::_open(force=0)
V/yamaha::media::Manager( 1331): Manager::getInstance()
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::_update_route(state=(null), mode=(null), device=(null), source=(null)
V/yamaha::media::PcmCtrlImpl( 1331): direction=PLAYBACK
V/yamaha::media::PcmCtrlImpl( 1331): old_scenario_name=""
V/yamaha::media::PcmCtrlImpl( 1331): new_scenario_name=""
V/yamaha::media::PcmCtrlImpl( 1331): Same scenario as old.

Then, when you try to use the translate app, each time it faults on something different, but always at the same time, for example:

D/TaskPersister( 1657): removeObsoleteFile: deleting file=169_task.xml
D/[PG/<init>/2618]( 4205): Use s2s?, false
D/[PG/<init>/2619]( 4205): URL(down), https://www.google.com/m/voice-search/down?pair=
D/[PG/<init>/2620]( 4205): URL(up), https://www.google.com/m/voice-search/up?pair=
E/EventLogger( 4205): No EventLoggerStore set on EventLogger, event will be ignored.Initialize EventLogger in your Application#onCreate method
D/ClockworkProxy( 1785): doAccept: Create socket stream 6 for TCP connection from /192.168.167.239:58973 to /212.142.160.251:443
D/ClockworkProxy( 1785): doAccept: rpc succeeded. Activate stream 6
D/ClockworkProxy( 1785): doAccept: Create socket stream 7 for TCP connection from /192.168.167.239:53136 to /212.142.160.251:443
D/ClockworkProxy( 1785): doAccept: rpc succeeded. Activate stream 7
I/art ( 4205): Background partial concurrent mark sweep GC freed 10568(498KB) AllocSpace objects, 0(0B) LOS objects, 22% free, 7MB/9MB, paused 3.324ms total 110.477ms
E/EventLogger( 4205): No EventLoggerStore set on EventLogger, event will be ignored.Initialize EventLogger in your Application#onCreate method
V/AudioHardwareSample( 1331): AudioHardwareSample::getInputBufferSize(sampleRate=8000, format=1, channelCount=1)
V/AudioHardwareSample( 1331): AudioHardwareSample::openInputStream(devices=80000004h)
V/AudioStreamInSample( 1331): AudioStreamInSample::AudioStreamInSample() +
V/AudioStreamInSample( 1331): AudioStreamInSample::AudioStreamInSample() -
V/AudioStreamInSample( 1331): AudioStreamInSample::set(format=1, channels=16, samplingRate=8000)
I/AudioStreamInSample( 1331): set pcmConfig.mSamplingRate 48000, out samplerate 48000
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::setStreamConfig(channels=2, samplingRate=48000, format=1)
I/AudioStreamInSample( 1331): virtual android::status_t android::AudioStreamInSample::set(int*, uint32_t*, uint32_t*) mChannels:12 mSamplingRate:8000 mFormat:1 mPeriodSize:960
V/AudioStreamInSample( 1331): create_resampler mSamplingRate:8000 AUDIO_HW_IN_SAMPLERATE:48000 channelCount():2 mPeriodSize:960
I/AudioFlinger( 1331): AudioFlinger's thread 0x42d4a008 ready to run
V/AudioStreamInSample( 1331): AudioStreamInSample::standby()
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::standby()
V/AudioStreamInSample( 1331): AudioStreamInSample::standby()
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::standby()
[B]F/libc ( 4205): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x280005 in tid 4241 (AudioTrack)[/B]

Here's another one:

V/AudioStreamInSample( 1331): create_resampler mSamplingRate:8000 AUDIO_HW_IN_SAMPLERATE:48000 channelCount():2 mPeriodSize:960
I/AudioFlinger( 1331): AudioFlinger's thread 0x42d4a008 ready to run
V/AudioStreamInSample( 1331): AudioStreamInSample::standby()
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::standby()
V/AudioStreamInSample( 1331): AudioStreamInSample::standby()
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::standby()
[B]W/AudioTrack( 4131): AUDIO_OUTPUT_FLAG_OFFLOAD denied by server[/B]

This is on a fresh boot (no other apps have accessed the audio before)

V/AudioHardwareSample( 1331): AudioHardwareSample::getInputBufferSize(sampleRate=8000, format=1, channelCount=1)
V/AudioHardwareSample( 1331): AudioHardwareSample::openInputStream(devices=80000004h)
V/AudioStreamInSample( 1331): AudioStreamInSample::AudioStreamInSample() +
V/AudioStreamInSample( 1331): AudioStreamInSample::AudioStreamInSample() -
V/AudioStreamInSample( 1331): AudioStreamInSample::set(format=1, channels=16, samplingRate=8000)
I/AudioStreamInSample( 1331): set pcmConfig.mSamplingRate 48000, out samplerate 48000
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::setStreamConfig(channels=2, samplingRate=48000, format=1)
I/AudioStreamInSample( 1331): virtual android::status_t android::AudioStreamInSample::set(int*, uint32_t*, uint32_t*) mChannels:12 mSamplingRate:8000 mFormat:1 mPeriodSize:960
V/AudioStreamInSample( 1331): create_resampler mSamplingRate:8000 AUDIO_HW_IN_SAMPLERATE:48000 channelCount():2 mPeriodSize:960
I/AudioFlinger( 1331): AudioFlinger's thread 0x42e40008 ready to run
V/AudioStreamInSample( 1331): AudioStreamInSample::standby()
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::standby()
V/AudioStreamInSample( 1331): AudioStreamInSample::standby()
V/yamaha::media::PcmCtrlImpl( 1331): PcmCtrlImpl::standby()
[B]F/libc ( 2850): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x280005 in tid 2879 (MicrophoneReade)[/B]

Now I'm still not sure why Samsung rec init function is not being called, but I'm pretty sure that the translate app crashing is because *this* is not being called in time:

V/AudioStreamInSample( 1331): AudioStreamInSample::setParameters(keyValuePairs="input_source=6;routing=-2147483644")
I/samsungRecord( 1331): [samsungrecord] SamsungRecInit
I/samsungRecord( 1331): [samsungrecordMIC]Use HardCoding Values
I/samsungRecord( 1331): 1

On the G Watch R (pretty glad I didn't get rid of it, it's coming handy with this) at the same point it says "AudioTrack_released" or something like that (don't have the log at hand right now), so something in audioflinger is not being called as it should, or the audio.primary library is not responding what it needs to... Will keep digging...

Have a good day!