Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML5 export set to 'Threads' produces "Output buffer has not enough frames! Skipping output frame." #70652

Open
PeterMarques opened this issue Dec 28, 2022 · 20 comments

Comments

@PeterMarques
Copy link

PeterMarques commented Dec 28, 2022

Godot version

3.5.1 stable and 4.0 beta10

System information

W10

Issue description

Something is not working on the threads. Its very chaotic, and i see this error throw on other issues here on the github .

It affects audio perfomance, and it its the source of the error, but its not caused by that, and in personal projects it is causing some weird behaviour, like, i need to call twice, and only the second call i have the full code running, like the execution is being suspended because of the errors.

Thanks for any help.

Steps to reproduce

Create a simple node.

Set HTML5 export to 'Threads'

Run on HTML5 and click the screen to start context.

Wait a little.

Minimal reproduction project

N/A

@PeterMarques
Copy link
Author

On Godot 4 a empty project produces the error as well.
image

@PeterMarques
Copy link
Author

So, i modified the error code, so i can acess the content of the output.

The new code is :

this.port.postMessage({ 'error': 'Output buffer has not enough frames! Skipping output frame.', 'data': outputs, 'data[0]': outputs[0], 'data[0][0]': outputs[0][0]});

And boy, its is large.

I will post below.

@PeterMarques
Copy link
Author

PeterMarques commented Dec 28, 2022

