-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add "libvgm" target, all sub-libraries combined. #68
Conversation
Refactors the other libraries to produce and export object libraries, then libraries "link" to the object libraries.
Other ideas, that I'm happy to help with - Prefix/rename symbols to prevent collisions. This seems like a big undertaking, and would probably break a lot of code. Since vgm-player depends on vgm-emu, maybe vgm-player could just include the objects from emu (and maybe utils), and not actually link against it? If somebody wants to link against just emu, they still could. |
Weird, I could swear this was working on my machine, but doing a fresh checkout, something seems broken |
If you are using libvgm, you do not need the vgmplay branch of GME. In fact, for other reasons, you'd probably be better off using the other fork of GME, which has had several non-vgmplay changes, while mine has pretty much stagnated in most other features. |
I'll have to run some comparisons again, I recall there being some differences that your fork was better at (like famicom expansion audio support in nsfs). My sort-of goal is to write plugins for music player daemon to reach feature-parity with your foobar plugins, which I consider the gold standard |
Famicom extension mapper audio for NSFs should be similar to mine, and if not, they'd probably love to have feature parity there. I did implement both full Sunsoft mapper waveform length control, plus a quick hack that can try to detect and permanently repair NSF/E rips that predate emulators supporting this actual hardware behavior, by patching them to use the correct lengths. The chip support is in the vgmplay branch, but shouldn't technically be any more strictly licensed than the library it was patched into, I hope. The patcher is in the foo_gep sources, and should be easily adaptable to any platform C++ code can be compiled on, but is also simple enough to be converted to plain C. Or scripting languages. |
To be honest I'm a bit unsure about the "unified" libvgm library. The initial idea was to have all parts (audio / emu / player) available separately to be easily reuseable. So making it one thing again feels a bit weird. I also remember that I already removed some "objlib" stuff from libvgm in the past. (was it the attempt to do a static+shared build?) So adding object libs again leaves some uneasy feelings to me, as it clutters the project files again. (that applies especially to generated MSVC projects) There is just one thing I want: No separate The way-to-go is definitely to prefix all exported functions, even though it will break existing code. |
Maybe this should just be closed. I think adding a prefix to the c functions may be the right solution. I can also write a linker script to hide symbols for my situation |
I'll leave the decision to you, whether you want to close it or not. |
Hi there, I ran into an issue recently -
I have a custom build of Music Player Daemon that uses libvgm, as well as kode54's fork of gme (the branch with vgmplay integrated). The intent is to use gme for non-vgm chiptunes, libvgm for everything else. The reason for the vgmplay branch - it seems to be the most up-to-date.
I link everything as shared libraries, and there's some conflicting symbol names, so I wind up having libvgm use functions from libgme or vice-versa.
On GCC, I can use the
-Bsymbolic-functions
flag to specify symbols should be resolved from the shared library first. If I do it on both libraries, I can prevent libvgm-emu functions from replacing gme functions.But, since libvgm is split up, it doesn't work the other way around - libgme functions are able to replace libvgm-emu functions, since I link to libvgm-player, which then tries to resolve symbols with already-loaded symbols, before loading libvgm-emu. I wind up having incorrect rendering and/or segfaults.
This PR adds a single-library target,
libvgm
, that's everything in one library. When I build a shared library with the-Bsymbolic
and-Bsymbolic-functions
flags, I can load both libvgm and libgme, without conflicts.I mentioned this in #59 , and thought I had solved the issue with just the
-Bdynamic
switches. I had a VGM file play incorrectly, fired up lldb and found this:Turns out using symbolic linking isn't quite enough to prevent conflicts with libgme, but with the single-library approach, the issue goes away