diepquynh / android_device_samsung_vivalto3gvn

Device tree for Samsung Galaxy V SM-G313HZ
4 stars 20 forks source link

Audio recording not work. #9

Closed ngoquang2708 closed 8 years ago

ngoquang2708 commented 8 years ago

May be this issue related to phone call not work.

ngoquang2708 commented 8 years ago

I think this issue relates to permissions. Because we can receive incoming call, that mean that the audio recording is working.

ngoquang2708 commented 8 years ago

I will try to look into stock init.rc to find out what permissions are difference from CM one.

diepquynh commented 8 years ago

Of course, it's answerable

ngoquang2708 commented 8 years ago

Int stock init.rc, mediaserver service has system group, in CM, it does not. When add system group to mediaserver in CM init.rc, mediaserver failed to detected the sound card! It is not supported to go that way, because it has more privilege than before. So why adding system group make it fail?

diepquynh commented 8 years ago

Our stock is completely broken. It just does what it wants, like RIL. Our sound works perfectly so i think there's no need to set mediaserver at system group.

ngoquang2708 commented 8 years ago

But when recording audio, logcat split out this thing:

I/MediaFocusControl( 512): AudioFocus requestAudioFocus() from android.media.AudioManager@425f2990com.android.soundrecorder.SoundRecorder$4@425e12c8 E/Recorder( 2141): audiosourcetype 1 D/AudioPolicyManagerBase( 1791): getInput() inputSource 1, samplingRate 8000, format 1, channelMask 10, acoustics 0 E/AudioRecord( 1791): Could not get audio input for record source 1 D/AudioSource( 1791): Start autoramp from 500000 E/StagefrightRecorder( 1791): audio source is not initialized E/MediaRecorder( 2141): start failed: -2147483648

ngoquang2708 commented 8 years ago

When change CM init.rc to stock init.rc, sound work! (and mediaserver has system group, of couse)

diepquynh commented 8 years ago

Problem with the libstagefright: E/StagefrightRecorder( 1791): audio source is not initialized

ngoquang2708 commented 8 years ago

I have just found a way to make audio rec to work. I will do some check to ensure that it works in our current code base.

diepquynh commented 8 years ago

OK

ngoquang2708 commented 8 years ago

What the f*ck is this?

I/AudioPolicyService(  131): Loaded audio policy from Samsung hawaii audio policy HAL (audio_policy)
diepquynh commented 8 years ago

Hmm... it seems that comes from the property from build.prop It uses hawaii's policy (hawaii is G313HN/HU board)

ngoquang2708 commented 8 years ago

This issue is now resolved by PR #26

ngoquang2708 commented 8 years ago

After make this to work, I confirm that this issue is not relate to #6 phone call not working issue. Sorry for making many assumtions before.

diepquynh commented 8 years ago

Everybody got their false,man Dat phone calls refers to RIL, which requires many things to work

ngoquang2708 commented 8 years ago

It seems mint's guys encountered this RIL problem too. I see they are working hard on it.

diepquynh commented 8 years ago

Yeah, mint is a Spreadtrum phone too He said RIL is working on hardware level (IMEI,signals,etc), but needs to be configured in Sammy/SPRD's way to get it fully working

ngoquang2708 commented 8 years ago

Waiting for his works :D

diepquynh commented 8 years ago

Hmm... i got bootloop when commit this change

ngoquang2708 commented 8 years ago

What change?

diepquynh commented 8 years ago

Audio policy

ngoquang2708 commented 8 years ago

Try a clean build. I encountered it too, but it works after a clean build.

ngoquang2708 commented 8 years ago

May be something doesn't recompile with new config.

diepquynh commented 8 years ago

Damn, 2hrs more :( Anyway, i've not tested yet because of bootloop, but try disabling CONFIG_SENSOR_OUTPUT_YUV to see if camera works

ngoquang2708 commented 8 years ago

Don't forget to regenerate vendor folder

diepquynh commented 8 years ago

Yes, already

ngoquang2708 commented 8 years ago

I will try it when I have free time :D

diepquynh commented 8 years ago

It's kernel defconfig, so it's pretty fast to compile

ngoquang2708 commented 8 years ago

Okay

diepquynh commented 8 years ago

Gotta get some sleeps :D

ngoquang2708 commented 8 years ago

It doesn't work.

diepquynh commented 8 years ago

Confirmed

ngoquang2708 commented 8 years ago

Sprd_dcam have less source code than mint kernel one

diepquynh commented 8 years ago

IDK, just digging it :D But mint is 2mp and ours is 3mp

diepquynh commented 8 years ago

Damn, it crashes mediaserver with stock blob How did you get it works?

ngoquang2708 commented 8 years ago

I committed all my works, try compare all my repo with yours.

diepquynh commented 8 years ago

Nothing conflicts, but why it still crash?

ngoquang2708 commented 8 years ago

I have no idea

ngoquang2708 commented 8 years ago

Logcat would help.

diepquynh commented 8 years ago

Well, accidentally deleted logfile But i remember it gives me a lot of backtraces, including audio_policy.scx15.so

ngoquang2708 commented 8 years ago

Very easily to regenerate it.

diepquynh commented 8 years ago

OK, log here: https://pastee.org/z95r8

ngoquang2708 commented 8 years ago

I have no idea. It looks like mine before.

ngoquang2708 commented 8 years ago

I make a clean build, and audio recoding is still working, why don't yours?

diepquynh commented 8 years ago

Idk, typo or sth make it derp?

ngoquang2708 commented 8 years ago

Does it working now?

diepquynh commented 8 years ago

Still dead

diepquynh commented 8 years ago

Sound is dead again

ngoquang2708 commented 8 years ago

Now try remove audio_policy.scx15.so to see what happen.

diepquynh commented 8 years ago

I already tried, missing -DMR0_AUDIO_BLOB in BoardConfig.mk makes audio dead Just wondering why stock blob works with you, not me