Android :: ObtainBuffer Timed Out In AudioTrack.write

Sep 1, 2010

After stopping and restarting playback of an audiotrack stream, on some devices I consistently get;

W/AudioTrack( 2453): obtainBuffer timed out (is the CPU pegged?) 0x64acc0 user=00010000, server=00000000

after freezing for a couple of seconds. This happens whether I just pause() and flush() my audiotrack or release() and recreate it.

Android :: obtainBuffer timed out in AudioTrack.write


Android :: AudioTrack - 51 - WARNING - ObtainBuffer() Timed Out

Nov 4, 2009

I am using MediaPlayer to play background music and SoundPool to play sound effects. All Audio data is stored in .ogg file format. Sometimes it happens that the MediaPlayer playback is interrupted for a fraction of a second if SoundPool.play() is called. Whenever this happens, the following two warnings are printed to logcat:

11-04 01:49:05.113: WARN/AudioTrack(51): obtainBuffer timed out (is the CPU pegged?) 0x2b6e8 user=000cc520, server=000cb710 11-04 01:49:05.113: WARN/AudioTrack(51): *** SERIOUS WARNING *** obtainBuffer() timed out but didn't need to be locked. We recovered, but this shouldn't happen (user=000cc520, server=000cb710)

Do you have any ideas what could cause the warning messages and/or how to avoid them? I.e. how to prevent SoundPool.play() from interrupting MediaPlayer playback?

An other warning that's sometimes appearing is: 11-04 01:55:49.793: WARN/AudioFlinger(51): write blocked for 89 msecs There seems to be no connection to the above messages, but do you have any ideas what causes this message and/or how to avoid it?

Here's some more detailed background information, maybe they are useful: My OpenGL powered game is split into three threads: One for rendering, one to take care about the game logic and the main thread to process user input. All Audio data is accessed through a central AudioManager class, which is only used in the game logic thread. (So this does not seem like a threading issue. Needless to say that synchronizing all methods has not solved the problem). The game runs smoothly at ~60 frames per second. According to DDMS the game causes ~33% system load (~10% in kernel space and ~23% in user space) on a G1. Even the idle task gets ~24% CPU time assigned while the game is running and input happens through the touch screen! (So it does not look like a performance problem) The MediaPlayer playback interruption always happens if SoundPool.play () is called in response of a touch screen input. Although touch screen input and SoundPool.play() happen in different threads. I've tried suspending the UI thread for various different delays between 8 and 32 msec after a MotionEvent has been processed, but again, without success...

View 3 Replies View Related

Android :: AudioTrack Stop/release - AudioTrack Plays In The STREAM Mode

Dec 25, 2009

I need to stop the AudioTrack, regardless what's in the buffer, immediately when executing the stop/release. The AudioTrack plays in the STREAM mode. It appears that the AudioTrack finishes playing what's in the buffer and than stops. It seems that it's such a fundamental flaw since there are so many audio applications out there.

View 4 Replies View Related

Android :: Key Dispatching Timed Out

Aug 12, 2010

In my Android application I am getting a very strange crash, when I press a button (Image) on my UI the entire application freezes and after a couple of seconds I getthe dreaded force close dialog appearing.

Here is what gets printed in the log:

CODE:................

This is the code for the Button (Image):

CODE:..................

If I comment the following out the pressing of the button (image) doesn't cause the crash:

CODE:.................

The above code calls down through several levels of the app and into the native layer (NDK), could the call passing through several objects be leading to the force close? It seems unlikely as several other buttons do the same without issue.

How about the native layer? Could some code I've built with the NDK be causing the issue?

View 1 Replies View Related

Android :: Timed Notification

Sep 9, 2010

I'm writing an app, that lets users subscribe to notification for TV transmissions. Currently the user can choose email, sms or push, but it all feels a bit overkill for a simple timed notification. I wonder if I can tell Android to simply "show this Notification at 11:30"?

View 1 Replies View Related

Android :: How To Use AudioRecord And AudioTrack?

