1

i get the stack below from google play, but i'm not understand why:

Source from PlayerCardsEventsListner.select:

void select(Card card) {
    card.select(!card.isSelected());
    if (card.isSelected()) card.setPosition(card.getPosition().x, card.getPosition().y-10);
    else card.setPosition(card.getPosition().x, card.getPosition().y+10);           
    SoundManager.playSound(SoundManager.SOUND_DROP, 1);
}

SoundManager: SoundManager

DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0 hwl=0 hwll=0)
"main" prio=5 tid=1 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x400281b8 self=0xcec0
  | sysTid=5424 nice=0 sched=0/0 cgrp=default handle=-1345006496
  | schedstat=( 895401208047 31823023961 248727 )
  at android.media.SoundPool.play(Native Method)
  at com.burraco.sound.SoundManager.playSound(SoundManager.java:66)
  at com.burraco.actions.PlayerCardsEventsListner.select(PlayerCardsEventsListner.java:157)
  at com.burraco.actions.PlayerCardsEventsListner.actionDown(PlayerCardsEventsListner.java:79)
  at com.burraco.actions.PlayerCardsEventsListner.onTouch(PlayerCardsEventsListner.java:38)
  at android.view.View.dispatchTouchEvent(View.java:3934)
  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
  at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1730)
  at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1142)
  at android.app.Activity.dispatchTouchEvent(Activity.java:2102)
  at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1714)
  at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2218)
  at android.view.ViewRoot.handleMessage(ViewRoot.java:1889)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:123)
  at android.app.ActivityThread.main(ActivityThread.java:3691)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:507)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
  at dalvik.system.NativeStart.main(Native Method)

"Binder Thread #3" prio=5 tid=9 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x40652e20 self=0x28d378
  | sysTid=5620 nice=0 sched=0/0 cgrp=default handle=5810464
  | schedstat=( 3221792 16373336 20 )
  at dalvik.system.NativeStart.run(Native Method)

"Thread-14" prio=5 tid=8 TIMED_WAIT
  | group="main" sCount=1 dsCount=0 obj=0x40556c80 self=0x142b90
  | sysTid=5520 nice=0 sched=0/0 cgrp=default handle=1618728
  | schedstat=( 174148198 257597779 1253 )
  at java.lang.VMThread.sleep(Native Method)
  at java.lang.Thread.sleep(Thread.java:1213)
  at java.lang.Thread.sleep(Thread.java:1195)
  at com.burraco.ai.AiThread.run(AiThread.java:77)
  at java.lang.Thread.run(Thread.java:1019)

"SoundPoolThread" prio=5 tid=12 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x4053c8b0 self=0x145530
  | sysTid=5472 nice=0 sched=0/0 cgrp=default handle=1250072
  | schedstat=( 3314498 173708645 36 )
  at dalvik.system.NativeStart.run(Native Method)

"SoundPool" prio=5 tid=11 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x405352d8 self=0x1429a0
  | sysTid=5471 nice=0 sched=0/0 cgrp=default handle=1249960
  | schedstat=( 3432419 260185822 78 )
  at dalvik.system.NativeStart.run(Native Method)

"android.hardware.SensorManager$SensorThread" prio=5 tid=10 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x4052ff48 self=0x150148
  | sysTid=5441 nice=-8 sched=0/0 cgrp=default handle=1376896
  | schedstat=( 2404922708 1733708167 21400 )
  at android.hardware.SensorManager.sensors_data_poll(Native Method)
  at android.hardware.SensorManager$SensorThread$SensorThreadRunnable.run(SensorManager.java:454)
  at java.lang.Thread.run(Thread.java:1019)

"Binder Thread #2" prio=5 tid=7 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x4051c5b0 self=0x8b2c8
  | sysTid=5430 nice=0 sched=0/0 cgrp=default handle=569024
  | schedstat=( 5665377 70979176 41 )
  at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=6 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x4051b2f0 self=0x899a8
  | sysTid=5429 nice=0 sched=0/0 cgrp=default handle=1010768
  | schedstat=( 8561334 52181668 45 )
  at dalvik.system.NativeStart.run(Native Method)

"Compiler" daemon prio=5 tid=5 VMWAIT
  | group="system" sCount=1 dsCount=0 obj=0x40517300 self=0xf65b0
  | sysTid=5428 nice=0 sched=0/0 cgrp=default handle=1007392
  | schedstat=( 672164310 233385368 5749 )
  at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=4 RUNNABLE
  | group="system" sCount=0 dsCount=0 obj=0x40517240 self=0xf6398
  | sysTid=5427 nice=0 sched=0/0 cgrp=default handle=479464
  | schedstat=( 1154248 170503189 8 )
  at dalvik.system.NativeStart.run(Native Method)

"GC" daemon prio=5 tid=3 VMWAIT
  | group="system" sCount=1 dsCount=0 obj=0x40517198 self=0xf61a0
  | sysTid=5426 nice=0 sched=0/0 cgrp=default handle=1002744
  | schedstat=( 8751048544 2309042697 2446 )
  at dalvik.system.NativeStart.run(Native Method)

"HeapWorker" daemon prio=5 tid=2 VMWAIT
  | group="system" sCount=1 dsCount=0 obj=0x405170e0 self=0xf5fb0
  | sysTid=5425 nice=0 sched=0/0 cgrp=default handle=1007176
  | schedstat=( 10792780877 2156866454 3466 )
  at dalvik.system.NativeStart.run(Native Method)
Achilleterzo
  • 742
  • 6
  • 16
  • Let me guess - are you using a Samsung S2 device? If so, please look at this: http://code.google.com/p/android/issues/detail?id=17623 – Fenix Voltres Apr 18 '13 at 09:49
  • this is same issue http://stackoverflow.com/questions/3467205/android-key-dispatching-timed-out/27292747#27292747 – Zar E Ahmer Dec 04 '14 at 11:21

1 Answers1

0

First of all, where is select(Card card) called?. This is very important to avoid log operations in main UI thread (standard actions performed in activity e.g. onCreate()). If you accidentally run some loop, or deadlock happend UI will freeze and ANR will be noticed. Try to use AsyncTask to play the sound and check the time of method execution. Remember that the slower devices needs more time to perform operations. Ok, now is see where it is called.

Kamil
  • 2,712
  • 32
  • 39
  • select() is called fast on attached onTouch(), where card is only an imageview extended. SoundManager is calling direcly SoundPool native, you think can be it the problem? isn't it right on a separate SoundPoolThread thread? – Achilleterzo Jul 19 '12 at 16:02
  • I can't say that I'm sure, but there is some possibility. Native methods don't have to run in separated threads. Moreover what will happen if play() fail? – Kamil Jul 19 '12 at 16:12
  • I take some time to choose your answer as right, because I would test if like you have supposed was correct... And seems that I didn't get any error now, than, "@K.Michalak, I choose you!" :D Thanks for your support. – Achilleterzo Jul 25 '12 at 18:54