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

player error: Driver Init Error: F0 #104

Open
cd4053 opened this issue Dec 24, 2022 · 6 comments
Open

player error: Driver Init Error: F0 #104

cd4053 opened this issue Dec 24, 2022 · 6 comments

Comments

@cd4053
Copy link

cd4053 commented Dec 24, 2022

OS: Windows 10 22H2 (19045.2364)

Compilation steps (MSYS2/MINGW) after git clone:

mkdir build && cd build
cmake .. -G"MSYS Makefiles"

Error:

player song.vgm
Opening Audio Device ...
Using driver XAudio2.
WaveOut: Driver Init Error: F0

Using the vgmplay-libvgm (vgmplay) works just fine.

@ValleyBell
Copy link
Owner

ValleyBell commented Jan 21, 2023

I finally set up my MSYS toolchain and tried this. Unfortunately I can't reproduce this error.

user@host MINGW64 /d/VStudio-Programme/VC2010/libvgm
$ mkdir build-msys && cd build-msys

user@host MINGW64 /d/VStudio-Programme/VC2010/libvgm/build-msys
$ cmake .. -G"MSYS Makefiles"
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Found ZLIB: C:/msys64/mingw64/lib/libz.a (found version "1.2.13")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found Iconv: C:/msys64/mingw64/lib/libiconv.a
-- Configuring done
-- Generating done
-- Build files have been written to: D:/VStudio-Programme/VC2010/libvgm/build-msys

user@host MINGW64 /d/VStudio-Programme/VC2010/libvgm/build-msys
$ make -j4 player
[  1%] Building C object utils/CMakeFiles/vgm-utils.dir/DataLoader.c.obj
...
[100%] Linking CXX executable bin/player.exe
[100%] Built target player

user@host MINGW64 /d/VStudio-Programme/VC2010/libvgm/build-msys
$ bin/player.exe ../demofiles/C6280__Batman_01\ Title.vgz
Opening Audio Device ...
Using driver XAudio2.
Opening Device 0 ...
Loading C6280__Batman_01 Title.vgz ...  VGM v161, Total Length: 32.73 s, Loop Length: 32.21 s
Song Title: Title
Done.ng 3.02 / 64.95 ...

Can you try another audio driver? Just change the value in the following line to 0 or 1 or 2.

static INT32 AudioOutDrv = -2;


EDIT: Error 0xF0 is AERR_API_ERR. This can happen in multiple places in the XAudio2 driver. Maybe you can modify AudDrv_XAudio2.cpp to print messages before throwing the error so I can identify where it happens?
I'm still not sure why it should fail, as I'm using Windows 10 22H2 as well.

@cd4053
Copy link
Author

cd4053 commented Jan 21, 2023

Hi, thank you for looking into this.

Bellow, the results changing libvgm/player.cpp at current commit c250212:

static INT32 AudioOutDrv = 0;

bin/player.exe ../1.vgm
Opening Audio Device ...
Using driver WinMM.
Opening Device 0 ...
Loading 1.vgm ...  VGM v150, Total Length: 69.65 s, Loop Length: 61.36 s
Song Title: Stage 4-1 ~Gotham City Streets 2~ & Stage 5 ~ In the Sky Over Gotham City~
Playing 35.21 / 131.01 ...

static INT32 AudioOutDrv = 1;

bin/player.exe ../1.vgm
Opening Audio Device ...
Using driver DirectSound.
Opening Device 0 ...
Loading 1.vgm ...  VGM v150, Total Length: 69.65 s, Loop Length: 61.36 s
Song Title: Stage 4-1 ~Gotham City Streets 2~ & Stage 5 ~ In the Sky Over Gotham City~
Playing 35.21 / 131.01 ...

static INT32 AudioOutDrv = 2;

bin/player.exe ../1.vgm
Opening Audio Device ...
Using driver XAudio2.
WaveOut: Driver Init Error: F0

Sorry, I'm not a software developer, can you guide me on how edit AudDrv_XAudio2.cpp so it can output debug messages?
Thank you.

@gzaffin
Copy link

gzaffin commented Jan 21, 2023

Debugging with VS2022 I see that XAudio2Create fails
XAudio2Create_fails

because called CoCreateInstance fails
CoCreateInstance_fails

@ValleyBell
Copy link
Owner

umm... "Class not registered"???
It looks like certain Windows 10 versions don't support XAudio2. That's news to me.

I should definitely make a separate error code for that case and print a proper error message.

@gzaffin
Copy link

gzaffin commented Jan 22, 2023

I noticed that in a laptop with Windows 7 I've got XAudio2_7.dll, XAudio2_6.dll, XAudio2_5.dll, XAudio2_4.dll, XAudio2_3.dll, XAudio2_2.dll, XAudio2_1.dll and XAudio2_0.dll .
There is no problem in using XAudio2 with this Windows 7 setup.
On the other hand in a laptop with Windows 11 I've got XAudio2_9.dll and XAudio2_8.dll . I cannot make libvgm use XAudio2 with this setup.
This can be, possibly, a matter of incompatibility among XAudio2 versions.

@gzaffin
Copy link

gzaffin commented Jul 18, 2023

I had a bit of spare time and I went on debugging XAudio2 of libvgm on Windows 11.
Screenshot 2023-07-19 001827

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

No branches or pull requests

3 participants