Hello, everyoneI am in debugging mic recording function. The platform is am3517evm. The system is TI-Android-GingerBread-2.3.4-DevKit-2.1.In the Linux file system, use the following command to test, it is easy to use.[root@ContecARM /]# amixer -c 0 sset 'Mic Input',0 100%,100% unmute cap [root@ContecARM /]#arecord -d 10 -f cd -t wav 1.wav[root@ContecARM /]#aplay foobar.wavBut in the Android file system, i use the SoundRecorder UI application to test, I can't record the sound.The log is:0334.log.txt
Hi,
From the log, I could see
permission denied for "/etc/dbus.conf"
Kindly give proper permission to this file
chmod 777 /etc/dbus.conf ( one can add this line to init.rc file to make the change permanent)
BR,
Satish
Kindly click the verify answer button on this post if it answer your question.
Hi,Satish
Thank you very much for your replyNow I can use the SoundRecorder application for recording sound. But there is a new problem, When I play back the recorded files, sound is very small.# alsa_amixer contentsnumid=3,iface=MIXER,name='Line Input Switch' ; type=BOOLEAN,access=rw------,values=2 : values=on,onnumid=4,iface=MIXER,name='Line Input Volume' ; type=INTEGER,access=rw---R--,values=2,min=0,max=31,step=0 : values=23,23 | dBscale-min=-17.25dB,step=0.75dB,mute=0numid=6,iface=MIXER,name='Mic Booster Switch' ; type=BOOLEAN,access=rw------,values=1 : values=offnumid=5,iface=MIXER,name='Mic Input Switch' ; type=BOOLEAN,access=rw------,values=1 : values=onnumid=12,iface=MIXER,name='Capture Source' ; type=ENUMERATED,access=rw------,values=1,items=2 ; Item #0 'Line' ; Item #1 'Mic' : values=1numid=8,iface=MIXER,name='Playback De-emphasis' ; type=ENUMERATED,access=rw------,values=1,items=4 ; Item #0 'None' ; Item #1 '32Khz' ; Item #2 '44.1Khz' ; Item #3 '48Khz' : values=2numid=2,iface=MIXER,name='Digital Playback Switch' ; type=BOOLEAN,access=rw------,values=1 : values=offnumid=1,iface=MIXER,name='Digital Playback Volume' ; type=INTEGER,access=rw---R--,values=2,min=0,max=127,step=0 : values=0,111 | dBscale-min=-121.00dB,step=1.00dB,mute=0numid=9,iface=MIXER,name='Output Mixer Line Bypass Switch' ; type=BOOLEAN,access=rw------,values=1 : values=offnumid=10,iface=MIXER,name='Output Mixer Mic Sidetone Switch' ; type=BOOLEAN,access=rw------,values=1 : values=offnumid=11,iface=MIXER,name='Output Mixer Playback Switch' ; type=BOOLEAN,access=rw------,values=1 : values=onnumid=7,iface=MIXER,name='Sidetone Volume' ; type=INTEGER,access=rw---R--,values=1,min=0,max=4,step=0 : values=3 | dBscale-min=-18.00dB,step=3.00dB,mute=0#
Kindly look for alsa-mixer settings, which can increase recording amplitude. I do not have much idea on that.
Also, see if media volumme is proper. Play some media from music player and check the volumme.
satish
I think my problem is due to the sampling frequency and the number of channels is not set correctly. I try to modify the alsa_module.cpp, set the sampling frequency of 44100Hz, channel number is 2, but it failed. Log is 0511.log.txtI want to know how to modify them in the Android file system ?
Have you checked the porting guide?
http://processors.wiki.ti.com/index.php/TI-Android-GingerBread-2.3.4-DevKit-2.1_PortingGuides#Android_Audio_HAL_Configuration
--------------------------------------------------------------------------------------------------------- Please click the Verify Answer button on this post if it answers your question.---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
Please click the Verify Answer button on this post if it answers your question.---------------------------------------------------------------------------------------------------------
Hi,Vishveshwar
Thank you very much for your reply.
I have checked that porting guide.
1.I have tested it using ALSA utilities. It worked well. # ln -s /system/bin/alsa_aplay /system/bin/alsa_arecord # alsa_amixer -c 0 sset 'Mic Input',0 100%,100% unmute cap Simple mixer control 'Mic Input',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] # # alsa_arecord -f cd | alsa_aplay Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo ^CAborted by signal Interrupt... Aborted by signal Interrupt... #
2.Alsa_module.cpp file is modified as follows: 447 void setDefaultControls(uint32_t devices, int mode)448 {449 LOGV("%s", __FUNCTION__);450 ALSAControl control("hw:00");451 452 /* check whether the devices is input or not */453 /* for output devices */454 if (devices & 0x0000FFFF){455 if (devices & AudioSystem::DEVICE_OUT_SPEAKER) {456 //control.set("HeadsetR Mixer AudioR1", 1); // on457 //control.set("HeadsetL Mixer AudioL1", 1); // on458 //control.set("Headset Playback Volume", 1); //Headset Volume459 control.set("Output Mixer Playback Switch", 1); // on460 control.set("Digital Playback Switch", 1); // on461 control.set("Digital Playback Volume", 127); // Volume462 LOGE("*******output mixer playback switcaaaaabbbbbb*******");463 } else {464 //control.set("HeadsetR Mixer AudioR1", (unsigned int)0); // off465 //control.set("HeadsetL Mixer AudioL1", (unsigned int)0); // off466 control.set("Digital Playback Switch", (unsigned int)0); // off467 control.set("Output Mixer Playback Switch", (unsigned int)0); // off468 469 }470 }471 472 /* for input devices */473 if (devices >> 16) {474 if (devices & AudioSystem::DEVICE_IN_BUILTIN_MIC) {475 //change wu476 //control.set("Analog Left AUXL Capture Switch", 1); //on477 //control.set("Analog Right AUXR Capture Switch", 1); //on478 //control.set("Analog Capture Volume", (unsigned int)0); //Capture volume '0' to capture less noice479 control.set("Mic Input Switch", 1); //on480 control.set("Mic Booster Switch", 1); //on481 LOGE("*******output mixer playback switcccccccddddddddd*********");482 //change wu end483 } else {484 //control.set("Analog Left AUXL Capture Switch", (unsigned int)0); //off485 //control.set("Analog Right AUXR Capture Switch", (unsigned int)0); //off486 control.set("Mic Booster Switch", (unsigned int)0); //on487 control.set("Mic Input Switch", (unsigned int)0); //off488 }489 }490 } In this case I can record, but the sound is very small, and there is noise. In addition, Sometimes mclk = 12000000, sample_rate_adc = 8000, sample_rate_dac = 44100 When this happens,Recording time for 10s ,Play time for 30s or longer,and there is no sound.I don't know why this happens. 3.Now, I want to put the sampling frequency to 44100Hz.I modify the following files: 1)TI_Android_GingerBread_2_3_4Sources/device/ti/am3517evm/BoardConfig.mk 11 #add 12 ALSA_DEFAULT_SAMPLE_RATE := 44100 2)TI_Android_GingerBread_2_3_4Sources/frameworks/base/include/media/AudioRecord.h 41 //change 42 //static const int DEFAULT_SAMPLE_RATE = 8000; 43 static const int DEFAULT_SAMPLE_RATE = 44100; After modification, phenomenon is still the same,I don't known how to put the sampling frequency to 44100Hz.
AFAIK the stock AOSP code (from which TI Android DevKit is derived) supports only 8kHz sampling rate for recording. You may need some changes in frameworks to support 44.1kHz sampling rate for mic input.
Suggest you to look at omapzoom Android for this.
So in the Android-GingerBread-2.3.4-Devkit-2.1 which is the latest version for AM3517, the sampling rate is 8kHz? Could you give us some guideline for framework changing for adding 44.1kHz support, such as which file we should modify, or provide the git path for omapzoom Android .
The omapzoom android sources are available at: http://git.omapzoom.org/
You should probably look at the p-gingerbread branches in frameworks/base, hardware/ti/omap3 etc
If you need any further help on this you can refer their wiki pages at: http://www.omappedia.com/wiki/OMAP_Android_Main
Hi Vishveshwar,
Thanks a lot for your great help!
Thanks for all your help.
Now I have another urgent task. Later I will debug it refer to the links you provided, and explain the result.