Apr 30, 2009

I want to use AudioRecord and AudioTrack classes(in SDK 1.5) in my program. Where can I find how to use it. Is there any API demo program for this?. If not it is greatly appreciated if someone can post a sample code in this forum.

View 7 Replies View Related

Android :: How Do We Use AudioTrack Class?

Apr 23, 2009

I'm currently initiating the AudioTrack() for MODE_STREAM. I load some bytes using the write() and I see that it is working but once hit the play() call nothing happens. what is the matter? should I do something else that is not obvious? Any tips Google friends? My settings: streamType - STREAM_MUSIC sampleRateInHz - 44100 channel Config - CHANNEL _CONFIGURATION_STEREO audioFormat - ENCODING_PCM_16BIT bufferSizeInBytes - 256K the total size (in bytes) of the buffer where audio data is read from for playback. mode - MODE_STREAM.

View 21 Replies View Related

Android :: Looking For Best 1/4 Mile Timed Application

Sep 25, 2010

Looking for an app that will give me 0-60, 1/4 mike times, etc. what is a good one?

View 8 Replies View Related

Android :: Lock_layer Timed Out (is CPU Pegged)?

Nov 18, 2009

I have a situation occurring intermittently with an application where I receive the following message. It's probably something to do with a Thread. The application seems to stop, but I get the following message and I'm not sure what it means: WARN/SurfaceComposerClient(2106): lock_layer timed out (is the CPU pegged?) layer=1, lcblk=0x424800a0, state=00000043 (was 00000043). I see others have had this issue, but I don't see a solution or explanation (that I can understand :-) ).

View 3 Replies View Related

Android :: Timed Trial Expiry?

Feb 20, 2009

Does anyone have a somewhat secure method of expiring a trial version of an app a certain amount of time after an install? I do not want to use a server, because I am making a game that shouldn't need permissions. I would like the expiration data to survive an uninstall, but I am ok if it doesn't survive a manual edit of the database. Do an application's database entries get deleted when an app is uninstalled? How about preferences? Local files? Other methods?

View 3 Replies View Related

Android :: Timed Modeless Dialog

Nov 9, 2010

Is there any way to show a modeless dialog--a dialog that allows the user to interact with whatever was on the screen before the dialog but also allows the user to interact with the dialog if pressed?

I know of Toasts, but they don't allow interaction with the popup.

I know of Dialogs, but they're modal and don't allow interaction with the background.

I know of Notifications, but I want something that is visibile on screen.

I basically want to be able to be playing a game or something and a popup appears that I have a new email or something. I can click it to view my email, but I can wait for it to go away if I just want to continue playing my game. Is this possible in Android?

View 2 Replies View Related

Android :: How To Play Music From AudioTrack

Feb 15, 2010

I want to play music from online mp3 link.I am reading the music data into a stream and trying to play it using audio track. But itz giving only noise.No music i could listen.Same buffer I can play in Media Player,But i could not play in audio track.

View 16 Replies View Related

Android :: AudioTrack - Clicking Sound

Dec 15, 2009

I am getting this clicking sound when playing static pcm data. Anybody out there is having the same problem? This is not the data issue.

View 7 Replies View Related

Android :: Synchronizing AudioTrack And AudioRecord

Jan 21, 2010

My application uses AudioTrack in streaming mode and AudioRecord simultaneously.My problem is that I start them at the same time, but I have no guarantee that they will actually start playback ecording in the same timestamp. The reason I need this kind of accuracy is because I use echo cancellation (subtracting audio played to speaker from the recording).My echo canceller doesn't require an exact delay, but the delay introduced between AudioTrack and AudioRecord moves in the range of 250ms (between different runs), and that's too much - each run is different because they start themselves asynchronously. The API doesn't provide me a way to make sure they start in the same time, so I thought about measuring this starting delay somehow and then using it in my calculation.Does anyone have an idea how to do that, utilizing their API or in any other way?

View 2 Replies View Related

