Alsa_aplay not write on android

I just started working on android, and I'm trying to understand how the Android subsystem (alsa) works. I am running an Android image in a virtual box running on Windows 7 (64 bit).

I played with alsa-utils to record sound. I tried alsa_aplay -C -f S16_LE -c 2 -r 44100 -d 5 foo.wav he said something like: Recording WAVE foo.wav : Signed 16 bit little endian, rate 44100, stereo

However, the generated output file appears blank (after the wav file header).

od -x foo.wav

 0000000 4952 4646 7574 000d 4157 4556 6d66 2074 0000020 0010 0000 0001 0002 ac44 0000 b110 0002 0000040 0004 0010 6164 6174 7550 000d 0000 0000 0000060 0000 0000 0000 0000 0000 0000 0000 0000 * 3272560 0000 0000 0000 0000 0000 0000 3272574 

I also found that alsa_amixer faulty.

 Simple mixer control 'Master',0 Capabilities: pvolume pswitch pswitch-joined penum Playback channels: Front Left - Front Right Limits: Playback 0 - 31 Mono: Segmentation fault 

alsa_ctl init also throws an error message, but does some default configuration

 Unknown hardware: "ICH" "Sigmatel STAC9700,83,84" "AC97a:83847600" "0x8086" "0x0000" Hardware is initalized using a guess method 

When I check the current configuration used by alsa using alsa_ctl store -f cur_config.txt it has a capture switch: true and capture volume: value.0 = 8 & value.1 = 8

alsa_amixer scontrols

 Simple mixer control 'Master',0 Simple mixer control 'Master Mono',0 Simple mixer control '3D Control - Switch',0 Simple mixer control '3D Control Sigmatel - Depth',0 Simple mixer control 'PCM',0 Simple mixer control 'PCM Out Path & Mute',0 Simple mixer control 'Surround Phase Inversion',0 Simple mixer control 'Line',0 Simple mixer control 'CD',0 Simple mixer control 'Mic',0 Simple mixer control 'Mic Boost (+20dB)',0 Simple mixer control 'Mic Select',0 Simple mixer control 'Video',0 Simple mixer control 'Phone',0 Simple mixer control 'Beep',0 Simple mixer control 'Aux',0 Simple mixer control 'Mono Output Select',0 Simple mixer control 'Capture',0 Simple mixer control 'Mix',0 Simple mixer control 'Mix Mono',0 Simple mixer control 'External Amplifier',0 Simple mixer control 'Sigmatel 4-Speaker Stereo',0 Simple mixer control 'Sigmatel ADC 6dB Attenuate',0 Simple mixer control 'Sigmatel DAC 6dB Attenuate',0 

Any idea why I can't write?

[UPDATE]

The default sound controller in vbox was ICH AC 97 . I changed it to Intel HD Audio and tried the same thing and it worked. Now I can record sound. lsmod | grep snd output lsmod | grep snd lsmod | grep snd in both cases:

 **`ICH AC 97`** snd_intel8x0 19446 3 - Live 0xf80e9000 snd_ac97_codec 76811 1 snd_intel8x0, Live 0xf80bf000 ac97_bus 730 1 snd_ac97_codec, Live 0xf809a000 snd_pcm 47290 3 snd_intel8x0,snd_ac97_codec, Live 0xf8080000 snd_timer 12553 1 snd_pcm, Live 0xf805f000 snd_page_alloc 4893 2 snd_intel8x0,snd_pcm, Live 0xf804f000 **`Intel HD Audio`** snd_hda_codec_idt 37680 1 - Live 0xf8108000 snd_hda_intel 16006 3 - Live 0xf80de000 snd_hda_codec 49045 2 snd_hda_codec_idt,snd_hda_intel, Live 0xf80ba000 snd_hwdep 3844 1 snd_hda_codec, Live 0xf809c000 snd_pcm 47290 3 snd_hda_intel,snd_hda_codec, Live 0xf8080000 snd_timer 12553 1 snd_pcm, Live 0xf805f000 snd_page_alloc 4893 2 snd_hda_intel,snd_pcm, Live 0xf804f000 

the output of ls /dev/snd also different:

 **ICH AC 97** controlC0 pcmC0D0c pcmC0D0p pcmC0D1c timer **Intel HD** controlC0 hwC0D0 pcmC0D0c pcmC0D0p pcmC0D1c pcmC0D1p timer 

I tried to compare strace -f alsa_aplay -C foo.wav , but could not find anything useful there. The only difference is that after the ioctl call, '0000' is recorded in the first case (with ICH AC 97), where when some significant data is recorded using "Intel HD Audio"

Could this be due to some driver issues?

[UPDATE ENDS]

Thanks Vikram

+2
source share

Source: https://habr.com/ru/post/918111/


All Articles