question

T. Scott avatar image
T. Scott asked

Kindle Fire HDX 7" audio issues

I've got my app running successfully on the Kindle Fire 1st gen, Kindle Fire HD 7", and Kindle Fire HDX 7". Doing some log cat checking, however, I see a large number of errors being dumped to the log by the Kindle Fire HDX. The other devices show NO such errors. What is different about the HDX build? Why is it reporting these things in the log? Here are the errors I'm seeing: 11-28 06:48:18.167: E/(420): Request requires android.permission.MODIFY_AUDIO_SETTINGS 11-28 06:48:18.177: E/AudioHardwareALSA(420): int* android_audio_legacy::AudioHardwareALSA::getCallStateForVSID(uint32_t): Invalid vsid:0 11-28 06:48:18.177: E/AudioHardwareALSA(420): bool android_audio_legacy::AudioHardwareALSA::routeCall(int, int, uint32_t)(): Error, mCurCallState=0x0 is NULL I don't modify global audio settings, so I don't know why that is appearing. Indeed, if I were truly doing this, I would expect to also see that error appear on the Kindle Fire 1st Gen and Kindle Fire HD. But, I do not see that. The errors appear to be related to whenever I play a sound. Note that the game sounds and music appear to behave JUST FINE on the Kindle Fire HDX... it's just spewing a massive amount of error information. Here's my Kindle Fire HDX version information: 13.3.1.0_user_310079820 Thanks! --tim
fire tablet
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Scott, Thank you for writing to us. We tried to reproduce the issue in our end by creating a MediaPlayer and playing a mp3 media from assets. That worked well in HDX devices and did not report the errors (what you have got) in logcat. Could you please post a sample code or snippet what can reproduce the issue?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

T. Scott avatar image
T. Scott answered
I am implementing sounds via a sound pool so there's a difference right there. You can find the full Eclipse project for a sample that induces the problem here: https://android.googlecode.com/issues/attachment?aid=627150000000&name=SoundPoolExample.zip&token=qW5u7px4kTjNWI0DPjuOcNh3qy8%3A1386007737280 There's an .apk file included in that zip file. Install that to the HDX and run it -- the app name is "SoundPoolExample". After installation, touch the screen to emit a sound and monitor the logcat. With every touch, you'll see the error I reference above. Other than that, the sound appears to play correctly. --tim
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

T. Scott avatar image
T. Scott answered
Here's the code if the .zip file doesn't work: public class MainActivity extends Activity implements OnTouchListener { private SoundPool soundPool; private int soundID; boolean loaded = false; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); View view = findViewById(R.id.textView1); view.setOnTouchListener(this); // Set the hardware buttons to control the music this.setVolumeControlStream(AudioManager.STREAM_MUSIC); } @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { // Getting the user sound settings AudioManager audioManager = (AudioManager) getSystemService(AUDIO_SERVICE); float actualVolume = (float) audioManager.getStreamVolume(AudioManager.STREAM_MUSIC); float maxVolume = (float) audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC); float volume = actualVolume / maxVolume; // Is the sound loaded already? if (loaded) { soundPool.play(soundID, volume, volume, 1, 0, 1f); } } return false; } @Override public void onPause(){ super.onPause(); System.out.println("Pausing..."); soundPool.release(); soundPool = null; } @Override public void onResume() { super.onResume(); System.out.println("Resuming..."); if (soundPool == null) { // Load the sound soundPool = new SoundPool(10, AudioManager.STREAM_MUSIC, 0); soundPool.setOnLoadCompleteListener(new OnLoadCompleteListener() { @Override public void onLoadComplete(SoundPool soundPool, int sampleId, int status) { loaded = true; } }); soundID = soundPool.load(this, R.raw.sine440w, 1); } } }
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

T. Scott avatar image
T. Scott answered
Seems that link above is bad. Check out the example attached to the first post for this AOSP issue: https://code.google.com/p/android/issues/detail?id=62715 "SoundPoolExample.zip" --tim
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Thanks Scott for working sample code. Yes, I can see the errors what are reported in logcat. I would check with our internal team and get back to you.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

T. Scott avatar image
T. Scott answered
It's been two weeks. Any updates on this?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Scott, Thank you for your patience. We are actively working on this issue. Once it's fixed the devices would be updated with that. Unfortunately, I can not commit on ETA at this moment. Please bare with us.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Pradeep A. avatar image
Pradeep A. answered
Hi We have a similar problem on our app. Has this issue been fixed.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Pradeep, Can you tell me the device OS version no of the device you are testing on? Thanks.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Pradeep A. avatar image
Pradeep A. answered
Hi The device is Kindle Fire HDX 8.9 and the OS is Android 4.2.2
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.