Wohlstand / libADLMIDI

A Software MIDI Synthesizer library with OPL3 (YMF262) emulator
GNU Lesser General Public License v3.0
174 stars 17 forks source link

No sound when using demo midi player #32

Closed freq-mod closed 6 years ago

freq-mod commented 6 years ago

I don't know what's wrong and since when it's a problem but: -adlmidiplay.exe builds without any problems, compiler doesn't moan about anything -it runs without any problems, reads MIDI files, custom banks, etc.. BUT There's no audio. Nothing can be heard. Sometimes you can hear a very short and quiet click and that's it.

OS is Windows 10 Enterprise, if it helps.

Wohlstand commented 6 years ago

Any MIDI file or some of them? Check out, was libSDL2 built with enabled WASAPI? (find in the SDL config header the define which turns on WASAPI thing).

freq-mod commented 6 years ago
  1. Absulutely all of them
  2. I used SDL2 development package for MinGW. It apparently has WASAPI enabled by default.
Wohlstand commented 6 years ago

You need to build SDL2 with turned down WASAPI when using Nuked OPL3 emulator. For now is impossible to turn down WASAPI by configure request: https://bugzilla.libsdl.org/show_bug.cgi?id=3798 and in SDL Mixer X and PGE Project when I building SDL2, I hacking configure file to turn WASAPI down because it produces a playback troubles. However, you are can force use DirectSound output from modified code using SDL_OpenAudioDevice(), or set SDL_AUDIODRIVER environment variable to directsound.

freq-mod commented 6 years ago

OK, so it's a problem with SDL. I will try my best at hacking config ;_; BTW building DOSbox emulator produces something... weird. dosbox adlmidi demo util that goes on for like 200 lines.

Wohlstand commented 6 years ago

Pull update, I have fixed that, MinGW-w64 seems doesn't defines ssize_t while vanilla MinGW does

freq-mod commented 6 years ago

That's weird, it still craps out: dosboxxx

Wohlstand commented 6 years ago

Okay, let's i'll try to build that by myself... Gonna boot up my Virtual Box VM...

Wohlstand commented 6 years ago

Check out again, I tested out that at me and that is now has been fixed!

freq-mod commented 6 years ago

Yeah, it compiles now! Too bad thre's no sound... but it's a different thing.

Wohlstand commented 6 years ago

Let's I'll check out it with default SDL2 assembly from the site which you have used by yourself to test out for a reason why not works

freq-mod commented 6 years ago

https://www.libsdl.org/download-2.0.php there it is

Wohlstand commented 6 years ago

Okay, I successfully ran Windows 10 on VirtualBox (VMware have dead, and I have tried to use same image on VirtualBox, and it works fine), installed MinGW and CMake, built player, and then I have found that I got the sound when I ran:

set SDL_AUDIODRIVER=winmm

or

set SDL_AUDIODRIVER=directsound

And then sound is appears, with Nuked

WASAPI is totally broken, I always disabling it while building own SDL2 builds

freq-mod commented 6 years ago

How to set it? I'm inept at compiling anything on Windows, including SDL.

Wohlstand commented 6 years ago

Just type from command line before running player itself, or set it in the system properties as global environment variable SDL_AUDIODRIVER

freq-mod commented 6 years ago

Thanks a lot! Finally I can hear glorious YMF262 audio!

Wohlstand commented 6 years ago

Same for YM2612 :wink: (libOPNMIDI project uses same code base as libADLMIDI except of chip emulation backend and other specifics)

Wohlstand commented 6 years ago

I'll close this as trouble has been resolved!