Android :: Audio Stuttering When Using AudioTrack

Apr 13, 2010

I'm in the process of wring a music player that can play SID tracks (music from the Commodore 64), and everything is progressing nicely, except that I sometimes get audio stuttering.The stuttering only happens when the player is in the background, and another application has focus. It's most noticeable when a cpu heavy app(like Google Earth) is running in the foreground.I have tried adjusting the priority of my thread and increasing the AudioTrack buffer size, but nothing has solved the stuttering problem.I believe the problem is that generating the audio takes quite a lot of cycles (I'm at 15-30% cpu load), and that my audio thread is being starved and cant keep up with AudioTrack's constant need for data.I'm must be doing something wrong, I can't imagine that gui threads should be able to starve a high priority audio thread.I hope someone have some ideas on how to get my player stutter free, as I'm at a loss :)

View 9 Replies View Related

Android :: Memory Leak In AudioTrack?

Jun 27, 2009

If I create and release multiple AudioTrack objects, the GREF count continually increases which eventually causes an application crash. Even with a forced garbage collection, I end up with the same high GREF count at the end of the loop.In my application, I continuously create AudioTracks from variable lenght buffers.I guess I can try and use a fixed size pool of AudioTracks each with a buffer large enough to fit my longest sound, and try and reuse them.Is there a better/correct way to completely clear resources used by an AudioTrack?

View 5 Replies View Related

Android :: How To Realize AudioTrack Class In SDK 1.1?

Aug 10, 2009

There is a AudioTrack Class in SDK 1.5 which can play PCM buffer directly.But it is not exist in SDK 1.1. I want to play PCM buffer in SDK1.1,but i don't know how.

View 2 Replies View Related

Android :: AudioTrack Sanity Test

Oct 2, 2009

I am trying to determine if I should go the ndk way to work on a music synth app, but first wanted to do a sanity check in the java layer by testing how many sine tones i could play concurrently, and so I tried this. And it's pretty low: I can only play about 4 or 5 tones before the obtainBuffer timeouts start increasing in number. Also, changing the media volume while the tones are playing disrupts the output.

View 3 Replies View Related

Android :: AudioTrack - Clicking Error

Jan 21, 2010

I am trying to resolve the clicking problem while using the AudioTrack. It takes place only when playing the first part of the wave (pcm) buffer when the offset to the write is 0 (zero). track.write(buffer, offset, minBufferSize); It tells me that there is something wrong with the pcm data. Could it be because the wave data, I generate using Audacity, has some header as opposed to the pure pcm which does not? I was looking for the converter tools to generate pure pcm but found none. Applications I found generate only wave data so I am not able to test this assumption. At this point I am sure that filling the buffer is correct. Any ideas?

View 2 Replies View Related

Android :: Service + AudioTrack - WAKE_LOCK?

Jan 25, 2010

I'm currently writing an app that uses a Service. A thread in the service generates an infinite stream of audio, and writes it to the AudioTrack. I want the audio to keep playing indefinitely until the user stops it. Based on my understanding of the PowerManager class, it looks like I should need a PARTIAL_WAKE_LOCK to keep the CPU awake so the audio can continue playing.

However, I left the audio playing on my phone with no wake lock, running on battery, in airplane mode, with all five items on the power control widget disabled, and the audio just kept right on playing for at least 15 minutes. Afterwards, I looked at the battery history, and it showed "Running (100%)", even though the Partial wake usage was negligible. Is there something special about AudioTrack which prevents the CPU from entering its deep sleep state? Should it be necessary for my service to grab a PARTIAL_WAKE_LOCK and its associated permission?

View 2 Replies View Related

Android :: AudioTrack Stop - Release ?

Dec 16, 2009

It doesn't seems as if the the stop and release immediately terminates the audio played by the MODE_STREAM track. It looks like it finishes playing the rest of the buffer and then stops.

View 3 Replies View Related

Android :: Launched Application - The Operation Timed Out

Nov 2, 2010

I am reading one simple web page, but when I launched my application after 2-3 min it show me output as: The operation timed out. Here ia my code...........

View 10 Replies View Related

Android :: Play Sound On A Timed Interval

Aug 27, 2010

I have an Android app which needs to play a sound resource on a timed interval, say every 120 seconds. I know how to access the sound resources and play them, however it's time timer part I'm not sure of. What's the best approach?

View 1 Replies View Related

Android :: Call To .NET Web Service Timed Out - Dev Using KSOAP2

Sep 4, 2010

I'm getting a Java Socket Exception "Operation timed out" when trying to call a .NET web service method. I've followed the many examples out there on the web to get my android to call a .net web service.

I'm running the web service using VS2010 in debug mode. The web method I'm calling is very simple -> "string GetVersion()"

I've read some posts that eclipse needs to be configured to access the internet by modifying the Proxy preferences "Preferences -> General -> Network Connections" from the Window menu item. I haven't been able to figure out exactly what I need to configure in the Proxy to get things to work if that is the problem.

I've also tried to access the .net web service root page (service.asmx) from my android with no success. I can access the asmx page with no problems using IE on the local machine. I've turned off the firewall and that didn't solve anything either. This is the first time I've tried to access a web service from a remote computer when it was running using VS2010 in debug mode.

I don't know if I have a configuration issue on the eclipse side or on the VS2010 side.

I'm also running Windows 7 Home Premium.

Below is a code snippet...

CODE:.................

View 4 Replies View Related

Android :: AudioTrack Start Called From Thread

Dec 8, 2009

I am getting the 'AudioTrack::start called from thread' when starting an AudioTrack. I am using it in a thread. I asume I shouldn't but why? I see it as a major limitation.

View 4 Replies View Related

Android :: Is AudioTrack Fundamentally Designed To Be Singleton?

Dec 14, 2009

Is the AudioTrack fundamentally designed to be a singleton? Methods on the OnPlaybackPositionUpdateListener receive just one argument, which is the AudioTrack itself. And since the AudioTrack does not have getTag/setTag methods I don't see any way to distinguish among multiple AudioTracks in the OnPlaybackPositionUpdateListener methods short of keeping track of references. So, if it's so why it's not implemented as a singleton? Any thoughts. I am trying to implement concurrent use of the AudioTrack. Anybody has any experience with this approach? Am I wasting time?

View 3 Replies View Related

Android :: Increase Speaker Volume Using AudioTrack

Jun 26, 2009

how to increase the volume of speaker using AudioTrack? the streamed audio is playing in speaker, but not loud as voice call. Here my code..............

View 2 Replies View Related

Android :: AudioTrack Cutting Audio Short

Dec 15, 2009

I am trying to play a 0.1s tone using audio track. I have done this succesfully in stream mode by calling play() then writing the array of short containing the data. However when I use STATIC mode and also in stream mode if I write the data before i call play() only about 0.06s of the audio is played. I have tried changing the buffer size but this has not effect.My understanding is that I have to write the data before I call play for static mode to work. Does anyone know what could be going wrong here?

View 5 Replies View Related

Android :: Continuous Raw Audio Playback Using AudioTrack

Dec 29, 2009

I am trying to play raw audio samples ( 16 bit, stereo, @ 32000KHz) using AudioTrack, in "MODE_STREAM" mode. I could play the first video buffer successfully but, After having received "onMarkerReached" for that raw audio buffer, I wonder how to push more audio data in AudioTrack ? without closing/stopping it. Writing more data to AudioTrack in "onMarkerReached" callback does not help. I am using the same thread to construct the AudioTrack and pump in audio - buffers and receive callbacks.

View 2 Replies View Related

Android :: Java.net.SocketException - Operation Timed Out - Not Behind Proxy

Feb 25, 2009

I'm developing an app which needs to connect to the internet, but when i send a request using DefaultHtpClient.execute() method it takes 2-3 minutes and then the stacktrace says java.net.SocketException:operation timed out............

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved