SpotlightKid / python-rtmidi

Python bindings for the cross-platform MIDI I/O library RtMidi
https://spotlightkid.github.io/python-rtmidi/
Other
349 stars 65 forks source link

[windows] No result from 1.5.0 get_ports() #150

Closed frank101010 closed 1 year ago

frank101010 commented 1 year ago

OS: Windows 10 Home. 22H2, build 19045.2965 Python 3.10.10

Neither MidiIn nor MidiOut return any found devices with version 1.5.0. Version 1.4.9 works fine.

SpotlightKid commented 1 year ago

What does rtmidi.get_compiled_api() return?

brunoenten commented 1 year ago

I think I see the issue. Working on it.

frank101010 commented 1 year ago

What does rtmidi.get_compiled_api() return?

1.5.0: "[5]" 1.4.9: "[4]"

SpotlightKid commented 1 year ago

As I suspected, that means that your 1.5.0 version has only the "RTMID_DUMMY" driver compiled in, which doesn't actually provide any MIDI I/O. This happens when either the necessary system libraries are not installed or not found (e.g. on Linux the ALSA or JACK library development packages are not installed), or the package is not compiled with the right compiler directives.

I can't say what happened in your case, I would have to see the verbose logs of your installation process for that.

We provide binary wheels for 64-bit windows for Python 3.8 - 3.11 on PyPI. If your Windows Python installation is 64-bit, installation with pip should have picked up and installed one of these pre-compiled wheels, so it may be that they have been compiled incorrectly. We will check that.

SirLedfoot commented 1 year ago

As I suspected, that means that your 1.5.0 version has only the "RTMID_DUMMY" driver compiled in, which doesn't actually provide any MIDI I/O. This happens when either the necessary system libraries are not installed or not found (e.g. on Linux the ALSA or JACK library development packages are not installed), or the package is not compiled with the right compiler directives.

I can't say what happened in your case, I would have to see the verbose logs of your installation process for that.

We provide binary wheels for 64-bit windows for Python 3.8 - 3.11 on PyPI. If your Windows Python installation is 64-bit, installation with pip should have picked up and installed one of these pre-compiled wheels, so it may be that they have been compiled incorrectly. We will check that.

I have been having the same issue on a fresh install of Windows 11 with Python 3.10, this same program was working on my old install with a version of python-rtmidi from a month or more ago

AHugoson commented 1 year ago

Same issue here, Running Windows 11 and Python 3.10.11. After uninstalling 1.5.0 and switching to 1.4.9, the device does appear in the list again.

bigredfrog commented 1 year ago

Same issue.

Running a local build of Ledfx via a pycharm environment on windows for development, I can move up and down between versions 1.4.9 and 1.5.0 and see the same symptoms, where the get_compiled_api() return 5 on 1.5.0 for the dummy, where as for 1.4.9 it returns 4 for the windows api's

Is the failure mode understood ( I am assuming the windows api are missing from the wheels ) or can I assist by providing any further information?

SpotlightKid commented 1 year ago

I am assuming the windows api are missing from the wheels

Probably. I can't be 100% sure whether you installed a binary wheel from PyPI or your version was compiled locally from the source dist and failed to find the winmm lib.

If you could provide an installation log, that you be helpful:

pip uninstall python-rmidi
pip -vv install -U --no-cache-dir --log install.log python-rtmidi

... then paste output and the contents of install.log here.

bigredfrog commented 1 year ago

In my case I am managing packages via pycharm into virtual environments. I imagine that does a bin from PyPi. When I am back on that host machine that has my launchpad midi device to test against, I will see if I can command line reproduce working / non working within that virtual environment and then look to share the install.log accordingly, by end of weekend worst case.

bigredfrog commented 1 year ago

Grabbed a log, checked that pip freeze was showing 1.4.9

ran your command, pip freeze now shows 1.5.0

Midi fails

content of log

install.log

bigredfrog commented 1 year ago

I am trying to confirm I can flip from working to non working and back again, and not convinced yet, in that I may not be manipulating the right python venv or equivalent. So still working on that. Hopefully that install.log is useful, meanwhile, trying to tighten up my reproducability

bigredfrog commented 1 year ago

here is 1.4.9 with the same method

install149.log

bluetex commented 1 year ago

I'm seeing the same as @bigredfrog .. 1.4.9 is happy and will report back that we have midi ports available, 1.5.0 does not. I'm Win10, python3.10 and python3.9.

betov75 commented 1 year ago

I have a similar problem. Everything worked perfectly fine until I did something (trying to install the package in my local script folder) then I can't see any midi input or outpu devices. Now, no matter if I uninstall the module, uninstal Python or evertyhing I tried, no inputs or outputs are shown at all. It was properly installed until I did that stupid thing and I don't know how to compile or stuff like that. I see no errors, only no devices. (and they are plugged and working).

Thank you for your help on reinstalling everything clean as before.

SpotlightKid commented 1 year ago

@betov75 If you want to go back to python-rtmidi version 1.4.9, just run:

pip install "python-rtmidi==1.4.9"

@bigredfrog Thanks for the install log. Yes, this conforms that your install downloads python_rtmidi-1.5.0-cp311-cp311-win_amd64.whl from PyPI, which is apparently broken. @brunoenten is currently working on fixing the CI build procedures.

bigredfrog commented 1 year ago

Happy to help and greatly appreciate the response.

Thanks as always for the efforts and package!

fritzlb commented 1 year ago

Can confirm, currently the package installed from pypi is more or less useless on windows

SpotlightKid commented 1 year ago

Thanks for the confirmation. We're on it. We don't need any further confirmation now anymore.

bluetex commented 1 year ago

Nice. All fixed here (post 1.5.1), Thanks for the update!

frank101010 commented 1 year ago

@SpotlightKid Fix works like a charm, thank you!

SpotlightKid commented 1 year ago

Thanks to @brunoenten, who created the 1.5.0/1.5.1 releases.

bigredfrog commented 1 year ago

Tested good on ledfx with rtmidi 1.5.1 for windows, thanks all

fritzlb commented 1 year ago

Thank you very much!