In my application I issue the following statement:

toneGenerator.startTone(ToneGenerator.TONE_PROP_ACK, 600);

Which works very well on a cheap LG LS670 running Android 2.3.3 but doesn't sound at all on all other phones I have, ranging from Android 2.2.1 to Android 2.3.4.

So I know the OS version doesn't play a role here (I also verified in the documentation that it has been supported since API 1).


toneGenerator = new ToneGenerator(ToneGenerator.TONE_DTMF_1, 100);

And I verified that Settings.System.DTMF_TONE_WHEN_DIALING is set to 1.

Baffled by this inconsistent behavior (across different phones), I examined the system logs when this happens and the only suspicious difference I have been able to find is that the phones who fail to sound TONE_PROP_ACK have this line in their log:

AudioFlinger    setParameters(): io 25, keyvalue routing=0, tid 155, calling tid 121

What is the purpose of AudioFlinger and what could be its connection to muting TONE_PROP_ACK?

Any idea how to fix my code so that that TONE_PROP_ACK always sounds, regardless of phone model?

  • 3
    Audio flinger is the system component which manages the audio from android userpsace before handing it off to the kernel driver. Are you able to get sound from any of the tone functions? Did you see the part in the API docs about the audio routing being variable? What are you really trying to accomplish anyway - you know these tones do not go through the call uplink, right? – Chris Stratton Jun 27 '12 at 3:43
  • @ChrisStratton Yes, I know these tones do not go through the call uplink. This is actually my preferred behavior as I am only trying to give an audible cue (it doesn't have to be DTMF). I am able to get sound from the tone functions when I use the phone's dialing activity. Can you elaborate on "the audio routing being variable"? Where do I find that part in the API docs? Direct URL would be super. Thanks +1. – Eternal Learner Jun 27 '12 at 11:35
  • routing=0 for io 25 means that the AudioFlinger is telling a particular audio stream (I'm guessing an AudioStreamOut in this case) that it should route to "nowhere". How the audio HAL will handle that is implementation-specific - so it might e.g. leave the routing for that stream unchanged. – Michael Feb 6 '13 at 12:34


According to the Android docs ToneGenerator.TONE_PROP_ACK is:

1200Hz, 100ms ON, 100ms OFF 2 bursts

If you choose SoundPool, I suggest saving in ogg file format and loop the tone until complete. This while provide seamless audio with a very small clip and not using a lot of resources.


The parsing/decoding is handled by Stage fright, which is used by the media player service. The decoded data is written to an Audio Track through an Audio Sink, and the tracks are then mixed by the Audio Flinger's mixer thread(s) and written to an output stream (Audio Hardware). The output stream object fills up its own buffer(s) and then writes the data to the PCM output device file (which may or may not be an ALSA driver).

Your Answer

