libADLMIDI icon indicating copy to clipboard operation
libADLMIDI copied to clipboard

Plugin for VLC Media player

Open Wohlstand opened this issue 8 years ago • 82 comments

This plugin must allows to play MIDI files through libADLMIDI by using of VLC Media Player.

The working example is stored in utils/vlc_plugin folder. Buildable on Linux with libvlccore-dev and libvlc-dev packages. Possibly on other platforms which is not tested.

  • [x] Fix CMake build (built plugin wont be loaded by VLC. However, same built by autotools-built works fine).
  • [x] Add more public codec settings (embedded bank ID, Volume model, Deep-tremolo, deep-vibrato, scaling modulation, etc.)
  • [x] Support for both VLC 2.2.2 and latest.
  • [x] Test and debug build on Windows platform.
  • [x] Make the proper recognizing of codec plugin installation target path (on Linux it's different on Ubuntu 16 and on Ubuntu 18 and not same), and install the compiled SO into that path.
  • [ ] Test and debug build on macOS platform.

Wohlstand avatar Dec 16 '17 21:12 Wohlstand

CMake build of VLC plugin has been fixed! Thanks for the help to Rémi Denis-Courmont on VideoLAN forums: https://forum.videolan.org/viewtopic.php?f=2&t=143829

Wohlstand avatar Apr 13 '18 01:04 Wohlstand

Attempt to build plugin under Windows 7 x64 results in: vlc

Linux Mint works 100% fine.

freq-mod avatar Apr 14 '18 09:04 freq-mod

Yeah, I never tested the plugin on Windows, and also, it supports VLC 2.2.2 version only yet, and I will need to add support for latest version by macros.

Wohlstand avatar Apr 14 '18 10:04 Wohlstand

Okay, on the official forum one of developers have pointed me libvlc_version.h header which will help me to make a codec be compatible with both legacy and moder versions of VLC. However, for now, I will need to install more fresh VLC build than my in-system to port current stuff into it.

Wohlstand avatar Apr 16 '18 23:04 Wohlstand

OK WTF: (building plugin under Ubuntu 18.04 running inside virtualbox) vlc

freq-mod avatar May 19 '18 18:05 freq-mod

Which version of VLC? At me was VLC 2.2.2 and the newer VLC has different API I must to support to fix this

Wohlstand avatar May 19 '18 18:05 Wohlstand

Aw shiiit, it's 3.0.1 :(

freq-mod avatar May 19 '18 18:05 freq-mod

At me is a second thing that is built from source VLC 3 I wasn't tested. For now I working on a fix for some, and I'll also try to port to it

Wohlstand avatar May 19 '18 18:05 Wohlstand

Just now I have added support for VLC 3! @papiezak , please pull fresh stuff and try again! :wink: (I have used this file as example to compare: https://github.com/videolan/vlc/blob/master/modules/codec/fluidsynth.c as originally my codec is directly basing of FluidSynth's plugin)

Wohlstand avatar May 19 '18 21:05 Wohlstand

Gotta to backport my changes to OPNMIDI

Wohlstand avatar May 19 '18 21:05 Wohlstand

it was built without of UI, but even that it now successfully plays music from a console by my plugins! :wink: So, feel free to test arround plugin again, also try to test it on Windows too...

Wohlstand avatar May 19 '18 22:05 Wohlstand

OK, let me check...

  • Linux... builds fine, works fine as well! (but I didn't test much)
  • Windows... uh oh vlc win7 (it's goes on and on )

EDIT: Removing "@" tokens from libvlc_version.h gives EXACTLY the same errors as my first attempts to build plugin under Win 7

freq-mod avatar May 20 '18 06:05 freq-mod

How to install: Just put the "libadlmidi_plugin.so" (or SymLink to it) into /usr/lib/vlc/plugins/codec/"

About of win build: I'll need to test this out by myself, this still look weird...

Wohlstand avatar May 20 '18 09:05 Wohlstand

On Ubuntu 18.04 (and most likely in an upcoming Linux Mint 19) it goes to /usr/lib/x86_64-linux-gnu/vlc/plugins/codec. That's why I had slight problems

freq-mod avatar May 20 '18 09:05 freq-mod

Drums on at least this particular XG midi are broken at one point. (time position around 00:46) Example: badxg.zip

freq-mod avatar Jun 24 '18 07:06 freq-mod

@papiezak , I have tried this file, and it seems works fine. What do you think is wrong? Try out super-fresh version. I have tested in both VLC and built-in MIDI player.

Wohlstand avatar Jun 25 '18 01:06 Wohlstand

Yeah, sorry my bad, it was a very stupid bug in my DMXOPL mod bank. But is it okay if I don't see any public codec settings except (custom) bank selection and amount of chips? Your main post says it's done already :suspect:

freq-mod avatar Jun 25 '18 07:06 freq-mod

You right, damn, forgot to add them, gonna to add them on a quick hand... P.S. Is VLC plugin now buildable on Windows? (Did you tested build recently?)

Wohlstand avatar Jun 25 '18 10:06 Wohlstand

last time i used windows (a week ago) it wasnt :disappointed: but I will check, give me some time...

freq-mod avatar Jun 25 '18 12:06 freq-mod

_2018-06-25_15-10-17 Now setup is this

Wohlstand avatar Jun 25 '18 12:06 Wohlstand

Similar for OPNMIDI: _2018-06-25_15-30-19

Wohlstand avatar Jun 25 '18 12:06 Wohlstand

aaand here goes nothing: vlc win 10

OK am I doing something wrong?

freq-mod avatar Jun 25 '18 12:06 freq-mod

Did you even installed VLC SDK? (or build it from sources)

Wohlstand avatar Jun 25 '18 12:06 Wohlstand

Or maybe need to append more search paths here? https://github.com/Wohlstand/libADLMIDI/blob/ccfb31ab7cd966aeddb106f7a1c3efec6834dccc/cmake/FindLIBVLC.cmake#L35-L44

Wohlstand avatar Jun 25 '18 12:06 Wohlstand

vlc take 2

freq-mod avatar Jun 25 '18 13:06 freq-mod

Oh, one thing you need, you need to use MinGW-w64, you need to compile complete VLC from sources. And yeah, as I looked VLC docs, VLC no more supports vanilla MinGW (32-bit only) toolchains.

Wohlstand avatar Jun 25 '18 18:06 Wohlstand

I didn't compile VLC or its SDK from sources. SDK files, devel headers, import libraries come with official 7-zip package.

freq-mod avatar Jun 25 '18 19:06 freq-mod

Anyway, try to use MinGW-w64 toolchain instead of vanilla. I have tried to find their pre-built SDK package, but found nothing, can you link me that? I wanna try to build the things by myself...

Wohlstand avatar Jun 25 '18 19:06 Wohlstand

Grab it then - https://get.videolan.org/vlc/3.0.3/win32/vlc-3.0.3-win32.7z Speaking of plugin - vlc take 3

everything is installed correctly, findLIBVLC.cmake is modified appropriately ( I think), libvlccore is taken from that package and it's the result.

freq-mod avatar Jun 25 '18 19:06 freq-mod

Seems you are trying to link x86_64 with X86_32, carefully check the archirecture of toolchain and the package (try to use 64-bit MinGW-w64 and 64-bit VLC), or be sure you have 32-bit MinGW-w64 toolchain.

Wohlstand avatar Jun 25 '18 20:06 Wohlstand