compiling serialosc source code

  • As far as I can tell, the serialosc installation (for Windows, at any rate) does not enable the adc/tilt inputs.

    This has been covered in the following threads:
    http://post.monome.org/comments.php?DiscussionID=13229
    http://post.monome.org/comments.php?DiscussionID=14598&page=1#Comment_176721

    From which it seems that the source code on github has been updated to provide this functionality.

    Due to a mashed up ankle I've had time to make a sustained attempt to compile the source code, but it's not working.

    Here's some of the technical detail:
    *****
    First tried 'make' in top level directory and got the message that I needed to ./configure.
    Some research later indicated that I needed to use MinGW (which I now realise is referred to by jiparis on this thread)
    http://post.monome.org/comments.php?DiscussionID=13229

    So I installed MinGW (as noted, I already had MSYS from previous work) and have it's colourful CLI, which appears to be unix-like.

    ./configure now goes quite a lot of the way. It identifies windows, and finds its gcc version, but dies when checking for libdns_sd - I googled around for this and it exists in an rpm package, and I looked at rpm2cpio to extract the requisite bits, but ran out of road at that point.

    I've tried 'make' in the source directory, but it falls over when it can't find monome.h and serialosc.h - they're not in the download from github, are they in some other library?

    So, it's encouraging that jiparis could compile it, but it's not obvious how.

    Should I be compiling to an exe?

    I'd appreciate some guidance on this.

  • i and a few other contributors (greetz: artfwo, ioflow) are working to make the build process less shitty, but the work we're doing isn't quite ready yet.

    here's what you'll need to do. i may be forgetting some steps; the build system is especially janky on windows (this is what we're working to fix).

    this:

    > $

    is your command line. don't type the leading $.

    1) download, compile, and install libmonome.

    i recommend that you install everything into your mingw/msys home directory. it will make copying files to the final serialosc directory simpler.

    get libmonome from git, http://github.com/monome/libmonome

    run

    > $ ./configure --prefix=~ --disable-osc

    don't worry about the "disable osc" part. it's unrelated to serialosc at this stage, and compiling the OSC client code will open up a whole other mess of dependencies.

    > $ make
    > $ make install

    if "make" fails, post the error message here and sit tight before going further.

    will write up the stuff for compiling serialosc after this post. it's a bit of a mess because of the dependencies.

  • Many thanks for picking this up.
    1 Compiled libmonome:
    --prefix=~ returned an error for no directory called ~ so I did it again with just disable-osc - seemed to ./configure Anyway, I see it gives us monome.h - hurrah!

    Below is output for make and make install. Is that OK?

    ***CLI***
    CB@CB-DESKTOP /c/mingw/libmonome
    $ make
    CC examples/test.o
    cc1.exe: warnings being treated as errors
    test.c: In function 'chill':
    test.c:45: error: implicit declaration of function 'nanosleep'
    make[1]: *** [test.o] Error 1
    make: *** [all] Error 2

    CB@CB-DESKTOP /c/mingw/libmonome
    $ make install
    INSTALL /usr/local/include/monome.h
    INSTALL src/proto/protocol_mext.dll -> /usr/local/lib/monome/protocol_mext.dll

    INSTALL src/proto/protocol_series.dll -> /usr/local/lib/monome/protocol_series
    .dll
    INSTALL src/proto/protocol_40h.dll -> /usr/local/lib/monome/protocol_40h.dll
    INSTALL src/libmonome.dll -> /usr/local/lib/libmonome.dll
    INSTALL src/monomeserial -> /usr/local/bin/monomeserial
    install: cannot stat `monomeserial': No such file or directory
    make[1]: *** [install] Error 1
    make: *** [install] Error 2

    CB@CB-DESKTOP /c/mingw/libmonome
    $
    *********

    2 Bonjour:
    In your email, you mentioned that dns_sd.dll comes from the Bonjour installation. Maybe it's changed: the files I have are
    dns_sd.jar (which Winzip recognises as an archive, but no dns_sd.dll inside though)
    mdnsNSP.dll (if this is the one we want, then I'm not sure how to make the configure process pick it up

    3 Compiling serialosc
    What I tried: changed line 537 in the configure script to put an underscore in before sd - this moved things on a bit:
    ***CLI***
    configuring serialosc 1.0:
    checking platform: windows
    checking for gcc: gcc 4.4.3

    ./configure: line 602: conf_dnssd: command not found
    checking for liblo: no liblo :(
    *********
    So I replaced all occurrences of dnssd with dns_sd, but back to the no mdns messsage. Dead end.
    Tried just substituting lines 537 & 602 "no mdns". Dead end.

    Downloaded liblo, which configured, made and made install fine. Or so it seemed.

    I tried to attach a screen shot of my directory structure but the site's not having it. Generally for downloads, I've extracted sources in just below the root, and Bonjour installed per defaults. Then I've copied them in as subdirectories to MinGW, where I'm happy to mess around with them.

  • an afterthought. "install" lib monome. Did make install create an exe which will install libmonome on the system?

  • another afterthought. dns_sd.jar is filled with xxx.class files, which is Java?

    there's a DNSSD.class amongst them

  • just to be clear here's what I get with the original version of configure

    ***CLI***
    CB@CB-DESKTOP /c/mingw/monome2
    $ ./configure

    configuring serialosc 1.0:
    checking platform: windows
    checking for gcc: gcc 4.4.3

    checking for libdns_sd: no mdns

    CB@CB-DESKTOP /c/mingw/monome2
    $ make
    Makefile:3: config.mk: No such file or directory

    _
    | |__ ___ _ _
    | _ \ / _ \ | | | you need to run
    | | | | __/ |_| | ./configure first!
    |_| |_|\___|\__, |
    |___/

    make: *** [config.mk] Error 1

    CB@CB-DESKTOP /c/mingw/monome2
    $
    *********
    I called the serialosc directory monome2 btw

  • @chrisbob12
    What I did was install serialosc from the official windows binary.
    When the tilt patch for 40h was merged into github, I tried to compile libmonome in mingw, configured without liblo, but failed in the "examples" target. Far enough to get a new version of protocol_40h.dll (even a new libmonome.dll), which was what I was looking for. Then I just replaced the old one and everything worked correctly.

    I hope this helps.

  • @jiparis
    Many thanks for the suggestions! I shall give it a try, although it will take me a few days, as I have other things to attend to at the moment.

  • @jiparis (& @visinin too)
    I've had a go at this, and tested things out.
    I'm using a test partition which does not have max.
    Bonjour is installed, per the download default settings, and a copy of the Bonjour directory has been put under the mingw directory.
    Serialosc is installed via the 'official' installation package per the download defaults.
    Serialosc copied from github to a directory under mingw.
    Libmonome downloaded from github to a directory under mingw.

    I did this:
    $ ./configure --disable-osc
    in the libmonome directory, and it didn't throw up any red stuff, though did grumble about some bits
    $ make
    again, didn't throw up red stuff, but did grumble a bit

    I found a sub-directory 'src' with new a new libmonome.dll which is 117Kb to the original installation's 73Kb, and below that in sub-directory 'proto' three new dlls including protocol_40h.dll

    Copied these. Switched to partition with Max, current monome installations and all things musical. Replaced old dlls with new ones. Rebooted.
    Monome still works (hurrah) but no evidence of adc activity.

    Tried two monome test patches:
    The cute new test app which does arc and everything. Buttons fine, but enable tilt makes no difference (I have nothing connected to the adcs at the moment, so not sure what I should expect - presumably the little circle in the xy panel should jitter around a bit)
    The clunky old monome test from monomebase 4.5 with explicit sliders attached to the adc outputs. Again, buttons work fine, but no jitter on the sliders from adc noise, which I used to get on the monomeserial installation, although I had to enable adcs.

    Should I be enabling the adcs somewhere?
    I'm confused as to which is the github package which I should be compiling to get the adcs working in my 40h: should it be serialosc or libmonome?

  • Yes, you have to enable ADCs. The new test app should work fine if you had an accelerometer connected. The only thing you have to consider is the little annoying behaviour that i mention on http://post.monome.org/comments.php?DiscussionID=13229#Item_10
    It seems that when you enable tilt (sensor 0), only ADC0 is enabled on the 40h, and that's only ONE axis. So if you want two axes you will have to enable ADC1 elsewhere.
    I made a small test with my java serialosc client (https://github.com/jiparis/monome-serialosc-client) and after enabling ADC1, both axes worked.
    I think the file 40h.c needs to be patched, because in the 40h one sensor is one ADC, however on newer versions one sensor has up to 3 axis (message /tilt n x y z from serialosc)

  • Something like this, in 40h.c:


    static int proto_40h_tilt_enable(monome_t *monome, uint_t sensor) {
    /* ADC n */
    uint8_t buf[2] = {PROTO_40h_ADC_ENABLE, (sensor

  • @jiparis

    Thank you!

    I've pasted your 'something like this' over what looks like the earlier lines in 40h.c and recompiled - a new version of protocol_40h.dll was created. I pasted this over the previous one in the serialosc installation in Program Files.

    I'm still not seeing any evidence of ADC activity. On the plus side, the buttons all still work :)
    *****
    I've stared at the code above a bit and compared with what I had before:
    I note you have an extra line in each of the two {chunks} starting buf[1]
    I note you've added /*comments*/

    I think you're adding in the 'missing' ADC in each pair with the ADC n+1 lines.
    *****
    Back to the installation and hardware.
    Using the cute new test app: I go to the tilt tab and click the enable tilt button - this should send the appropriate messages to do any enabling of tilt/adc
    Fundamental assumption: I assume that enabling tilt is the same as enabling ADCs: the tilt sensors, when fitted, are wired into the four ADC inputs, right?
    *****
    Question: my C programming skills are vanishingly small, though I do have some programming under my belt. Do you have any idea why the above approach was taken with the ADCs? In my state of ignorance, I would have gone for a for-next type loop to switch them in and out.

  • @jiparis

    "The only thing you have to consider is the little annoying behaviour that i mention on http://post.monome.org/comments.php?DiscussionID=13229#Item_10"

    I checked that, but am still not clear on whether I should be sending some sort of enabling message from e.g. a Max patch - couldn't find any messages in the test app.

  • Hey chrisbob,
    did you ever get all 4 40h ADC ports working with serialosc?
    My 40h is working well with seriosc 1.2a and Raja's test patch receives the tilt changes on ADC1, but ADC2,3 and 4 have no impact. All 4 are working on MonomeSerial (v018c from memory).

  • Hi @kelvin
    Regrettably not. I've parked that for a bit, as I don't know an awful lot about working in C, although I'm slowly getting off the starting block. I may pick it up again this year, as I've been banging my head against MS VisualC++ and find it easier to organise than command line solutions. @Visinin was very supportive about taking it forward, but I suspect it's a minority interest. I'm certainly still interested in bringing the ADCs back into the fold, because I built a socketed connection to them in my 40h case. Thing is, it takes me at least a day to get back up to speed with C, another day of head-banging and then another day to figure out all the bits I missed the previous day. And then my holiday's over.
    My track record:
    attempted compilations and minor tweaks to C projects: 3
    C projects successfully tweaked and compiled: 1 (AudioCommander's KII)
    C projects still unresolved: 2 (ADCs for 40h and Madrona Labs max patches for the DIY prototype)

    Currently praying for a fix for Max 6 to keep file associations and icons in my multi-boot XP system.