stereo recording on Nexus 4

942 views
Skip to first unread message

JC

unread,
Apr 30, 2013, 1:26:18 PM4/30/13
to android-...@googlegroups.com
Hi,

I'm trying to work with some audio effects on the Nexus 4, where i use both mics for input.  I've done similar on the Galaxy Nexus, however the MSM chipset is architected quite differently.

i've been making my own msm kernel playing around with the configuration of channels, etc. but I'm not getting too far, although i have managed to break the capture path entirely...

anyway, I'm wondering if anyone can provide me any insight how to enable both input channels.


I have performed some tests on the factory images & even with the camcorder, the 'camcorder' mic defaults to the bottom.  

thanks,

jonathan

JC

unread,
May 11, 2013, 7:58:11 AM5/11/13
to android-...@googlegroups.com
As an update.

Stereo Recording is possible on a Nexus 4, however, not in the current Android ALSA framework presented.  I was able to get a stereo recording using amix/arec, but I had to manually set the audio paths.

I have since started to investigate the audio paths within hadware/qcom/audio to figure out how to get my specific paths added.

as a note, the kernel requires no changes, as the codec/slimbus/etc are all seem to configured properly & seem to work.

thanks,

-jc

sepp974

unread,
Jul 17, 2013, 5:16:00 PM7/17/13
to android-...@googlegroups.com
Hello,
can you explain to me what I must to do for recording in stereo on my Nexus 4? I'm very disappoint video are in mono. I change settings on file media_profiles but I can only change bitrate video and audio but not recording channels.
My nexus is rooted

Thanks for any help

Glenn Kasten

unread,
Jul 22, 2013, 11:00:56 AM7/22/13
to android-...@googlegroups.com
I believe that the microphones on this devices are not positioned for stereo recording, that this they are not symmetric left/right. I think that they're located for other use cases - such as camcorder vs. phone, or telephony noise reduction.

sepp974

unread,
Jul 22, 2013, 11:21:05 AM7/22/13
to android-...@googlegroups.com
I changed some settings on the file media_profiles.xml in system\etc:

audio bitrate from 96k to 288k
channels from "1" to "2"

-<EncoderProfile duration="30" fileFormat="mp4" quality="720p"> <Video frameRate="30" height="720" width="1280" bitRate="8000000" codec="h264"/> <Audio bitRate="288000" codec="aac" channels="2" sampleRate="48000"/> </EncoderProfile>

and maxChannels from "1" to "2"

<AudioEncoderCap name="aac" maxBitRate="288000" minBitRate="758" enabled="true" maxChannels="2" minChannels="1" maxSampleRate="48000" minSampleRate="8000"/>

now in the property of my video it seems recorded on "stereo", like you see in attachment image

Anyone can make some test to understand if video is really in stereo?

I attach my new "media_profiles.xml".

Please help me :) 
media_profiles.rar

Neetha Das

unread,
Dec 20, 2013, 10:08:54 AM12/20/13
to android-...@googlegroups.com, giuseppe.l...@gmail.com
Hi,

I am trying to change media_profiles.xml file on my nexus 4 to make the maxchannels = 2, but it does not allow me to save showing 'Error while saving'. Please suggest what I should do to solve this issue.

Regards,
Neetha

Neetha Das

unread,
Dec 22, 2013, 1:30:49 AM12/22/13
to android-...@googlegroups.com, giuseppe.l...@gmail.com
Hi all, with some help and Terminal emulator, I was able to edit the file, and change Maxchannels = 2. However while recording using AudioRecord class in Eclipse SDK, the data is still the same for Left and Right channels. Is this because it is raw data, whereas media_profiles.xml defines properties for compressed data?

I am stuck now, since I need raw data from each of the 2 mics separately for my signal processing. Please help!

Yan Wang

unread,
May 12, 2014, 3:01:48 AM5/12/14
to android-...@googlegroups.com
Would you mind tell us where to modify?

Priya Singh

unread,
Jun 16, 2015, 12:42:23 PM6/16/15
to android-...@googlegroups.com
Hello ! 

I am working on a similar project. Can anyone please help me out on how to record audio from both mics of phone using android. Moreover  I don't even know which phones support this. Please help me ! I am stuck since many days and I need to accomplish this task.
Reply all
Reply to author
Forward
0 new messages