-
Notifications
You must be signed in to change notification settings - Fork 277
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
Juce 5 changes #208
Juce 5 changes #208
Conversation
@ferdnyc Looks like only Mac fails on the libopenshot Mac Output: gitlab-mac-build-output.txt |
@jonoomph Mm, so I see, looks like the Mac has a Could I see the output of a successful Mac build of the develop branch, though? It'd be helpful when comparing the two branches if I could also compare the output. Thx. Oh, a copy of |
@ferdnyc Yeah, agreed. Successful Mac Build: gitlab-mac-build-output.txt |
Okay, I think I fixed the Mac build issue with the following hack in JuceHeader.h (in libopenshot-audio): OpenShot/libopenshot-audio@10835cb |
Based on my research, many people recommend to never include So, this hack to just undefs the Mac Point class after JUCE includes it. So.... not beautiful, but seems to work fine. |
Linux and Mac builds now work correctly (play audio and play video). Windows build plays no audio, so I'm digging into that now. I've had this problem in the past though, so I'm going to try the same basic approach as before: OpenShot/libopenshot-audio@29b42e6 |
Makes sense, that's basically what I proposed in #189 to work around the And with |
Here is the output of openshot-audio-test-sound.exe (on Windows 10): Old Version of JUCE (working / plays sound)
New Version of JUCE (broken / no sound)
|
Perhaps I'll try and enable JUCE_WASAPI_EXCLUSIVE |
Okay, now the output of |
@jonoomph |
There's also Juce's Tutorial: The AudioDeviceManager class — which is probably packaged in the release zip file as a ready-to-build project. Building and running that on Windows may give you an idea of whether it's a Juce issue, a configuration problem, or something in the libopenshot-audio code. ETA: OK, well, it isn't in the zip file, but it is downloadable on the tutorial page. |
After some additional debugging, it appears that there is no audio device open, and regardless of how I initialise (or initialiseWithDefaultDevices) the deviceManager still has no audio device open (and thus no sound is played). However, someone else who tested the juce5 build from yesterday, mentioned they did successfully play audio on Win 7 (32-bit). So, perhaps this is a bit more nuanced. |
Hmm. Could be that when multiple outputs are available, instead of opening a default choice on initialization, no device is chosen. Which also could be a change in Win10, compared to Win7. (Perhaps Win10 is less aggressive about forcing a default when no selection is made? My Linux desktop technically has three audio outputs, and while some autodetection is possible — e.g. I don't have an HDMI cable connected, so that one's out — it's still a bit complex. Fortunately PulseAudio does have a systemwide "default" flag, because otherwise it'd be a real pain for software to correctly divine that I don't use the built-in sound card, so sound needs to be routed to the USB audio device instead.) One solution might be a "Default Audio Output Device" selector, to go with the "Default Audio Sample Rate" and "Default Audio Channels" in Preferences > Profiles. It'd be nice if that could be avoided, of course, but it'd give users a way to set the output device if/when one doesn't get selected automatically. |
@jonoomph |
Got it working on Windows 10 (which reaffirms my dislike of Windows)! Apparently, JUCE was failing to initiate a WASAPI connection because my default playback device in Windows was 24-bit 48 kHz, and the associated microphone was 16-bit 48 kHz. Same sample rate, but different bit rates. Once those matched in Windows, audio played back just fine. |
So, no more changes are required for libopenshot-audio for Windows 10. However, JUCE does return an error string during the |
I've added in a GetError() method on QPlayer, so we can access an error (if any is encountered during the initialise() method), and it will now bubble up in openshot-qt during launch. Not perfect, but much more communicative than before. 😋 |
Sweet! Yeah, that's something that would be good to sort out more generally, e.g. for calls to FFmpeg library functions which can also fail... silently, as things currently stand, unless debugging mode is enabled. (I have an Issue open somewhere about that.) That's kind of hilarious that it wouldn't open an output device because your input device is set to a different bit depth — when you're explicitly not even asking for any input channels!! // Initialize audio devices
cout << "Begin init" << endl;
AudioDeviceManager deviceManager;
deviceManager.initialise ( 0, /* number of input channels */
2, /* number of output channels */
0, /* no XML settings.. */
true /* select default device on failure */); I can't even decide if that's Windows or JUCE being stupid. I guess there's room to blame both. It sort of feels like, while that situation should be handled better by Windows, since it's not the JUCE code could try to work around it instead of just erroring out. |
Aargh! I keep forgetting those don't work cross-repo. (Also, Github, it sucks that those don't work cross-repo. At least for repos with the same owner!) |
@jonoomph Once that happens, what are your thoughts on releasing the changes? Easiest from my perspective (as Fedora maintainer) would be new releases of the libraries alone, without OpenShot. Then I could package OpenShot 2.4.4 for Fedora 30+ with dependencies on new If you wanted to hold off on new library releases for now, maybe address other issues or whatever, that's not a problem either. In the interim I can build F30 library packages from the repos' git HEAD. There's no policy requiring we package only release versions, it's just preferred as the path of least resistance under normal circumstances. (The GCC 9 breakage would of course constitute abnormal circumstances.) (Oh, and at the risk of being a pest, any word on the |
I'm waiting on the PPA to update before merging this into |
This has been merged into |
@ferdnyc Regarding a new release, I would suggest building against HEAD if you are looking for the easiest and quickest solution. I think the earliest a new release would be possible is a couple weeks away, for the same reason: #BecauseLazy, haha |
@jonoomph Works for me! Fedora 30's still almost a month away, anyway. Whoops! Nope, more than a month away. Slipped another week. |
Adjustments to build libopenshot against a libopenshot-audio built with the new Juce 5.4.3 changes from my companion PR OpenShot/libopenshot-audio#37.
#include "JuceLibraryCode/JuceHeader.h"
were changed to simply#include "JuceHeader.h"
, which works in concert with the new include dir layout for libopenshot-audio.cmake/Modules/FindOpenShotAudio.cmake
discovery code to remove all of the recursive header-file discovery andLIBOPENSHOT_AUDIO_BASE_DIR
noise.Now it simply looks for the file
JuceHeader.h
and considers that location to be theLIBOPENSHOT_AUDIO_INCLUDE_DIR
, which it is. So much simpler it's not even funny.(Note: DO NOT MERGE until after the corresponding changes to libopenshot-audio are committed. See OpenShot/libopenshot-audio#37 .)