-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
AudioIO uses private PaUtil_GetTime API of PortAudio #871
Comments
Debian hacks around this with a really ugly hack to just implement the PaUtil_GetTime function directly in src/AudioIO.cpp. |
This fix will be easy, but I feel like that #853 should go first. The reason is - stuff like https://github.com/audacity/audacity/blob/master/src/AudioIO.cpp#L477 looks a bit spooky when you build against system library :) |
Copying over a comment from @rbdannenberg:
I for one will not bother figuring out whether that creates or fixes a problem. |
My dear Be-ing, accept my apologies for the inconveniences caused you by the state of the source tree. Please see the recently pushed c3babc1 which makes it possible once again to compile with EXPERIMENTAL_MIDI_OUT undefined. Let me explain that in the summer of 2017, for version 2.2.0, @Pokechu22 (a friend of Audacity then and now), Roger Dannenberg (the co-founder of Audacity and a portaudio contributor), Steve Daulton, I, and others worked hard together to make MIDI playback work cross-platform. Getting the timing to work right on all platforms was difficult, especially in the case of Linux with ALSA. It was Roger's hard work especially that led to the present expedient after much trial and error. The EXPERIMENTAL_MIDI_OUT branch was at last made good enough to be turned on in production code by default. But unfortunately, we were then negligent in ensuring the continued possibility to build the program with the same turned off. Doing so will now build and give you a version of Audacity without its MIDI playback capability. But perhaps you and your users would find that restriction of functionality unacceptable. If so, then propose a fix that preserves well synchronized MIDI playback on all platforms, as verified by testing. |
Thanks for fixing the build without the #210 looks like it may be a viable solution if it is rebased and updated for CMake. I am doubtful anyone would have seriously considered the present implementation using a library's private API in the first place if PortAudio was not vendored. |
The current implementation was used without knowledge that it didn't work on all platforms; if I recall correctly, what I did was resurrect a lot of very old code that already existed in Audacity, which had some design decisions that probably wouldn't have been made if written from scratch. I can't recall if there were timing/synchronization issues with It's also worth noting that the reason audacity does the patch to PortAudio is because |
I don't think it's a bug in PortAudio. Audacity is using a private API. There is no way to use this API when PortAudio is used normally; the header for the symbol is not installed and Audacity fails to link. |
You shouldn't need to put the extern on the function definition and the declaration. Putting it on the declaration in the header and then having that included in the file containing the definitions before the definitions should make the functions all have C linkage on every standards-compliant compiler.
No, I don't think it would be. PortAudio tells the linker exactly what it wants exposed through a |
PaUtil_GetTime is defined in src/common/pa_util.h in PortAudio. This header is not installed by the build system as confirmed by checking the files installed by Fedora's portaudio-devel package:
pa_util.h is not listed in the PortAudio documentation either. Audacity is using a private function of PortAudio. This prevents linking Audacity to packages of PortAudio.
The code that uses PaUtil_GetTime is guarded by an #ifdef:
So I tried building with the
-Daudacity_use_portaudio=system -DUSE_PORTMIXER=OFF
CMake options and the patch below to use the system PortAudio without Audacity's PortMixer fork which requires Audacity's PortAudio fork to build and without MIDI support:but this fails to build:
The text was updated successfully, but these errors were encountered: