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

WIP: vmpk: 0.5.1 -> 0.6.2 #33491

Closed
wants to merge 1 commit into from
Closed

WIP: vmpk: 0.5.1 -> 0.6.2 #33491

wants to merge 1 commit into from

Conversation

magnetophon
Copy link
Member

@magnetophon magnetophon commented Jan 5, 2018

Motivation for this change

Doesn't do anything: when I run it, I get no program, but also no errors in the cli.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@magnetophon
Copy link
Member Author

I also tried the latest trunk: it flashes a window and then does nothing.

{ stdenv, fetchurl, cmake, pkgconfig, unzip
, qt5, libpthreadstubs, libXdmcp, drumstick, docbook_xsl, libjack2
}:

let
  version = "0.7.0rc";
in stdenv.mkDerivation rec {
  name = "vmpk-${version}";

  meta = with stdenv.lib; {
    description = "Virtual MIDI Piano Keyboard";
    homepage    = "http://vmpk.sourceforge.net/";
    license     = licenses.gpl3Plus;
    platforms   = platforms.linux;
  };

  src = fetchurl {
    # url = "mirror://sourceforge/vmpk/${version}/${name}.tar.bz2";
    url = "https://sourceforge.net/code-snapshots/svn/v/vm/vmpk/code/vmpk-code-476-trunk.zip";
    sha256 = "0b2jqfhir1hci5fbfanf34qjq78c4y36ba8p4zkfv18jic4wrn86";
  };

  nativeBuildInputs = [ cmake pkgconfig unzip ];

  buildInputs = [ qt5.qtbase qt5.qtsvg qt5.qttools qt5.qtx11extras libpthreadstubs libXdmcp drumstick docbook_xsl libjack2 ];

  CXXFLAGS = "-O3 -march=native -mtune=native -DNDEBUG";

  preConfigure = "cd desktop";
}

@pedrolcl
Copy link

pedrolcl commented Apr 9, 2018

As I've said privately by email, this is probably related to this comment on drumstick/default.nix :

#Temporarily remove drumstick-piano; Gives segment fault. Submitted ticket

No, nobody submitted any ticket to the drumstick tracker:
https://sourceforge.net/p/drumstick/bugs/

Both drumstick-vpiano and VMPK use the "drumstick-rt" library. This library is a very thin interface, where the main functionality resides on plugins. This is a layout of the build/lib directory on a normal cmake compilation:

drumstick-build$ tree lib/
lib/
├── drumstick
│   ├── libdrumstick-rt-alsa-in.so
│   ├── libdrumstick-rt-alsa-out.so
│   ├── libdrumstick-rt-eassynth.so
│   ├── libdrumstick-rt-net-in.so
│   ├── libdrumstick-rt-net-out.so
│   ├── libdrumstick-rt-oss-in.so
│   └── libdrumstick-rt-oss-out.so

The plugins should be installed somewhere libdrumstick-rt will search, for instance: "../lib{,32,64}/drumstick" (relative to the executable location), or QCoreApplication::libraryPaths() + "/drumstick" where Qt5 search its own plugins, or setting the environment variable $DRUMSTICKRT pointing to the plugins directory (for testing and development scenarios). These are Qt style plugins, so the usual restrictions about version, compiler, build options, etc. apply here.

By the way: drumstick-1.1.1 doesn't build the fluidsynth direct output plugin anymore by default (you need to patch the build system if you want it). But does build an "eassynth" one that depends on libpulse-simple, so please take care of this dependency as well. The goal of this movement is that any user installing VMPK or drusmtick-vpiano should be able to get sound at once, without needing to download soundfonts, or configuring anything. Only installing and instantly enjoying.

Regards,
Pedro

@magnetophon
Copy link
Member Author

@pedrolcl
Thanks for the reply!

For completeness sake, this is the expression I'm currently testing:

{ stdenv, fetchurl, cmake, pkgconfig
, qt5, libjack2, libpthreadstubs, drumstick, libXdmcp
, docbook_xsl
}:

let
  version = "0.7.0";
in stdenv.mkDerivation rec {
  name = "vmpk-${version}";

  meta = with stdenv.lib; {
    description = "Virtual MIDI Piano Keyboard";
    homepage    = "http://vmpk.sourceforge.net/";
    license     = licenses.gpl3Plus;
    platforms   = platforms.linux;
  };

  src = fetchurl {
    url = "mirror://sourceforge/vmpk/${version}/${name}.tar.bz2";
    sha256 = "1sk78f32myzyxjfzp0kn15n7j7ihww3dix4akq2k6fcqzw9911l7";
  };

  nativeBuildInputs = [ cmake pkgconfig ];

  buildInputs = [ qt5.qtbase qt5.qtsvg qt5.qttools qt5.qtx11extras libjack2 libpthreadstubs drumstick libXdmcp docbook_xsl ];
}

It crashes at startup, after flashing a window.

@pedrolcl
Copy link

pedrolcl commented Apr 9, 2018

libjack2 has nothing to do with vmpk or drumstick.

libpulse-simple (PulseAudio) is needed instead.

@magnetophon
Copy link
Member Author

@pedrolcl Thanks for the info.
Here's the updated expression:

{ stdenv, fetchurl, cmake, pkgconfig
, qt5, libpthreadstubs, drumstick, libXdmcp
, docbook_xsl, libpulseaudio
}:

let
  version = "0.7.0";
