How to disable Audio Feature in Android / How to build one mininum Android

2,656 views
Skip to first unread message

Matt Shao

unread,
Feb 16, 2011, 8:07:24 AM2/16/11
to android-porting
Hi guys:
    
     I am a fresh man in the android and now I am working on a board that using freescale imx51. We are porting the BSP from IMX51 EVK. 
     For this board, we change the audio codec from it's original audio codec SGTL5000 to WM8758, so of course, the EVK audio driver could not work on our board
     
     We definitely will modify the audio driver for our new audio codec, but currently we want to bypass this issue and boot the android without audio feature.

     But In fact, when we boot, the system will hang with the "ANDROID" animation, after check with the logcat, we found the system is waiting for the media.audio_policy, like this:

[20:20:25.974] I/SystemServer( 2041): Audio Service
[20:20:25.983] I/ServiceManager( 2041): Waiting for sevice media.audio_policy...
[20:20:26.981] I/ServiceManager( 2041): Waiting for sevice media.audio_policy...
[20:20:27.981] I/ServiceManager( 2041): Waiting for sevice media.audio_policy...
[20:20:28.981] I/ServiceManager( 2041): Waiting for sevice media.audio_policy...
[20:20:29.981] I/ServiceManager( 2041): Waiting for sevice media.audio_policy...
[20:20:30.981] W/AudioSystem( 2041): AudioPolicyService not published, waiting...

     As the audio codec does not loaded successfully, the ALSA could not found any audio device so the system hang here.

     Does any one know how to disable the audio feature in the android?

     With this question, I have one more question: 

     How to config to build one minimum Android?  (Any configuration file that we can modify?)
     (for example: delete AUDIO feature/delete WIFI/delete Bluetooth/delete all the google App/etc...)

     Any comments is highly appreciated!! Thanks a lot

ani

unread,
Feb 16, 2011, 10:42:38 AM2/16/11
to android-porting
Android audio use fake device to emulate driver so all the calls to
the actual driver should be blocked.So return all the calls to from
AudioHardwareInterface file.
Emulator also works on the same concept.

There should be a better way to stop audio by changing some make
files.

On Feb 16, 6:07 pm, Matt Shao <low...@gmail.com> wrote:
> Hi guys:
>
>      I am a fresh man in the android and now I am working on a board that
> using freescale imx51. We are porting the BSP from IMX51 EVK.
>      For this board, we change the audio codec from it's original audio
> codec SGTL5000 to WM8758, so of course, the EVK audio driver could not work
> on our board
>
>      We definitely will modify the audio driver for our new audio codec, but
> currently we want to bypass this issue and boot the android without audio
> feature.
>
>      But In fact, when we boot, the system will hang with the
> "ANDROID" animation, after check with the logcat, we found the system is
> waiting for the media.audio_policy, like this:
>
> *
> [20:20:25.974] I/SystemServer( 2041): Audio Service
> [20:20:25.983] I/ServiceManager( 2041): Waiting for sevice
> media.audio_policy...
> [20:20:26.981] I/ServiceManager( 2041): Waiting for sevice
> media.audio_policy...
> [20:20:27.981] I/ServiceManager( 2041): Waiting for sevice
> media.audio_policy...
> [20:20:28.981] I/ServiceManager( 2041): Waiting for sevice
> media.audio_policy...
> [20:20:29.981] I/ServiceManager( 2041): Waiting for sevice
> media.audio_policy...
> [20:20:30.981] W/AudioSystem( 2041): AudioPolicyService not published,
> waiting...
>
>      As the audio codec does not loaded successfully, the ALSA could not
> found any audio device so the system hang here.
> *

Jag

unread,
Feb 17, 2011, 2:18:32 AM2/17/11
to android-porting
Define this as part of BoardConfig.mk BOARD_USES_GENERIC_AUDIO

This will enable stub audio and will ensure that your device will
bootup without audio support.

Thanks
Jag

On Feb 16, 6:07 pm, Matt Shao <low...@gmail.com> wrote:
> Hi guys:
>
>      I am a fresh man in the android and now I am working on a board that
> using freescale imx51. We are porting the BSP from IMX51 EVK.
>      For this board, we change the audio codec from it's original audio
> codec SGTL5000 to WM8758, so of course, the EVK audio driver could not work
> on our board
>
>      We definitely will modify the audio driver for our new audio codec, but
> currently we want to bypass this issue and boot the android without audio
> feature.
>
>      But In fact, when we boot, the system will hang with the
> "ANDROID" animation, after check with the logcat, we found the system is
> waiting for the media.audio_policy, like this:
>
> *
> [20:20:25.974] I/SystemServer( 2041): Audio Service
> [20:20:25.983] I/ServiceManager( 2041): Waiting for sevice
> media.audio_policy...
> [20:20:26.981] I/ServiceManager( 2041): Waiting for sevice
> media.audio_policy...
> [20:20:27.981] I/ServiceManager( 2041): Waiting for sevice
> media.audio_policy...
> [20:20:28.981] I/ServiceManager( 2041): Waiting for sevice
> media.audio_policy...
> [20:20:29.981] I/ServiceManager( 2041): Waiting for sevice
> media.audio_policy...
> [20:20:30.981] W/AudioSystem( 2041): AudioPolicyService not published,
> waiting...
>
>      As the audio codec does not loaded successfully, the ALSA could not
> found any audio device so the system hang here.
> *

manish shakya

unread,
Feb 17, 2011, 10:10:40 AM2/17/11
to jagan.mut...@wipro.com, android-porting
I am having same issue.Even I use BOARD_USES_GENERIC_AUDIO, I intermittently get the same issue.




--
Manish Shakya
http://www.manishshakya.com.np
http://secs.oakland.edu/~ganesan/iMX/

Matt Shao

unread,
Feb 17, 2011, 11:57:53 PM2/17/11
to manishs...@gmail.com, jagan.mut...@wipro.com, android-porting
Hi guys:
I have tried ani's suggestion. I modify the codec cpp file and
change all the read/write register function with fake action and it
does work.
Now I could bypass this issue and see the home screen.

on the other hand, using BOARD_USES_GENERIC_AUDIO also do not work
for me.....

ani, thanks a lot...

But the question is still exist: How to Build one mininum Android?

2011/2/17, manish shakya <manishs...@gmail.com>:

jagan.mut...@wipro.com

unread,
Feb 18, 2011, 12:00:48 AM2/18/11
to manishs...@gmail.com, android...@googlegroups.com

What do you mean by “intermittently” ??

 

When you define BOARD_USES_GENERIC_AUDIO := true, this will enable stub audio which will never access any hardware for rendering.

 

Path: /frameworks/base/libs/audioflinger

File: Android.mk

 

Look for this flag over there. If this is defined, AudioHardwareInterface will create a Stub AudioHardware and will not produce any audio.

 

Thanks

Jagan

Amit Pundir

unread,
Feb 18, 2011, 2:08:48 AM2/18/11
to low...@gmail.com, android-porting

In your BoardConfig.mk:

set-->

BOARD_USES_GENERIC_AUDIO := true

and unset or delete-->

#BOARD_USES_ALSA_AUDIO := true
#BUILD_WITH_ALSA_UTILS := true

Regards,
Amit Pundir

>      With this question, I have one more question:
>      How to config to build one minimum Android?  (Any configuration file
> that we can modify?)
>      (for example: delete AUDIO feature/delete WIFI/delete Bluetooth/delete
> all the google App/etc...)
>      Any comments is highly appreciated!! Thanks a lot
>

manish shakya

unread,
Feb 18, 2011, 9:31:52 AM2/18/11
to jagan.mut...@wipro.com, android...@googlegroups.com

That mean, even I enable BOARD_USES_GENERIC_AUDIO := true, I could  see the problem irregularly.


Please do not print this email unless it is absolutely necessary.

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

Reply all
Reply to author
Forward
0 new messages