{
    "error": "Output buffer has not enough frames! Skipping output frame.",
    "data": [
        [
            {
                "0": 0,
                "1": 0,
                "2": 0,
                "3": 0,
                "4": 0,
                "5": 0,
                "6": 0,
                "7": 0,
                "8": 0,
                "9": 0,
                "10": 0,
                "11": 0,
                "12": 0,
                "13": 0,
                "14": 0,
                "15": 0,
                "16": 0,
                "17": 0,
                "18": 0,
                "19": 0,
                "20": 0,
                "21": 0,
                "22": 0,
                "23": 0,
                "24": 0,
                "25": 0,
                "26": 0,
                "27": 0,
                "28": 0,
                "29": 0,
                "30": 0,
                "31": 0,
                "32": 0,
                "33": 0,
                "34": 0,
                "35": 0,
                "36": 0,
                "37": 0,
                "38": 0,
                "39": 0,
                "40": 0,
                "41": 0,
                "42": 0,
                "43": 0,
                "44": 0,
                "45": 0,
                "46": 0,
                "47": 0,
                "48": 0,
                "49": 0,
                "50": 0,
                "51": 0,
                "52": 0,
                "53": 0,
                "54": 0,
                "55": 0,
                "56": 0,
                "57": 0,
                "58": 0,
                "59": 0,
                "60": 0,
                "61": 0,
                "62": 0,
                "63": 0,
                "64": 0,
                "65": 0,
                "66": 0,
                "67": 0,
                "68": 0,
                "69": 0,
                "70": 0,
                "71": 0,
                "72": 0,
                "73": 0,
                "74": 0,
                "75": 0,
                "76": 0,
                "77": 0,
                "78": 0,
                "79": 0,
                "80": 0,
                "81": 0,
                "82": 0,
                "83": 0,
                "84": 0,
                "85": 0,
                "86": 0,
                "87": 0,
                "88": 0,
                "89": 0,
                "90": 0,
                "91": 0,
                "92": 0,
                "93": 0,
                "94": 0,
                "95": 0,
                "96": 0,
                "97": 0,
                "98": 0,
                "99": 0,
                "100": 0,
                "101": 0,
                "102": 0,
                "103": 0,
                "104": 0,
                "105": 0,
                "106": 0,
                "107": 0,
                "108": 0,
                "109": 0,
                "110": 0,
                "111": 0,
                "112": 0,
                "113": 0,
                "114": 0,
                "115": 0,
                "116": 0,
                "117": 0,
                "118": 0,
                "119": 0,
                "120": 0,
                "121": 0,
                "122": 0,
                "123": 0,
                "124": 0,
                "125": 0,
                "126": 0,
                "127": 0
            },
            {
                "0": 0,
                "1": 0,
                "2": 0,
                "3": 0,
                "4": 0,
                "5": 0,
                "6": 0,
                "7": 0,
                "8": 0,
                "9": 0,
                "10": 0,
                "11": 0,
                "12": 0,
                "13": 0,
                "14": 0,
                "15": 0,
                "16": 0,
                "17": 0,
                "18": 0,
                "19": 0,
                "20": 0,
                "21": 0,
                "22": 0,
                "23": 0,
                "24": 0,
                "25": 0,
                "26": 0,
                "27": 0,
                "28": 0,
                "29": 0,
                "30": 0,
                "31": 0,
                "32": 0,
                "33": 0,
                "34": 0,
                "35": 0,
                "36": 0,
                "37": 0,
                "38": 0,
                "39": 0,
                "40": 0,
                "41": 0,
                "42": 0,
                "43": 0,
                "44": 0,
                "45": 0,
                "46": 0,
                "47": 0,
                "48": 0,
                "49": 0,
                "50": 0,
                "51": 0,
                "52": 0,
                "53": 0,
                "54": 0,
                "55": 0,
                "56": 0,
                "57": 0,
                "58": 0,
                "59": 0,
                "60": 0,
                "61": 0,
                "62": 0,
                "63": 0,
                "64": 0,
                "65": 0,
                "66": 0,
                "67": 0,
                "68": 0,
                "69": 0,
                "70": 0,
                "71": 0,
                "72": 0,
                "73": 0,
                "74": 0,
                "75": 0,
                "76": 0,
                "77": 0,
                "78": 0,
                "79": 0,
                "80": 0,
                "81": 0,
                "82": 0,
                "83": 0,
                "84": 0,
                "85": 0,
                "86": 0,
                "87": 0,
                "88": 0,
                "89": 0,
                "90": 0,
                "91": 0,
                "92": 0,
                "93": 0,
                "94": 0,
                "95": 0,
                "96": 0,
                "97": 0,
                "98": 0,
                "99": 0,
                "100": 0,
                "101": 0,
                "102": 0,
                "103": 0,
                "104": 0,
                "105": 0,
                "106": 0,
                "107": 0,
                "108": 0,
                "109": 0,
                "110": 0,
                "111": 0,
                "112": 0,
                "113": 0,
                "114": 0,
                "115": 0,
                "116": 0,
                "117": 0,
                "118": 0,
                "119": 0,
                "120": 0,
                "121": 0,
                "122": 0,
                "123": 0,
                "124": 0,
                "125": 0,
                "126": 0,
                "127": 0
            }
        ]
    ],
    "data[0]": [
        {
            "0": 0,
            "1": 0,
            "2": 0,
            "3": 0,
            "4": 0,
            "5": 0,
            "6": 0,
            "7": 0,
            "8": 0,
            "9": 0,
            "10": 0,
            "11": 0,
            "12": 0,
            "13": 0,
            "14": 0,
            "15": 0,
            "16": 0,
            "17": 0,
            "18": 0,
            "19": 0,
            "20": 0,
            "21": 0,
            "22": 0,
            "23": 0,
            "24": 0,
            "25": 0,
            "26": 0,
            "27": 0,
            "28": 0,
            "29": 0,
            "30": 0,
            "31": 0,
            "32": 0,
            "33": 0,
            "34": 0,
            "35": 0,
            "36": 0,
            "37": 0,
            "38": 0,
            "39": 0,
            "40": 0,
            "41": 0,
            "42": 0,
            "43": 0,
            "44": 0,
            "45": 0,
            "46": 0,
            "47": 0,
            "48": 0,
            "49": 0,
            "50": 0,
            "51": 0,
            "52": 0,
            "53": 0,
            "54": 0,
            "55": 0,
            "56": 0,
            "57": 0,
            "58": 0,
            "59": 0,
            "60": 0,
            "61": 0,
            "62": 0,
            "63": 0,
            "64": 0,
            "65": 0,
            "66": 0,
            "67": 0,
            "68": 0,
            "69": 0,
            "70": 0,
            "71": 0,
            "72": 0,
            "73": 0,
            "74": 0,
            "75": 0,
            "76": 0,
            "77": 0,
            "78": 0,
            "79": 0,
            "80": 0,
            "81": 0,
            "82": 0,
            "83": 0,
            "84": 0,
            "85": 0,
            "86": 0,
            "87": 0,
            "88": 0,
            "89": 0,
            "90": 0,
            "91": 0,
            "92": 0,
            "93": 0,
            "94": 0,
            "95": 0,
            "96": 0,
            "97": 0,
            "98": 0,
            "99": 0,
            "100": 0,
            "101": 0,
            "102": 0,
            "103": 0,
            "104": 0,
            "105": 0,
            "106": 0,
            "107": 0,
            "108": 0,
            "109": 0,
            "110": 0,
            "111": 0,
            "112": 0,
            "113": 0,
            "114": 0,
            "115": 0,
            "116": 0,
            "117": 0,
            "118": 0,
            "119": 0,
            "120": 0,
            "121": 0,
            "122": 0,
            "123": 0,
            "124": 0,
            "125": 0,
            "126": 0,
            "127": 0
        },
        {
            "0": 0,
            "1": 0,
            "2": 0,
            "3": 0,
            "4": 0,
            "5": 0,
            "6": 0,
            "7": 0,
            "8": 0,
            "9": 0,
            "10": 0,
            "11": 0,
            "12": 0,
            "13": 0,
            "14": 0,
            "15": 0,
            "16": 0,
            "17": 0,
            "18": 0,
            "19": 0,
            "20": 0,
            "21": 0,
            "22": 0,
            "23": 0,
            "24": 0,
            "25": 0,
            "26": 0,
            "27": 0,
            "28": 0,
            "29": 0,
            "30": 0,
            "31": 0,
            "32": 0,
            "33": 0,
            "34": 0,
            "35": 0,
            "36": 0,
            "37": 0,
            "38": 0,
            "39": 0,
            "40": 0,
            "41": 0,
            "42": 0,
            "43": 0,
            "44": 0,
            "45": 0,
            "46": 0,
            "47": 0,
            "48": 0,
            "49": 0,
            "50": 0,
            "51": 0,
            "52": 0,
            "53": 0,
            "54": 0,
            "55": 0,
            "56": 0,
            "57": 0,
            "58": 0,
            "59": 0,
            "60": 0,
            "61": 0,
            "62": 0,
            "63": 0,
            "64": 0,
            "65": 0,
            "66": 0,
            "67": 0,
            "68": 0,
            "69": 0,
            "70": 0,
            "71": 0,
            "72": 0,
            "73": 0,
            "74": 0,
            "75": 0,
            "76": 0,
            "77": 0,
            "78": 0,
            "79": 0,
            "80": 0,
            "81": 0,
            "82": 0,
            "83": 0,
            "84": 0,
            "85": 0,
            "86": 0,
            "87": 0,
            "88": 0,
            "89": 0,
            "90": 0,
            "91": 0,
            "92": 0,
            "93": 0,
            "94": 0,
            "95": 0,
            "96": 0,
            "97": 0,
            "98": 0,
            "99": 0,
            "100": 0,
            "101": 0,
            "102": 0,
            "103": 0,
            "104": 0,
            "105": 0,
            "106": 0,
            "107": 0,
            "108": 0,
            "109": 0,
            "110": 0,
            "111": 0,
            "112": 0,
            "113": 0,
            "114": 0,
            "115": 0,
            "116": 0,
            "117": 0,
            "118": 0,
            "119": 0,
            "120": 0,
            "121": 0,
            "122": 0,
            "123": 0,
            "124": 0,
            "125": 0,
            "126": 0,
            "127": 0
        }
    ],
    "data[0][0]": {
        "0": 0,
        "1": 0,
        "2": 0,
        "3": 0,
        "4": 0,
        "5": 0,
        "6": 0,
        "7": 0,
        "8": 0,
        "9": 0,
        "10": 0,
        "11": 0,
        "12": 0,
        "13": 0,
        "14": 0,
        "15": 0,
        "16": 0,
        "17": 0,
        "18": 0,
        "19": 0,
        "20": 0,
        "21": 0,
        "22": 0,
        "23": 0,
        "24": 0,
        "25": 0,
        "26": 0,
        "27": 0,
        "28": 0,
        "29": 0,
        "30": 0,
        "31": 0,
        "32": 0,
        "33": 0,
        "34": 0,
        "35": 0,
        "36": 0,
        "37": 0,
        "38": 0,
        "39": 0,
        "40": 0,
        "41": 0,
        "42": 0,
        "43": 0,
        "44": 0,
        "45": 0,
        "46": 0,
        "47": 0,
        "48": 0,
        "49": 0,
        "50": 0,
        "51": 0,
        "52": 0,
        "53": 0,
        "54": 0,
        "55": 0,
        "56": 0,
        "57": 0,
        "58": 0,
        "59": 0,
        "60": 0,
        "61": 0,
        "62": 0,
        "63": 0,
        "64": 0,
        "65": 0,
        "66": 0,
        "67": 0,
        "68": 0,
        "69": 0,
        "70": 0,
        "71": 0,
        "72": 0,
        "73": 0,
        "74": 0,
        "75": 0,
        "76": 0,
        "77": 0,
        "78": 0,
        "79": 0,
        "80": 0,
        "81": 0,
        "82": 0,
        "83": 0,
        "84": 0,
        "85": 0,
        "86": 0,
        "87": 0,
        "88": 0,
        "89": 0,
        "90": 0,
        "91": 0,
        "92": 0,
        "93": 0,
        "94": 0,
        "95": 0,
        "96": 0,
        "97": 0,
        "98": 0,
        "99": 0,
        "100": 0,
        "101": 0,
        "102": 0,
        "103": 0,
        "104": 0,
        "105": 0,
        "106": 0,
        "107": 0,
        "108": 0,
        "109": 0,
        "110": 0,
        "111": 0,
        "112": 0,
        "113": 0,
        "114": 0,
        "115": 0,
        "116": 0,
        "117": 0,
        "118": 0,
        "119": 0,
        "120": 0,
        "121": 0,
        "122": 0,
        "123": 0,
        "124": 0,
        "125": 0,
        "126": 0,
        "127": 0
    }
}

@PeterMarques
Copy link
Author

PeterMarques commented Dec 28, 2022

And every single one of thoes is the same.

Why? Its just outputing a big full nothing.

Well, what is happening?

Actualy it is very way bigger. I clicked to expand recursively and think my computer will break.

The console already is frozen.

Soo, maybe it is a recursion bug somewhere.

I sugest someone to modify the debug export template, and investigate the console, as i cant seen to fully colapse the tree without freeze.

@Calinou
Copy link
Member

Calinou commented Dec 29, 2022

Which web browsers did you test this on?

@PeterMarques Please surround large blocks of text with triple backticks like this:

```
text here
```

This prevents them from taking too much space and also makes sure issue references aren't accidentally created. I edited your comment, but remember to do this next time 🙂

Also, in the future, please use the Edit button (located behind the icon in the top-right corner of your comments) instead of multi-posting.

@PeterMarques
Copy link
Author

PeterMarques commented Dec 29, 2022

Thanks for the corrections, will abide.

I tested on Brave and Modern Edge (Chromium based).

I will do some tests on my linux machine as well, on diferent browsers, to see if i get the same results.

@PeterMarques
Copy link
Author

PeterMarques commented Dec 30, 2022

While performing tests on Linux ( a modern Pentium Silver , vs a 4°gen-i5 that is my windows), it does not outputed the error, a priori.

So, i re-crafted a load test, one hundred threads with a 1 ms delay, and it indeed started showing the error again.

the thing on the Win is that its not Throttled.? OR... Well, thats remind-me of a old devil, the "Interrupt".

Thats on what i will point my fingers at. Yes!

It is something on that liking, i am mostly sure, because the source of the error is the Audio worklet javascript code, and the error happens even when there is nothing happening, but, godot may be pushing a empty audio buffer all the time (something i already noted on the engine, it shows a AUDIO SIMBOL on the tab, even on a new silent project, like there is audio being reproduced)

My bet is that this daemon is running and detecting interrupts.

On my old windows pc, much more common them on a newer linux machine, of course, that why the linux only showed the error on the forced 100% cpu.

What now?

@Fran6nd
Copy link

Fran6nd commented Jan 22, 2023

Which web browsers did you test this on?

@PeterMarques Please surround large blocks of text with triple backticks like this:

text here

This prevents them from taking too much space and also makes sure issue references aren't accidentally created. I edited your comment, but remember to do this next time 🙂

Also, in the future, please use the Edit button (located behind the icon in the top-right corner of your comments) instead of multi-posting.

I have the same issue running on the latest safari.

On Godot 4 a empty project produces the error as well.
image

The Output buffer has not enough frames! error occurs to me only after a click.
anywhere.

@Kakcalu13
Copy link

Kakcalu13 commented May 30, 2023

OS: 20.04 Linux with intel i7
Browser tested using Firefox.
The output shows error,
Output buffer has not enough frames! Skipping output frame.

I wanted to re-produce to the small project. See here:
image

Javascript console:
image

Here is the simplest project as possible. I just created html5 then broadcast from the godot's server http. Here is the zip:
troubleshooting_HTML5.zip

Godot version: 4.0.3-stable.

It affects the performance greatly

@Kakcalu13
Copy link

Kakcalu13 commented May 30, 2023

Update:
Mac intel 7 (Godot 4.0-stable) AND Mac M1 (Godot 4.0.3-stable) doesn't have this issue at all (used Safari)

Linux shows error on Chrome and Firefox.

I ran Chrome on Mac intel i7 (BAD IDEA since it took forever to load website), it still shows no error.

I don't have windows with me right now.

Sounds like this issue is for Linux only at this moment (until we verify with windows).

I guess the poor "workaround" is to use Mac or windows (STILL UNVERIFIED) to avoid this issue.

@VitusVeit
Copy link

I tested it on Windows 11 Home (Version 22H2 Build 22621.2271) on an AMD Ryzen 7 3700U.

The browsers I tested this on were:
Google Chrome (Version 116.0.5845.188 64-bit), Microsoft Edge (Version 116.0.1938.76 64-bit) and Firefox (Version 117.0 64-bit).

The error appears on all three browsers, the time between starting the page and the appearance of the error seems to vary depending on the browser. On Chrome it's usually shorter, on Edge it took a couple of minutes.

@Kakcalu13
Copy link

Funny, I just googled about this error Output buffer has not enough frames! Skipping output frame. and I found myself here again. Occurs same thing on 4.1.1. Mac Intel and Linux are still seeing this issue

@godotengine godotengine deleted a comment from 457205697 Sep 14, 2023
@PeterMarques
Copy link
Author

image

Thats a lot of errors for a empty project.

Can we even track what is really causing the main error concerned here on this issue?

@Jan-PieterInghels
Copy link

Jan-PieterInghels commented Nov 8, 2023

image

Having the same issue with v4.1.1 and am therefore unable to export my game.

So far I tried the following without success:

  • Disabled all console logging in build
  • Set Project Settings -> Audio -> Driver to an empty string
  • Set renderer from mobile to compatibility
  • Disable audio by setting Project Settings -> Audio -> Driver to "Dummy". Seems like this is broken in web builds too. As expected I have no audio when running the project in the engine. There is still audio playback in the web build, however.
  • Mute main audio bus. As expected, no audio is heard in build. Still invalid mix rate error with a hard crash as a result. Last console message looks slightly different though:
    image2
  • Update to v4.1.3.
  • Set Project Settings -> Audio -> Driver -> Mix Rate to 48000 to match the output rate as set in windows. See this PR

@Calinou
Copy link
Member

Calinou commented Nov 10, 2023

The invalid mix rate error appears every time you run a project on the web platform (unless you use the Dummy audio driver); you can ignore it. We should find a way to silence it on the engine side.

The Mix Rate is set to 0 on the web platform to let the browser choose, so a mix rate of 0 is valid on the web platform:

Safer override for [member audio/driver/mix_rate] in the Web platform. Here [code]0[/code] means "let the browser choose" (since some browsers do not like forcing the mix rate).

@ALiwoto
Copy link

ALiwoto commented Feb 1, 2024

Still getting the exact same error on 4.2.1-stable.

@TurtIeSocks
Copy link

I think I'm seeing a similar problem with godot 4.2.1-stable as well, though it's a little inconsistent. What is this "Threads" export exactly? I don't see this option anywhere on the HTML5 export page.

@Calinou
Copy link
Member

Calinou commented Apr 17, 2024

What is this "Threads" export exactly? I don't see this option anywhere on the HTML5 export page.

Threads are always enabled when exporting for the web in 4.2. In 4.3.dev5, you can choose to export with threads disabled in the export preset options.

@TurtIeSocks
Copy link

What is this "Threads" export exactly? I don't see this option anywhere on the HTML5 export page.

Threads are always enabled when exporting for the web in 4.2. In 4.3.dev5, you can choose to export with threads disabled in the export preset options.

Thank you for the explanation :) I'll give 4.3.dev5 a try later this afternoon.

@PeterMarques
Copy link
Author

Threads on the web is a feature that cannot be lost/sacrificed.
Its already a underperformant platform because of wasm/js/etc.

Apple is a big culprit in all this, but striving for perfomance and compability is the go to. But thats never a realistic goal.

Web/PWA is the ONLY platform relevant to me, and it is aways the most problematic.

There should be some taskforce focusing more on that, its the only gate that free us from their domain. They know that and google atleast embrance, but apple still fights against it.

Buts WASM/WebGPU/PWA is the ultimate stack, and Godot needs to make it performant, and wildly available. Thats what i believe will really empower us.

The web is and will aways be the frontier, so lets focus more on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants