{"action":"opened","issue":{"url":"https://api.github.com/repos/superpoweredSDK/Low-Latency-Android-Audio-iOS-Audio-Engine/issues/115","repository_url":"https://api.github.com/repos/superpoweredSDK/Low-Latency-Android-Audio-iOS-Audio-Engine","labels_url":"https://api.github.com/repos/superpoweredSDK/Low-Latency-Android-Audio-iOS-Audio-Engine/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/superpoweredSDK/Low-Latency-Android-Audio-iOS-Audio-Engine/issues/115/comments","events_url":"https://api.github.com/repos/superpoweredSDK/Low-Latency-Android-Audio-iOS-Audio-Engine/issues/115/events","html_url":"https://github.com/superpoweredSDK/Low-Latency-Android-Audio-iOS-Audio-Engine/issues/115","id":150096584,"number":115,"title":"Audio stuttering under CPU stress","user":{"login":"Guy-kun","id":1477129,"avatar_url":"https://avatars.githubusercontent.com/u/1477129?v=3","gravatar_id":"","url":"https://api.github.com/users/Guy-kun","html_url":"https://github.com/Guy-kun","followers_url":"https://api.github.com/users/Guy-kun/followers","following_url":"https://api.github.com/users/Guy-kun/following{/other_user}","gists_url":"https://api.github.com/users/Guy-kun/gists{/gist_id}","starred_url":"https://api.github.com/users/Guy-kun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Guy-kun/subscriptions","organizations_url":"https://api.github.com/users/Guy-kun/orgs","repos_url":"https://api.github.com/users/Guy-kun/repos","events_url":"https://api.github.com/users/Guy-kun/events{/privacy}","received_events_url":"https://api.github.com/users/Guy-kun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-21T14:47:32Z","updated_at":"2016-04-21T14:47:32Z","closed_at":null,"body":"My previous issue was closed before I managed to reply and I don't think my follow-up was seen...\r\n\r\nPrevious issue:\r\nhttps://github.com/superpoweredSDK/Low-Latency-Android-Audio-iOS-Audio-Engine/issues/113\r\n\r\n\r\nTo follow up, I am not doing any DSP or additional overhead but am running a game entirely in native code using the cocos2dx library.\r\n\r\nMy audio processing callback is \r\n```\r\nif (player->process(stereoBuffer, false, numberOfSamples, playerVolume, 0.0f, -1.0 ))\r\n        {\r\n            SuperpoweredFloatToShortInt(stereoBuffer, audioIO, numberOfSamples);\r\n            return true;\r\n        }\r\n```\r\n\r\nand buffers initialized like so, as per the Android Cross example\r\n```\r\nplayer = new SuperpoweredAdvancedAudioPlayer(&player ,playerEventCallback ,samplerate, 0);\r\naudioSystem = new SuperpoweredAndroidAudioIO(samplerate, buffersize, false, true, audioProcessing, 0, 0);\r\nstereoBuffer = (float *)memalign(16, (buffersize + 16) * sizeof(float) * 2);\r\n```\r\n\r\nwhere the buffer size and sample rate are passed in as values from \r\n```\r\naudioManager.getProperty(AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE);\r\naudioManager.getProperty(AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER);\r\n```\r\n\r\nHowever in-game and exasperated by running a screen recorder audio performance is shoddy and lots of popcorn/stuttering is audible, (less frequent but present without strain)\r\n\r\nFrom my understanding the audio processing callback should be called at a high priority and supposedly not blocked by other native threads? But I'm not sure what's going on. Additionally, it feels like the buffersize isn't big enough but even multiplying it by 8 I'm seeing the same effect.\r\nTo compare, another game I've tested that uses FMOD for playback has zero performance issues when screen recording.\r\n\r\nAll in all, the problem can't lie inside the actual processing callback but something external, timing related or buffer size related I feel."}}