in stdenv.mkDerivation rec {
  name = "vmpk-${version}";

  meta = with stdenv.lib; {
    description = "Virtual MIDI Piano Keyboard";
    homepage    = "http://vmpk.sourceforge.net/";
    license     = licenses.gpl3Plus;
    platforms   = platforms.linux;
  };

  src = fetchurl {
    url = "mirror://sourceforge/vmpk/${version}/${name}.tar.bz2";
    sha256 = "1sk78f32myzyxjfzp0kn15n7j7ihww3dix4akq2k6fcqzw9911l7";
  };

  nativeBuildInputs = [ cmake pkgconfig ];

  buildInputs = [ qt5.qtbase qt5.qtsvg qt5.qttools qt5.qtx11extras libpulseaudio libpthreadstubs drumstick libXdmcp docbook_xsl ];
}

Same result though.

@magnetophon
Copy link
Member Author

I'm a newbie when it comes to gdb, so this is all copypasta.
I have an alias like so:

bt: aliased to echo 0 | gdb -batch-silent -ex "run" -ex "set logging overwrite on" -ex "set logging file gdb.bt" -ex "set logging on" -ex "set pagination off" -ex "handle SIG33 pass nostop noprint" -ex "echo backtrace:\n" -ex "backtrace full" -ex "echo \n\nregisters:\n" -ex "info registers" -ex "echo \n\ncurrent instructions:\n" -ex "x/16i \$pc" -ex "echo \n\nthreads backtrace:\n" -ex "thread apply all backtrace" -ex "set logging off" -ex "quit" --args

When I run bt vmpk, I get:

backtrace:
No stack.


registers:
The program has no registers now.


current instructions:
No registers.


threads backtrace:

What's the next step?

@pedrolcl
Copy link

That is not unexpected. It means that there was no crash at all. The program simply ended quickly and unceremoniously. You could only see a splash window very briefly. That happens when vmpk could not find any drumstick plugin. To confirm this theory, please run vmpk again from a bash prompt, and then test the value of "$?":

$ vmpk
...
$ echo $?
1

The exit code 1 means that it was not possible to load an output plugin for drumstick-rt. The success exit code is 0 as usual. You may say that in case of errors, there should be an error message as well. Yes, you are right. Patches are welcome!

Well, here is a workaround already mentioned in another message. First, please locate where the drumstick plugins are in your system:

$ find / -name libdrumstick-rt-*.so
/usr/plugins/drumstick/libdrumstick-rt-oss-in.so
/usr/plugins/drumstick/libdrumstick-rt-net-in.so
/usr/plugins/drumstick/libdrumstick-rt-eassynth.so
/usr/plugins/drumstick/libdrumstick-rt-alsa-in.so
/usr/plugins/drumstick/libdrumstick-rt-net-out.so
/usr/plugins/drumstick/libdrumstick-rt-alsa-out.so
/usr/plugins/drumstick/libdrumstick-rt-oss-out.so

Now define an environment variable pointing to the plugins directory:
$ export DRUMSTICKRT=/usr/plugins/drumstick

And run vmpk again. If you succeeded, then please tell the drumstick package maintainer that it needs to be fixed. Or maybe nixos is incompatible with it.

Regards,
Pedro

@magnetophon
Copy link
Member Author

magnetophon commented Apr 10, 2018

@pedrolcl Thanks for your help!

echo $? after vmpk gives 1

This is the dir I found:

ls /nix/store/azm32682hbwk717y35b64sf6gbnxh8c3-drumstick-1.1.1/lib/drumstick
libdrumstick-rt-alsa-in.so  libdrumstick-rt-alsa-out.so  libdrumstick-rt-net-in.so  libdrumstick-rt-net-out.so  libdrumstick-rt-oss-in.so  libdrumstick-rt-oss-out.so

When I do

export DRUMSTICKRT=/nix/store/azm32682hbwk717y35b64sf6gbnxh8c3-drumstick-1.1.1/lib/drumstick

and run vmpk, it still reacts the same.

@pedrolcl
Copy link

There is no "libdrumstick-rt-eassynth.so" plugin there. And this is exactly the initial output plugin that vmpk instantiates by default. It is not build because the drumstick package is broken, very broken. It was not build probably because libpulse-simple (PulseAudio) was not found at build time of drumstick.
Until somebody fixes the drumstick package, I suggest you to wait.

@magnetophon
Copy link
Member Author

magnetophon commented Apr 11, 2018

I rebuilt drumstick with libpulseaudio, exported DRUMSTICKRT, and ran vmpk.
I got:

Failed to create PulseAudio connection
Assertion 'p' failed at pulse/simple.c:273, function pa_simple_write(). Aborting.
[2]    8378 abort      vmpk

So I enabled pulseaudio, and now vmpk works.

As I'm sure you know, many people into linux-audio avoid PA like the plague.
Would it be possible to use vmpk without having PA running?

I also noted that jack is no longer supported. That makes vmpk less useful to me.
Any chance of getting it back?

@magnetophon
Copy link
Member Author

Just a heads up: I have the latest vmpk working, but only when pulseaudio is enabled.
For my needs, I'd prefer to keep using the version that is currently in nixpkgs, as it doesn't require PA.

@pedrolcl There is no way to run the latest vmpk without PA, is there?

@pedrolcl
Copy link

If you need an explanation, just read it here.

@magnetophon
Copy link
Member Author

@pedrolcl Thanks.

@magnetophon magnetophon deleted the vmpk branch June 6, 2020 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants