How to enable off_load audio on x86_64 emulator build and using goldfish kernel(3.10-m-dev),finally want to write compressed audio data to file at kernel level

161 views
Skip to first unread message

YADLA NIRANJAN

unread,
Sep 28, 2015, 2:41:48 PM9/28/15
to android-porting
Hello,

I have built x86_64 emulator from Google latest source code and as well compiled goldfish kernel(3.10-m-dev) to generate "./arch/x86_64/boot/bzImage"

How to enable audio_offload?, want to enable "AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD" flag in audio_policy.conf, however I could not find this file in /system/etc/
Assume somehow If we enable audio_offload on emulator build then I want to know how to collect compressed audio data at kernel level(may be at compress_offload.c file ).


Build instructions:
Step1:Got the latest source code from http://source.android.com/source/downloading.html
Built the emulator using below configuration on latest Android source code

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.1.51
TARGET_PRODUCT=aosp_x86_64
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=x86_64
TARGET_ARCH_VARIANT=x86_64
TARGET_CPU_VARIANT=
TARGET_2ND_ARCH=x86
TARGET_2ND_ARCH_VARIANT=x86
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.13.0-63-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_CROSS_OS=windows
HOST_BUILD_TYPE=release
BUILD_ID=AOSP
OUT_DIR=out
============================================
ran below command
$make -j8


Step2:Got kernel code using  below command
git clone https://android.googlesource.com/kernel/goldfish.git
ran below cmds
$ make x86_64_emu_defconfig
$ make -j8



Note:If we successfully be able to write compressed data to a file at kernel level, this will allow us to achieve in simulating audio DSP on emulator build.

Thanks,
NY

Glenn Kasten

unread,
Sep 28, 2015, 2:48:19 PM9/28/15
to android-porting
See post #4 of https://groups.google.com/forum/#!topic/android-porting/SBVinW-RHzU
in particular the paragraph that begins "Offloaded tracks are new for Android 4.4 (KitKat)"
and the next paragraph "To read more "

YADLA NIRANJAN

unread,
Sep 28, 2015, 3:49:15 PM9/28/15
to android-porting
I actually gone through your post before I post my Question and my question is more about how can we do this in emulator?if so where can we do and collect the compressed data at kernel level.this will halp to simulate the audio dsp on emulator.

Glenn Kasten

unread,
Sep 28, 2015, 5:42:58 PM9/28/15
to android-porting
Sorry, I don't know how to simulate a DSP on emulator.

NY

unread,
Sep 29, 2015, 12:20:39 PM9/29/15
to android-porting
Thanks for your reply,Please provide me pointer if you know someone in Android Team at Google, who can help me on this?

NY

unread,
Sep 29, 2015, 3:02:42 PM9/29/15
to android-porting
Thanks ,Finally I found to enable offload audio on emulator.

NY

unread,
Mar 9, 2016, 8:58:59 PM3/9/16
to android-porting
added below code to audio_policy.conf and push same file to /system/etc and ran "adb shell stop media and start" media.
Now I could see in dumpsys of media.audio_policy with COMPRESS_offload flag got enabled.
However I could not see receiving compressed data  to audio_hw.c file ,please help me to understand more on this with emulator build.
compress_offload {
sampling_rates 8000|11025|16000|22050|32000|44100|48000
channel_masks AUDIO_CHANNEL_OUT_MONO|AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_MP3
devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE
flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING
}

Glenn Kasten

unread,
Mar 9, 2016, 9:14:12 PM3/9/16
to android-porting
NY, I am curious how you ended up simulating a DSP in the emulator, and whether it was effective?
As far as I know the main purpose of the compress/offload feature is to reduce power consumption,
and I'm wondering whether that is as beneficial in the emulator environment.
Reply all
Reply to author
Forward
0 new messages