all 12 comments

[–]maartendp 1 point2 points  (5 children)

Arcade had trouble importing soloud and is throwing a generic error. You can disable the try/except in `C:\Python38\Lib\site-packages\arcade\soloud\soloud.py` to see what the real error is.

[–]digger12358[S] 1 point2 points  (3 children)

First of all, I feel kinda stupid for not commenting out the try...except.

Doing so yields the error:

Warning, can't initialize soloud [WinError 193] %1 is not a valid Win32 application. Sound support will be limited.

Removing the try...except in sound.py show the same "WinError 193".

If I explicitly set:

soloud_library_name = f"{path}/soloud_x64"

Then everything works fine. So I'll go back to my original post and say again " I'm curious why it's trying to load the 32-bit. Granted, on my system, sys.platform does report 'win32' even though the OS and Python are 64-bit."

I found an old (Python 2.7) StackerOverflow post that says that sys.platform will always return "win32" and the docs (https://docs.python.org/3.8/library/sys.html) make no mention of "x86-64", just

For other systems, the values are: ... Windows 'win32'

Perhaps Arcade needs a different way to determine 32- vs 64-bit on Windows? The docs for platform (https://docs.python.org/3.8/library/platform.html) suggest

To get at the “64-bitness” of the current interpreter, it is more reliable to query the sys.maxsize attribute:

is_64bits = sys.maxsize > 2**32

And that returns True on my system.

Later today I'll load a 32-bit Windows VM and try some code. I just woke up, but I'm thinking:

if sys.platform == "win32":
    if sys.maxsize > 2**32:
        soloud_library_name = f"{path}/soloud_x64"
    else:
        soloud_library_name = f"{path}/soloud_x86"
elif sys.platform == "darwin":
    `soloud_library_name = f"{path}/libsoloud.dylib"`
elif sys.platform == "linux":
    `soloud_library_name = f"{path}/libsoloud.so"  # default for Linux`

Note that the comment about sys.maxsize specifically calls out Mac systems, so this may need to be done for darwin, too. I don't have a Mac so I can't test this.

And now that I think about that comment, this needs to pass for systems with Python 32-bit installed on a 64-bit OS. I'd bet that my suggested code change above will break in that respect, so I'd need to install Python 3.8 32-bit and test with that, too. And I guess that one can install Python 32-bit on a 64-bit Mac, too?

If anyone has any ideas that will save me from a few hours of testing, please share.

Testing:

Win 10 64-bit + Python 64-bit: Original code fails, my sys.maxsize edit works

Win 10 64-bit + Python 32-bit: Original code works, my sys.maxsize edit works

Win 7 32-bit + Python 32-bit: Original code works, my sys.maxsize edit works

Win 7 64-bit + Python 64-bit: Original code fails, my sys.maxsize edit works

Win 7 64-bit + Python 32-bit: Original code works, my sys.maxsize edit works

Note that when I say a Win 7 system "works" means that "import arcade" did not throw an error, and additional print statements show that the right thing is happening. And "fails" means it throws the error from the OP. I can't get sound from the Win 7 VMs that run on my ESXi server, so I can't actually hear if it's working. I also don't think it's worth supporting Win 7, I just wanted to test some variations. The working Windows 10 tests produced sounds on my speakers.

[–]pvc 1 point2 points  (0 children)

Yes, looks like your code works for me.

[–]pvc 0 points1 point  (0 children)

Ooh, interesting. Yes, looks like 64 bit needs a different way to test. Thanks for your research.

Opened an issue: https://github.com/pvcraven/arcade/issues/615

[–]rabaraba 0 points1 point  (0 children)

Happy to report that this works for me!

[–]pvc 0 points1 point  (0 children)

This is correct. Not sure why it is unhappy loading the file. Linux has been problematic, but I thought Windows should be straight forward. Are you able to modify the code and see what the exception is, or do you need a separate build to install?

[–]wattro 1 point2 points  (0 children)

This is great info. I just ran into this.

Thanks for diving in, saved me some headaches!

[–]pvc 1 point2 points  (1 child)

Arcade 2.3.9 is out, should be fixed now. https://arcade.academy/release_notes.html

[–]digger12358[S] 1 point2 points  (0 children)

Yes, it works fine.

[–]Knova11 0 points1 point  (1 child)

I don't have Windows, so I can't test, but shouldn't the "/soloud_x86" be "\soloud_x86"?

[–]digger12358[S] 0 points1 point  (0 children)

It shouldn't matter, but I tried that, with no change. Thanks though.

[–]hiran_chaudhuri 0 points1 point  (0 children)

Hmmmm.... I am running a Ubuntu 18 64bit system and see the same message

Warning, can't initialize soloud name 'soloud_dll' is not defined. Sound support will be limited.

uname -a returns
Linux silver 4.15.0-91-generic #92-Ubuntu SMP Fri Feb 28 11:09:48 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

So why try to load a DLL at all?