No Sound with Krom on Linux

Hello Armory3D Community,

I can’t have sound when I compile for Krom, though it works for the Browser.
Does anyone running Linux has faced the same issue?

I tested the sound example with the latest Armory3DSDK/Blender, on LinuxMint 20.3 but unfortunately I can’t check on Windows…
The problem seemed to has appeared in the SDK2211, as it’s working with the SDK2210…

Thanks a lot.

Hi. What SDK versions are these? Could you please provide actual dates e.g. 2023.02.

Yes I’m sorry :sweat:
I meant ArmorySDK-2022.11 and ArmroySDK-2022.10

1 Like

No problem! Just wanted to make sure everyone is on the same page.


Request: Regarding the issue you’re experiencing, could you please check the Blender console for any errors and share those errors if there are any.

Question: When you said you, “compile for Krom,” did you mean Krom (C) or with Krom (JS)? If you’re unaware of which type of Krom you’re compiling to, you’re probably using the default Krom (JS) export.

Sorry again, I might have misused the word “Compile”…
When I said “compile for krom” I meant I pressed the “Play” button with “Krom” set in the Runtime.
Play
So I guess it’s Krom (JS).

About the console, I couldn’t see any error in the console for the SDK-2022.10, the SDK-2022.11 nor the SDK-2023.07
Even with “Verbose Output” checked.

However, I also tested by replacing the “Krom” folder of the SDK-2023.07 with the “Krom” folder from the SDK-2022.10 and the sound played correctly (although the screen was just black, but it was to be expected).

Actually, no. You didn’t misunderstand. The Play function compiles to Armory using exported data.

Correct.


@timodriaan do you think the experienced issue could be caused by:

Reference:

I don’t think so (the PR changes permissions for some executables but I don’t think that this could affect loading sounds), although I cannot completely rule it out of course.

Kha and Krom were updated in 22.11 (see this and this), I think this is a more plausible reason for causing this problem. Unfortunately, it’s pretty much impossible to see what exactly has changed in Kha/Kinc and the Krom binary for that release, since Lubos regularly re-forks Kha and Kinc (so the old Armory-specific history is overwritten) and the commits of the Armorcore binary repository don’t mention to which Armorcore commit the binary belongs… I skimmed through the Krom and Kinc commits between July and October 2022 and while there were a few audio-related commits, none of them looked suspicious to me at a first glance.


@Hikibob There are a few things you can do/try:

  • Open an issue on the Armorcore repository
  • Build Armorcore yourself, although you probably need to checkout a version earlier than e7e52a4 (see Black screen since audio mixing was moved to C · Issue #63 · armory3d/armorcore · GitHub for more information). Before building, make sure to set with_audio to true. Perhaps Lubos just forgot to enable that flag in the official Krom binary for Linux (although I doubt it, otherwise there probably would have been other reports already).
  • Debug it yourself. It’s of course the most difficult option but also the one that can potentially get you to the solution in the fastest way. Start by looking how Armory starts the audio playback, and from there go further until you find the low-level code in Kinc that’s actually responsible for audio playback. On each level, check whether the code is actually executed and whether you can find things that look like they can break in some situations.

Btw, have you tested other Armory projects or just the example file?

1 Like

Hi @timodriaan, thank’s for your research.

I was leaning to the same conclusion.

I did that too, though it’s way over my comprehension… As I’m not a developer I can’t really understand how it affects the code… I was rather looking for a misspelled word or a muted line somewhere in the code.

But besides Kha and Kinc, I was wondering if the problem could come from another submodule like v8 or onnx ?

That’s what I wanted to try, to test multiple iterations of Krom from July to Octobre to isolate when it started to stop working.
But after I cloned Armocore and Kha repositories, and tried to compile it (following the Readme for Linux ), I just got an " Error: kfile did not call resolve, no project created."
I couln’t go any further…

Yes, I discovered the problem by opening an old personal project, then tried with a simple LogicNode PlaySound/PlaySpeaker, then tried with the Sound Example.

In the meantime I figure why I can’t compile Krom, I guess I can check on other Linux Distro if the problem exist as well.

Hi, sorry for my very late answer.

But besides Kha and Kinc, I was wondering if the problem could come from another submodule like v8 or onnx ?

It cannot be completely ruled out of course, but I doubt that it’s one of those modules. I’m very confident that it’s not caused by onnx, because that’s used for deep learning and I think it’s not even used in Armorcore builds for Armory.

Is there anything else to the error message that gives additional information? Usually this specific message doesn’t happen in isolation. There are some recent reports of such an issue on Discord (error 1 including a solution, error 2a, error 2b) and error number 2 was already reported to Github.

I think I have encountered same issue of no sound in Linux Krom. So what is the final solution to this, was the bug fixed or do I need to tweak a certain file?

There is this known no sound issue for Linux users. I’m not sure if you’re one of the posters who posted on the issue tracker for it already: Sound not working in Krom · Issue #2948 · armory3d/armory · GitHub

Yes I did second an issue which was open already. I am also trying to get deep into the code to see what is causing the issue, currently I am suspecting audio libraries but I don’t have evidence yet to support my claim. Will keep on updating the community on this issue.

I do not recommend using Armory for projects that require sound.

I especially do not recommend on HTML5.

Dozens of hours of my work completely collapsed because of sound problems. I had to use Unity.

1k8 from the Armory3D Discord recommends using the native browser’s, web audio API: Web Audio API - Web APIs | MDN

That you can still use Armory3D and have working HTML5 audio.

Still large sound files are not play.

If the audio files are really that large, then perhaps check your browser’s network profiler to see if the audio file has been successfully loaded.

Also, apologies for not remembering about this before, but Armory3D’s HTML5 only supports the .wav format (it’s later exported as a different format), as described in this video and video description:

Perhaps this is the issue you’ve been experiencing?

There are two different issues here, one is about no sound at all on Krom while yours seems to be about large sound files in particular. The latter probably happens due to the asynchronous loading of sounds which the Play Sound node doesn’t handle well at the moment: Super weird error: sound - #4 by timodriaan (also see this conversation on Discord).