Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Jack support on Ubuntu 64 bit

I have Jack running on Ubuntu 64 bit, but, EnergyXT2.5.4 does't recognizes Jackd (on File > Setup > Audio > Device)
2 people have
this problem
+1
Reply
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • I have Jack running. I tested it with audacity. I tried to recompile libaam.so with the same result, compared with the one that come together with enegyxt package.
    The point is: I wnat to confirm if it works with Ubuntu 64 bit.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • why do i have to compile something?
    i am an ubuntu enduser and want to use the software.
    and my system runs under jack, because i use ardour.
    i have a bought license and don't wanna hassle around with compiling.
    Please integrate Jack Support for 64bit, 32bit Linux in EnergyXT!
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • I’m not amused
    Same here. EnergyXT really is a fine piece of software, but very unstable when running under 64bit Linux. It crashes with segfaults rather frequently and compiling jack support does not work.
    Please make it 64bit!

    A paying customer.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • Hello,

    I tried to compile the Jack client code (jack.cpp) on Ubuntu 12.04 64-bit, but it breaks with the following warnings:

    # g++ -shared -lasound -ljack jack.cpp -o libaam.so
    jack.cpp: In function ‘int libaam(int, int, int)’:
    jack.cpp:427:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp:443:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp:471:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp:496:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp:519:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp:530:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp: In member function ‘void CMIDIDev::enable(int)’:
    jack.cpp:578:42: error: cast from ‘snd_rawmidi_t* {aka _snd_rawmidi*}’ to ‘int’ loses precision [-fpermissive]
    jack.cpp: In constructor ‘CMIDIThread::CMIDIThread(int, int)’:
    jack.cpp:608:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

    Maybe time to revisit the code? If you need people to test code, I would like to help out.

    Regards,
    Jan Henkins
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • Hi Jan,
    Add -fpermissive to the compiler command, meaning:
    g++ -shared -lasound -fpermissive -ljack jack.cpp -o /_path_to_energyXT2_/libaam.so

    All your compiler messages are because of casts from pointer to int or reverse.
    Normally the size of a pointer is equal to the size of a int, so a cast shoudn't be a problem, no precision should be lost like it's written in the error log.
    However I don't guarantee it's like this, perhaps something is different when compiling in a 64-bit environment a library for a 32-bit application, so you can compile and run this short program to check this; in ubuntu lucid 32-bit the sizes of int and pointers are 4 as expected.
    So put the content below in a testSize.cpp :

    // compile: g++ -lasound -ljack testSize.cpp -o testSize
    // execute: ./testSize
    #include
    #include
    #include
    typedef int (CProcess) (float** inputs, float** outputs, int numIns, int numOuts,
    int frames, void* midiData, int midiDataCount);
    CProcess *pcp;
    char *pc;
    float *pf;
    snd_rawmidi_t *ps;
    int main(void)
    {
    printf("size of int is %d and it should be equal with the pointer size of:\n", sizeof(int));
    printf("- CProcess\t= %d\n", sizeof(pcp));
    printf("- char\t= %d\n", sizeof(pc));
    printf("- float\t= %d\n", sizeof(pf));
    printf("- snd_rawmidi_t\t= %d\n", sizeof(ps));
    exit(0);
    }
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • Sorry, I forgot about the HTML encoding, try this:

    // compile: g++ -lasound -ljack testSize.cpp -o testSize
    // execute: ./testSize
    #include <alsa/asoundlib.h>
    #include <jack/jack.h>
    #include <stdio.h>
    typedef int (CProcess) (float** inputs, float** outputs, int numIns, int numOuts,
    int frames, void* midiData, int midiDataCount);
    CProcess *pcp;
    char *pc;
    float *pf;
    snd_rawmidi_t *ps;
    int main(void)
    {
    printf("size of int is %d and it should be equal with the pointer size of:\n", sizeof(int));
    printf("- CProcess\t= %d\n", sizeof(pcp));
    printf("- char\t= %d\n", sizeof(pc));
    printf("- float\t= %d\n", sizeof(pf));
    printf("- snd_rawmidi_t\t= %d\n", sizeof(ps));
    exit(0);
    }
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • I’m excited
    Hello Lucian,

    Thanks for the information, it gives me hope! :-)

    Firstly, let me apologise with the sheer size of this posting, but since it's largely on-topic and interesting (in a vague geekish type of way), I'll persist! :-) Secondly, I also apologise for not knowing how to do the nice code-blocks like yours, but since this is plain-text output, it should be OK.

    Let me get cracking with the test code above.

    Compile:

    $ g++ -lasound -ljack testSize.cpp -o testSize
    testSize.cpp: In function ‘int main()’:
    testSize.cpp:14:91: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat]
    testSize.cpp:15:41: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat]
    testSize.cpp:16:37: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat]
    testSize.cpp:17:38: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat]
    testSize.cpp:18:46: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat]

    OK, I'm happy with that. Output of the resultant binary:

    $ ./testSize
    size of int is 4 and it should be equal with the pointer size of:
    - CProcess = 8
    - char = 8
    - float = 8
    - snd_rawmidi_t = 8

    Now, taking in consideration your comment regarding the "-fpermissive" flag, I tried compiling the jack.cpp code again with the following output:

    $ g++ -shared -lasound -fpermissive -ljack jack.cpp -o libaam.so
    jack.cpp: In function ‘int libaam(int, int, int)’:
    jack.cpp:427:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp:443:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp:471:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp:496:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp:519:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp:530:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp: In member function ‘void CMIDIDev::enable(int)’:
    jack.cpp:578:42: warning: cast from ‘snd_rawmidi_t* {aka _snd_rawmidi*}’ to ‘int’ loses precision [-fpermissive]
    jack.cpp: In constructor ‘CMIDIThread::CMIDIThread(int, int)’:
    jack.cpp:608:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    /usr/bin/ld: /tmp/cczGRtG0.o: relocation R_X86_64_32S against `vtable for CThread' can not be used when making a shared object; recompile with -fPIC
    /tmp/cczGRtG0.o: could not read symbols: Bad value
    collect2: ld returned 1 exit status

    OK, not successful. However, I noticed that "ld" left me a nice message in the second last line, telling me to use the "fPIC" flag. Let's do that:

    $ g++ -shared -lasound -fpermissive -fPIC -ljack jack.cpp -o libaam.so
    jack.cpp: In function ‘int libaam(int, int, int)’:
    jack.cpp:427:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp:443:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp:471:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp:496:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp:519:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp:530:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    jack.cpp: In member function ‘void CMIDIDev::enable(int)’:
    jack.cpp:578:42: warning: cast from ‘snd_rawmidi_t* {aka _snd_rawmidi*}’ to ‘int’ loses precision [-fpermissive]
    jack.cpp: In constructor ‘CMIDIThread::CMIDIThread(int, int)’:
    jack.cpp:608:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

    BOOM! Let's see if we have a file:

    $ ls -al
    total 56
    drwxrwxr-x 2 jan jan 4096 Jul 9 11:51 .
    drwxrwxr-x 3 jan jan 4096 Jul 9 11:48 ..
    -rw-rw-r-- 1 jan jan 13064 Jul 9 11:48 jack.cpp
    -rwxrwxr-x 1 jan jan 29870 Jul 9 11:51 libaam.so

    This looks hopeful! :-) I will do this at home on my music recording box, and report the outcome of my testing.

    Thanks again for the tips, Lucian!
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated

  • Fast response Jan, I'll try to be as fast as possible. :)

    I found instructions about putting code by clicking on the link (some HTML allowed) on this page, net to "Reply" field, there are described the keywords <pre> <code>> and </code> </pre> .

    I don't think these are good news, size of int is 4 (8bits*4 = 32 bits) and pointer size is 8 (64 bits).
    So precision could be really lost, it might not work at all, or it will be unstable.

    I see 2 ways to fix this:
    - replace these

    int libaam (int index, int value1, int value2)
    else thread = new CMIDIThread((int)handle, index);
    CMIDIThread :: CMIDIThread(int f, int dev)

    with these

    int libaam (int index, long int value1, long int value2)
    else thread = new CMIDIThread((long int)handle, index);
    CMIDIThread :: CMIDIThread(long int f, int dev)


    but I'm pretty sure it won't work because energyxt binary is looking for functions with the same parameter types (same function prototype), meaning with int and not long int as I changed.

    - perhaps jack.cpp must be in other way compiled, some details are described here:
    http://www.timelordz.com/blog/2011/01...

    If you get any result, please share libaam.so to use it on my side too.

    Also you can try with other versions of jack.cpp files from others:
    http://energyxt2.wikidot.com/jack-cpp
    http://sourceforge.net/projects/libaa...

    Regards,
    Lucian
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • Hello Lucian,

    Thanks again for the information. Seems that I have hit a snag - I can get "g++ -m32" to work on Ubuntu 12.04, but I cannot get it to work with the Jack development files (there seems to be 32-bit asound headers, which is great).

    I'll battle further tonight.

    Regards,
    Jan Henkins
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • Hi Jan,
    Here you have libaam-jack-32bit_ubuntu_lucid.zip
    https://docs.google.com/open?id=0B7_-...
    already built for ubuntu lucid 32 bit, for jack (not jack2), together with xt2-config and xt2-trans2midi.
    The sources are from libaam-jack sourceforge project.

    You might need not only ia32-libs, but also ia32-libs-gtk .

    My idea is that you don't need necessarily to build in a 64-bit environment a 32-bit application, you can have the correspondent 32-bit environment (as a virtual machine for e.g.) and do the build there.

    Please try it in you environment and tell me if it works.
    If yes, I'll try further tests.

    If you get this error when running energyxt or xt2-trans2midi in command line, I suppose the reason is that it was compiled for jack, but the environment has jack2 installed:

    unknown option character l
    jackdmp 1.9.6
    Copyright 2001-2005 Paul Davis and others.
    Copyright 2004-2010 Grame.
    jackdmp comes with ABSOLUTELY NO WARRANTY
    This is free software, and you are welcome to redistribute it
    under certain conditions; see the file COPYING for details
    `default' server already active
    Failed to start server


    So HAVE_JACK2 must be change from false to true in libaam.cpp , and recompiled.

    Btw, libaam-jack has these features:
    - midi outputs are working fine
    - number of audio/midi inputs/outputs is configurable
    - energyxt can receive PLAY, STOP, REWIND events from jack transport control (qjackctl, or maybe other jack application like Hydrogen, Ardour)

    Regards,
    Lucian
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited