exoticorn / microw8

MicroW8: A WebAssembly based size-coding platform
https://exoticorn.github.io/microw8
The Unlicense
182 stars 5 forks source link

[BUG] Sound not working on windows binary #8

Open teadrinker opened 1 year ago

teadrinker commented 1 year ago

This is written to console:

Failed to init sound: Could not find float output config
teadrinker commented 1 year ago

the new dev version also don't work, however it giver this message:

Failed to init sound: Could not find float or 16bit signed output config
teadrinker commented 5 months ago

Unfortunately, I still get this with the new version v0.3.0 Could it be related to the exe selecting some output device that is not in use? (I have a few)

What audio api/backend are you using, I could try some of their examples to make sure it's a not problem already with the backend for my machine...

exoticorn commented 5 months ago

Can you try the build here? https://github.com/exoticorn/microw8/actions/runs/9242703061 I added support for mono-only audio devices, which is my best guess at what could be your issue. And in case no suitable output config could be found, I now print out the available configs and the name of the device used.

teadrinker commented 5 months ago

Sure! It seems the problem might be it's listed as 8 channels...

No suitable audio output config found on device "Speakers (Realtek(R) Audio)", available configs: 8ch i32 8ch f32 Failed to init sound: Failed to configure audio out

(I get the same result with headphones plugged in, but it says "Headphones" instead of speakers)

For context, this is an alienware laptop, and by default it has a lot of weird stuff like bass boost and smart loudness filters, but I have all of it turned off. Perhaps it also has support for movie watching using dolby multichannel? (which would be useless on the built-in laptop speakers, and also the stereo headjack...)

exoticorn commented 5 months ago

It feels weird to not offer a simple stereo config even on a surround setup. But I guess I can just write the sound to the first two channels and zero the rest in such a case, hoping that will reach the correct speakers.

teadrinker commented 4 months ago

(I accidentally discovered that sound works when using a Bluetooth headset. However, bluetooth adds too much latency so I rarely use it...)

exoticorn commented 4 months ago

I added support for sound on devices that only offer more than 2 channels. (Writing only to the first two channels, ignoring the rest).

You could try the build at https://github.com/exoticorn/microw8/actions/runs/9535585811 and see whether that fixes your issue.

teadrinker commented 4 months ago

Thanks, it works! :)

However, it only works if I run the audio device at 44100. (in Sound Settings/Device Properties/Additional Device Properties/Advanced)

48000,192000 etc gives crackled sound.