Playback / callback failed
See original GitHub issueEdit: Sorry for the wrong description, i was out of time.
I’ve tested it again and seems that this error happens when the Audio.play()
function is called too much before the sound is finished. In the example i only had connected an update node because the sound is short. In case the sound length is 5 seconds for example, even with a delay of 2 seconds between the calls, the error also happens. Maybe some limit is reached, but i will keep this open as i don’t have sure.
The type error happens because the play()
function is returning a null
value that is going to the channels array in the update
function of https://github.com/armory3d/iron/blob/master/Sources/iron/object/SpeakerObject.hx
By filtering the null value the type error is fixed, but no audio is played anymore. This looks a low level issue.
Error message:
playback callback failed (delivered -32 / 4116 frames)
poll failed (Success)
Trace: TypeError: Cannot read property 'get_finished' of null
at iron_object_SpeakerObject.update (<anonymous>:16736:9)
at iron_App.update (<anonymous>:2908:27)
at kha_TimeTask.task (<anonymous>:24237:3)
at Function.kha_Scheduler.executeTimeTasks (<anonymous>:24120:75)
at Function.kha_Scheduler.executeFrame (<anonymous>:24070:17)
at kha_SystemImpl.renderCallback (<anonymous>:24851:16)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7
Top GitHub Comments
Hmm, as the error message states, make sure to have all the Kha/Krom extensions installed. Maybe you need to remove the .vscode directory first (because it could contain Windows commands) and instead run
Ctrl + Shift + P > Kha: Init Project
, I don’t know. I had the same error in other projects before, the Kha debugger unfortunately isn’t always that stable. If you find the cause, let me know and good look with the exams 😃It’s quite simple, you can start from the https://github.com/Kha-Samples/Empty repo for example. Just open this in VSCode and let it run.
I made you a small project that simply creates a new sound channel in each update step to copy the behaviour in the blend file above. I manually changed the update frequency from 1/60s to 1/120s so that its more likely that no channels are available. It should output a lot of “No free channel” messages.
KhaAudioPlayback.zip (open & run in VSCode)
If you don’t have an issue with this, then the issues are caused by something more complicated and might even be caused by something in Iron or the interplay between Iron and Kha. Otherwise it’s probably a Kha issue or there’s something wrong with your drivers for example.
I’m currently working on a small prototype of an audio engine in Kha but I currently have too less time to seriously work on it. This could be included in Armory in the future if everything works out well, but until then it will take some time. Nonetheless having a “retrigger” option and maybe even the mentioned configuration on what to do if all channels are occupied would be great. An extra issue for this could certainly help.