Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

EasyCoder

Member Since 19 Aug 2011
Offline Last Active Mar 02 2013 10:09 AM
-----

Topics I've Started

Problems with playing sounds using SoundPool

13 February 2013 - 04:04 AM

In my Android game, I am playing short sound effects using AudioManager and SoundPool.

 

While this works fine on Samsung Galaxy Tab 10.1, when I ported the game to Samsung Galaxy SIII, I am experiencing strange lock-ups of the screen and crashes of the application with re-booting of the phone, when I am trying to play the sound from the SoundPool.

 

It behaves quite erratically and one of 4 things happen (in no particular order):

 

(1) Application starts as normal and all sounds play normally.

 

(2) Application crashes completely and mobile reboots.

 

(3) Application freezes shortly (3-5 seconds) upon trying to play the sound, then continues normally, but sounds don't work.

 

(4) Application starts as normal, but none of the sounds plays. *

 

* There is a strange twist to the 4th case. None of the sounds plays, but when I activate game background music (which plays via MediaPlayer, not via AudioManager/SoundPool) this somehow 'flushes down' the stuck sound effects which should play at the beginning of the game, and now they all catch-up and play at once. This 'flushing down' somehow returns everything back to normal and from this point on all the sound effects from the SoundPool play normally, as they should.

 

The error which I am getting is:

 

AudioTrack: obtainBuffer timed out (is the CPU pegged?) "CPU pegged" what the hell does it even mean ??? unsure.png

 

Note that the problems happen at the point in the game when I am attempting to play the sounds from the soundpool by SoundPool.play, not when I am loading them by SoundPool.load.

 

I tried just about everything and now I am at the end of my wits. Did anybody have the same problem? Any help is highly appreciated.

 

 


glRotatef behaves strange

24 July 2012 - 09:57 AM

I have several 2D objects (simple squares with bitmaps on them) which I need to rotate on y axis (i.e. from left to right) all at the same angle.

However, when I use glRotatef command, the objects on the right side of the screen are rotated the most, and progressively towards the left side of the screen, they rotate less and less.

If I have let say 15 objects side-by-side, the difference in rotation between the leftmost and rightmost object is quite substantial and clearly visible.

I assume this is something to do with the perspective, but cannot figure out what I am doing wrong.

Just for interest, if I rotate the same objects on x axis (i.e. from forward to backward) the angle is the same for all of them !

Anybody knows how to achieve rotation at the same angle for all the objects on y axis ?

Thanks in advance for any suggestions.

PARTNERS