Hi,
I can not record voice, but playback well, too.
I had downloaded the alsa-lib and alsa_sound with repo.
Then turn on BOARD_USES_ALSA_AUDIO := true at asus/eee_701/
BoardConfig.mk.
I've created asound.conf into /system/etc/ on the Android disk.
I can find "Initialized ALSA PLAYBACK device AndroidPlayback" and
"Initialized ALSA PLAYBACK device AndroidPlayback_Speaker_normal" on
locat,
but don't find "Initialized ALSA CAPTURE device".
I assume maybe need to initialize CAPTURE device.
Who can tell me how to initialize CAPTURE device or
how to solve that can not record voice issue? Thanks a lot.
My platform is menlo. Android version is 1.5.
logcat as follows:
D/AndroidRuntime( 1661): >>>>>>>>>>>>>> AndroidRuntime START
<<<<<<<<<<<<<<
D/AndroidRuntime( 1661): CheckJNI is OFF
I/ ( 1662): ServiceManager: 0x804ac38
D/AudioHardwareALSA( 1662): Mixer: element name: 'Master'
D/AudioHardwareALSA( 1662): Mixer: element name: 'Front'
D/AudioHardwareALSA( 1662): Mixer: master 'Front' found.
D/AudioHardwareALSA( 1662): Mixer: route 'Master' found.
D/AudioHardwareALSA( 1662): Mixer: route 'Master' found.
D/AudioHardwareALSA( 1662): Mixer: route 'Bluetooth' not found.
D/AudioHardwareALSA( 1662): Mixer: route 'Master' found.
D/AudioHardwareALSA( 1662): Mixer: route 'Bluetooth A2DP' not found.
D/AudioHardwareALSA( 1662): Mixer: element name: 'Mic Boost'
D/AudioHardwareALSA( 1662): Mixer: element name: 'Capture'
D/AudioHardwareALSA( 1662): Mixer: master 'Capture' found.
D/AudioHardwareALSA( 1662): Mixer: route 'Capture' found.
D/AudioHardwareALSA( 1662): Mixer: route 'Bluetooth Capture' not
found.
D/AudioHardwareALSA( 1662): Mixer: route 'Capture' found.
D/AudioHardwareALSA( 1662): Mixer: route 'Bluetooth A2DP Capture' not
found.
D/AudioHardwareALSA( 1662): mixer initialized.
D/dalvikvm( 1661): DexOpt: --- BEGIN 'core.jar' (bootstrap=1) ---
I/AudioHardwareALSA( 1662): Initialized ALSA PLAYBACK device
AndroidPlayback
D/AudioHardwareALSA( 1662): Set PLAYBACK PCM format to S16_LE (Signed
16 bit Little Endian)
D/AudioHardwareALSA( 1662): Using 2 channels for PLAYBACK.
D/AudioHardwareALSA( 1662): Set PLAYBACK sample rate to 44100 HZ
D/AudioHardwareALSA( 1662): Buffer size: 16384
D/AudioHardwareALSA( 1662): Latency: 371519
I/AudioFlinger( 1662): AudioFlinger's thread ready to run for output 0
I/AudioHardwareALSA( 1662): Initialized ALSA PLAYBACK device
AndroidPlayback_Speaker_normal
D/AudioHardwareALSA( 1662): Set PLAYBACK PCM format to S16_LE (Signed
16 bit Little Endian)
D/AudioHardwareALSA( 1662): Using 2 channels for PLAYBACK.
D/AudioHardwareALSA( 1662): Set PLAYBACK sample rate to 44100 HZ
D/AudioHardwareALSA( 1662): Buffer size: 16384
D/AudioHardwareALSA( 1662): Latency: 371519
asound.conf:
# Android ALSA configuration file for the vmware ( Ensoniq ES1371)
##
## Mixer Devices
##
ctl.AndroidPlayback {
type hw
card 0 # Can replace with driver"s name from /proc/asound/
cards
}
ctl.AndroidRecord {
type hw
card 0 # Can replace with driver"s name from /proc/asound/
cards
}
##
## Playback Devices
##
pcm.AndroidPlayback {
type hooks
slave.pcm {
type hw
card 0
device 0 # Must be of type "digital audio playback"
}
hooks.0 {
type ctl_elems
hook_args [
{
name 'Front Playback Volume'
value.0 25
value.1 25
}
{
name 'Front Playback Switch'
value.0 true
value.1 true
}
{
name 'Headphone Playback Switch'
value.0 true
value.1 true
}
{
name 'Mic Playback Volume'
value.0 0
value.1 0
}
{
name 'Mic Playback Switch'
value.0 false
value.1 false
}
{
name 'Mic Boost'
value.0 0
value.1 0
}
{
name 'Capture Volume'
value.0 0
value.1 0
}
{
name 'Capture Switch'
value.0 true
value.1 true
}
{
name 'Input Source'
value Mic
}
{
name 'Master Playback Volume'
value 31
}
{
name 'Master Playback Switch'
value true
}
]
}
}
pcm.AndroidPlayback_Speaker_normal {
type hooks
slave.pcm {
type hw
card 0
device 0 # Must be of type "digital audio playback"
}
hooks.0 {
type ctl_elems
hook_args [
{
name 'Front Playback Volume'
value.0 25
value.1 25
}
{
name 'Front Playback Switch'
value.0 true
value.1 true
}
{
name 'Headphone Playback Switch'
value.0 true
value.1 true
}
{
name 'Mic Playback Volume'
value.0 0
value.1 0
}
{
name 'Mic Playback Switch'
value.0 false
value.1 false
}
{
name 'Mic Boost'
value.0 0
value.1 0
}
{
name 'Capture Volume'
value.0 0
value.1 0
}
{
name 'Capture Switch'
value.0 true
value.1 true
}
{
name 'Input Source'
value Mic
}
{
name 'Master Playback Volume'
value 31
}
{
name 'Master Playback Switch'
value true
}
]
}
}
##
## Recording device
##
pcm.AndroidRecord {
type hooks
slave.pcm {
type hw
card 0
device 0 # Must be of type "digital audio capture"
}
hooks.0 {
type ctl_elems
hook_args [
{
name 'Front Playback Volume'
value.0 25
value.1 25
}
{
name 'Front Playback Switch'
value.0 true
value.1 true
}
{
name 'Headphone Playback Switch'
value.0 true
value.1 true
}
{
name 'Mic Playback Volume'
value.0 0
value.1 0
}
{
name 'Mic Playback Switch'
value.0 false
value.1 false
}
{
name 'Mic Boost'
value.0 0
value.1 0
}
{
name 'Capture Volume'
value.0 0
value.1 0
}
{
name 'Capture Switch'
value.0 true
value.1 true
}
{
name 'Input Source'
value Mic
}
{
name 'Master Playback Volume'
value 31
}
{
name 'Master Playback Switch'
value true
}
]
}
}
pcm.AndroidRecord_Microphone {
type hooks
slave.pcm {
type hw
card 0
device 0 # Must be of type "digital audio capture"
}
hooks.0 {
type ctl_elems
hook_args [
{
name 'Front Playback Volume'
value.0 25
value.1 25
}
{
name 'Front Playback Switch'
value.0 true
value.1 true
}
{
name 'Headphone Playback Switch'
value.0 true
value.1 true
}
{
name 'Mic Playback Volume'
value.0 0
value.1 0
}
{
name 'Mic Playback Switch'
value.0 false
value.1 false
}
{
name 'Mic Boost'
value.0 0
value.1 0
}
{
name 'Capture Volume'
value.0 0
value.1 0
}
{
name 'Capture Switch'
value.0 true
value.1 true
}
{
name 'Input Source'
value Mic
}
{
name 'Master Playback Volume'
value 31
}
{
name 'Master Playback Switch'
value true
}
]
}
}
On 5月5日, 下午9時31分, l hx <[email protected]> wrote:
> i also found this matter,but when i delete "(int)buffer.frameCount ==
> inFrameCount" in AudioFlinger.cpp.I can not recording the audio too. maybe
> the matter is the below log: "D/AudioHardwareALSA( 49 Unable to set
> channel count to ". who know why?
> i just use the alsa_sound, but i do not create asound.conf. but i can
> playback well in my device. may i create the asound.conf.who to create ?
>
> 2009/4/9 forest <[email protected]>
>
>
>
> > i know.
>
> > because add "&& (int)buffer.frameCount == inFrameCount"
> > in frameworks/base/libs/audioflinger/AudioFlinger.cpp:2462
>
> > delete this is ok,but don't know why add this?
>
> > On 4月3日, 下午5时42分, forest <[email protected]> wrote:
> > > the newest version can't record voice
> > > log:
> > > I/AudioHardwareALSA( 49): Initialized ALSA CAPTURE device
> > > AndroidRecord_Microphone
> > > D/AudioHardwareALSA( 49): Set CAPTURE PCM format to S16_LE (Signed
> > > 16 bit Little Endian)
> > > D/AudioHardwareALSA( 49): Using 1 channel for CAPTURE.
> > > D/AudioHardwareALSA( 49): Set CAPTURE sample rate to 8000 HZ
> > > W/AudioFlinger( 49): AudioRecordThread: buffer overflow
> > > W/AudioRecord( 49): obtainBuffer timed out (is the CPU pegged?)
> > > user=00000fa0, server=00000fa0
> > > W/AudioRecord( 49): obtainBuffer timed out (is the CPU pegged?)
> > > user=00000fa0, server=00000fa0
> > > D/dalvikvm( 109): GC freed 388 objects / 16736 bytes in 128ms
> > > W/AudioRecord( 49): obtainBuffer timed out (is the CPU pegged?)
> > > user=00000fa0, server=00000fa0
> > > W/AudioRecord( 49): obtainBuffer timed out (is the CPU pegged?)
> > > user=00000fa0, server=00000fa0
> > > W/AudioRecord( 49): obtainBuffer timed out (is the CPU pegged?)
> > > user=00000fa0, server=00000fa0
> > > W/AudioRecord( 49): obtainBuffer timed out (is the CPU pegged?)
> > > user=00000fa0, server=00000fa0
> > > W/AudioRecord( 49): obtainBuffer timed out (is the CPU pegged?)
> > > user=00000fa0, server=00000fa0
> > > W/AudioRecord( 49): obtainBuffer timed out (is the CPU pegged?)
> > > user=00000fa0, server=00000fa0
> > > W/AudioRecord( 49): obtainBuffer timed out (is the CPU pegged?)
> > > user=00000fa0, server=00000fa0
> > > W/AudioRecord( 49): obtainBuffer timed out (is the CPU pegged?)
> > > user=00000fa0, server=00000fa0
> > > ......
>
> > > who know why,thanks
>
>
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---