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

MediaCtrl load() failing on Macos 10.15 Catalena #1413

Closed
jw35 opened this issue Oct 25, 2019 · 9 comments

Comments

@jw35
Copy link

@jw35 jw35 commented Oct 25, 2019

Operating system: Macos 10.15 (Catalina)
wxPython version & source: wx.version: 4.0.6 osx-cocoa (phoenix) wxWidgets 3.0.5 via pip
Python version & source: Stock Python 3.7.3 (default, Sep 5 2019, 17:14:41)

Description of the problem:

MediaCrtl's load() method fails to load at least data/testmovie.mpg and a selection of .midi files.

This is demonstrated by running the supplied demo/MediaCtrl.py:

image

The same code works fine on 10.13 and 10.14.

@jw35 jw35 mentioned this issue Oct 25, 2019
@jw35

This comment has been minimized.

Copy link
Author

@jw35 jw35 commented Nov 4, 2019

This issue is also mentioned on the wxWidgets forum:

https://forums.wxwidgets.org/viewtopic.php?f=23&t=46424

@RobinD42

This comment has been minimized.

Copy link
Member

@RobinD42 RobinD42 commented Nov 5, 2019

Please try using a 4.1 preview build. It appears that whatever the problem was that it has been fixed there already.

pip install --pre -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython
@jw35

This comment has been minimized.

Copy link
Author

@jw35 jw35 commented Nov 5, 2019

Thanks for that. Good news and bad news.

On 10.15 Catalina MediaCrtl from the 4.1 preview successfully plays data/testmovie.mpg:

Python 3.7.3 (default, Sep 5 2019, 17:14:41)
[Clang 11.0.0 (clang-1100.0.33.8)]
wx.version: 4.1.0a1.dev4480+59362e89 osx-cocoa (phoenix) wxWidgets 3.1.3

But on both 10.15 Catalina and on 10.14 Mojave it now won't play MIDI files (reporting the same 'Unsupported format?' error). The previous version does play MIDI files on 10.14, but not 10.15:

Python 3.7.4 (default, Jul 9 2019, 18:13:23)
[Clang 10.0.1 (clang-1001.0.46.4)]
wx.version: 4.0.7.post1 osx-cocoa (phoenix) wxWidgets 3.0.5

Unfortunately it's MIDI playback that I need :-(

Here's an example MIDI file that loads and plays under 4.0.7.post1 but not 4.1.0a1.dev:

tune.zip

@jw35

This comment has been minimized.

Copy link
Author

@jw35 jw35 commented Nov 5, 2019

I've experimented with wxWidget's mediaplayer sample in both the 3.0.4 and 3.1.3 releases to try to work out if the problem is with the wxWidgets library or with wxPython. There appear to be issues building 3.0.4 under Macos 10.14 and 10.15 because of the removal of stdlibc++ and to work around that I had to run ../configure with --with-macosx-version-min=10.9 when building 3.0.4. This seems to have been fixed in 3.1.3.

All 4 mediaplayers seemed to work the same - all successfully played a MPEG movie and none played a MIDI file, but I don't actually know if mediaplayer is intended to support miid playback.

@RobinD42

This comment has been minimized.

Copy link
Member

@RobinD42 RobinD42 commented Nov 6, 2019

I've been wondering similar things myself, since Apple's QuickTime Player does not play the file either. It presumably uses the same or similar APIs that wxWidgets is using for the wxMediaCtrl. The only 3rd party app installed on my system that is able to play the file is VLC.

FTR, in wx 3.0.x either the QTKit or AVKit APIs were used, depending on the version of the SDK being used for the build. In wx 3.1.x the QTKit code has been ripped out since those APIs have been deprecated since OSX 10.9, and only the AVKit-based code remains.

My guess is that the older build where the MIDI files worked for you on 10.14 used the QTKit option during the build due to using an older SDK, but that on 10.15 the back-end platform support for those APIs has been removed from the OS. (The VM used for the release builds is an older OSX with an older Xcode installed on it.) And the recent test builds you and I have done on newer OS versions, using newer Xcodes/SDKs are using the newer AVKit APIs which no longer support MIDI files. Just a guess, but it seems to fit the circumstances and Apple's proclivities for not maintaining backwards compatibility for things they deem are no longer important. (For example, Carbon and 32-bit binary support are totally gone in 10.15 too.)

@jw35

This comment has been minimized.

Copy link
Author

@jw35 jw35 commented Nov 7, 2019

Yes, I'm sure that's exactly what's happening. In particular it explains why my 3.0.4 build on 10.14 won't play MIDI when I'd thought it would based on the current wxPython behaviour.

I'll see if I can install an older xcode on my 10.14 box that will work without '--with-macosx-version-min=10.9'. If the resulting wxWidget's mediaplayer can then play MIDI that would confirm it.

Apple have certainly been removing MIDI support from things like QuickTime Player for a while. However I think that this https://developer.apple.com/documentation/avfoundation/avmidiplayer imply that the newer/current AV implementation does still support MIDI playback. Is that your reading? However I suspect it works differently from how it used to and would need some development in wxWidgets to expose this functionality. MIDI is a bit of a niche interest so I'm not convinced anyone will want to do the work and I don't have the right skill set. That said, if I can demonstrate an actual regression...

Unfortunately the software I'm working on (the EasyABC music editor https://github.com/jwdj/EasyABC) works by generating MIDI and them playing it. I may have to abandon using wxPython for this (at least on Macos) and implement a separate midi player using either Apple's AVMIDIPlayer directly, or something like FluidSynth (for which support already exists on Windows).

@jw35

This comment has been minimized.

Copy link
Author

@jw35 jw35 commented Nov 7, 2019

The VM used for the release builds is an older OSX with an older Xcode installed on it.

Do you happen to know which OSX and which Xcode? I'm struggling to find a combination of OSX and Xcode versions that will build 3.0.4 without needing --with-macosx-version-min overrides.

@RobinD42

This comment has been minimized.

Copy link
Member

@RobinD42 RobinD42 commented Nov 11, 2019

OSX 10.10, Xcode 7.2.1

@RobinD42

This comment has been minimized.

Copy link
Member

@RobinD42 RobinD42 commented Nov 13, 2019

It apparently won't help MIDI support, but I've made a new 4.0.7 build that forces the use of the AVFoundation APIs instead of QTKit, so wxMediaCtrl will work on macOS 10.15 for other media formats.

@RobinD42 RobinD42 closed this Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.