Audio Debugging: AudioFlinger - Tee Sink

845 views
Skip to first unread message

BESTER MANN

unread,
Aug 24, 2017, 12:45:00 PM8/24/17
to android-ndk
Hi guys,

I am trying to test audio output of an app using AudioFlinger's Tee Sink, based on the tutorial posted here:
https://source.android.com/devices/audio/debugging

I am new to building libraries for Android, however I managed to get through all the steps successfully and deploy my re-built libaudioflinger.so file onto my target emulator. Unfortunately, running the provided dumpsys command after running my test does not produce any mention of an output file, probably because it is not even being produced (the dumpsys output looks more or less the same as with the stock libaudioflinger.so file). I couldn't find hardly any resources describing audio debugging using AudioFlinger, so any suggestions and/or help would be greatly appreciated here.

Cheers!

Phil Burk

unread,
Aug 24, 2017, 1:18:06 PM8/24/17
to android-ndk
Hello Bester,

Did you reboot the target emulator? That is required to get the audioserver to load the new .so library.

I recommend changing some ALOGI message in AudioFlinger that you know will get printed to logcat. Then you will know for sure that your rebuilt library is being called.

If I need to look closely at the audio output then I usually just record from the phone jack into a laptop running Audacity.

phone -> 3.5 mm to 1/4 in cable -> USB audio adapter (eg Scarlett 2i2) -> laptop

Phil Burk

BESTER MANN

unread,
Aug 28, 2017, 9:53:42 AM8/28/17
to android-ndk
Hi Phil,

As you hinted, the issue probably lies in the fact that Tee sink is not enabled (despite that I uncommented "#define TEE_SINK and re-compiled the library). Is there any file, other than libaudioflinger.so, that I should copy to the target emulator?

Another thing is that as a complete newbie to android library building, I am not sure whether or not am I doing the process correctly. If I use the stock android emulator (let's say Nexus 4 API 23), the steps I take are:

  1. cd to the directory containing the file I have changed (and that has Android.mk file)
  2. execute lunch and select the device configuration (in my case aosp_x68-eng)
  3. execute mma to build the module and its dependencies
This finishes successfully and after that I just push the output libaudioflinger.so file onto the device. Is this the correct way to build?

Thank you for your help.

Phil Burk

unread,
Aug 28, 2017, 10:44:14 AM8/28/17
to andro...@googlegroups.com
Helo Bester,


As you hinted, the issue probably lies in the fact that Tee sink is not enabled (despite that I uncommented "#define TEE_SINK and re-compiled the library). Is there any file, other than libaudioflinger.so, that I should copy to the target emulator?

Did you set the /data/local.prop file with the number that turns on the signals you want?  probably "af.tee=2"


Phil Burk

BESTER MANN

unread,
Aug 29, 2017, 1:46:31 PM8/29/17
to android-ndk
Hi Phil,

Yes I have, I completed all the steps successfully (and retried the whole process several times just to be sure). I tried af.tee for all possible values, unfortunately with no change.

Appreciate the help.

Cheers 

harshal dhake

unread,
May 11, 2020, 6:38:32 PM5/11/20
to android-ndk
Hi Bester Mann,

What is the default time, the tee sink captured the data? 
Is it configurable? if yes then how do i do it?

Thanks & Regards,
Harshal
Reply all
Reply to author
Forward
0 new messages