question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Playback / callback failed

See original GitHub issue

Edit: 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.

Test file

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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

2reactions
MoritzBruecknercommented, Jun 22, 2021

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 😃

2reactions
MoritzBruecknercommented, Jun 21, 2021

Unfortunately i don’t know how to run pure Kha to make tests, but i will try that sometime and see what happens. I ask for help on that when i need.

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.

About the main issue: after you reasoning the first solution you mentioned looks more feasible. Looking forward on that!

As mine error doesn’t seems related to the audio and you pushed a commit to fix the speaker issue, you can close this or leave open to track the possible improvements to be made on Iron Audio class. Thanks again for your help!

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not all playback issues result in onPlayBackError callback #727
Describe the bug In some cases it is possible for playback to fail without the add-on being able to report back to the...
Read more >
Flutter: Fatal Error: Callback lookup failed! (with audioplayers ...
The problem I'm facing is whenever I click this button, although sound plays correctly, I get this error in terminal: flutter: Fatal Error: ......
Read more >
VideoAdPlayer.VideoAdPlayerCallback | IMA SDK for Android
Fire this callback when the video is ready to begin playback. This indicates that at least some media has been buffered into the...
Read more >
Player events - ExoPlayer
Listener . When a failure occurs, this method will be called immediately before the playback state transitions to Player.STATE_IDLE . Failed or stopped ......
Read more >
AudioManager.AudioPlaybackCallback - Android Developers
Interface for receiving update notifications about the playback activity on the ... Called whenever the playback activity and configuration has changed.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found