Cannot launch a 2nd GUI using the same engine

Help
2011-12-13
2013-05-23
  • Hi,

    I'm trying to use two different Bristol patches with Rosegarden ; one track uses the MIDI channel 1, the other uses MIDI channel 2. If I recall correctly, in order to do this, you have to run startBristol twice, the second time using the -engine option. Bit when I'm using it, Bristol gives me some error messages and quits :

    $ startBristol -engine
    jackstats found -rate 48000 -count 1024
    Copyright (c) by Nick Copeland <nickycopeland@hotmail.com> 1996,2011
    This program comes with ABSOLUTELY NO WARRANTY; for details type `<Ctrl> w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `<Ctrl> g' for details of GPL terms.
    starting logging thread [@1323815601.908559]
    Dec 13 23:33:22 brighton [0.100046] starting console logging [@1323815601.908559]
    Dec 13 23:33:22 brighton [0.100160] emulation defaults:
    Dec 13 23:33:22 brighton [0.100169]     -voices  32
    Dec 13 23:33:22 brighton [0.100176]     -detune  0
    Dec 13 23:33:22 brighton [0.100183]     -gain    2
    Dec 13 23:33:22 brighton [0.100190]     -pwd     2
    Dec 13 23:33:22 brighton [0.100197]     -glide   5
    Dec 13 23:33:22 brighton [0.100204]     -curve   175
    Dec 13 23:33:22 brighton [0.100210] brighton version 0.60.9
    Dec 13 23:33:23 brighton [1.100234]   brighton
    Dec 13 23:33:23 brighton [1.100275]     -engine
    Dec 13 23:33:23 brighton [1.100279]     -port 37763
    Dec 13 23:33:23 brighton [1.100391] starting event management thread
    Dec 13 23:33:23 brighton [1.101131] connected to :0.0
    Dec 13 23:33:23 brighton [1.101174] brighton 0x6bf260 765 400
    Dec 13 23:33:23 brighton [1.101179] display is 1280 by 1024 pixels (0, 0)
    Dec 13 23:33:23 brighton [1.101371] Window is w 1280, h 1024, d 24, 0 0 0
    Dec 13 23:33:23 brighton [1.101971] Using DirectColor display
    Dec 13 23:33:23 brighton [1.111157] Initialise the hammondB3 link to bristol: 0x11b5d20
    Dec 13 23:33:23 brighton [1.111216] bristolMidiOpen(localhost, 4023)
    Dec 13 23:33:23 brighton [1.111225] hostname is localhost, bristol
    Dec 13 23:33:23 brighton [1.111434] TCP port: 37763
    Dec 13 23:33:23 brighton [1.111522] connect failed on 37763: Connection refused
    Dec 13 23:33:23 brighton [1.111540] connfailed
    Dec 13 23:33:23 brighton [1.111554] opening link to engine: 37763
    Dec 13 23:33:23 brighton [1.111565] bristolMidiOpen(localhost, 4023)
    Dec 13 23:33:23 brighton [1.111577] hostname is localhost, bristol
    Dec 13 23:33:23 brighton [1.111604] TCP port: 37763
    Dec 13 23:33:23 brighton [1.111624] connect failed on 37763: Connection refused
    Dec 13 23:33:23 brighton [1.111636] connfailed
    Dec 13 23:33:23 brighton [1.111656] unacknowledged request on -4
    

    Am I doing something wrong ? I managed to achieve this in the past but I can't remember exactly how.

     
  • Nick Copeland
    Nick Copeland
    2011-12-14

    There was a big change that went into the 0.60 stream which is the probable cause. Prior to this change the engine, which is actually an internet server, would always listen on the same TCP port, 5128, and when connections came in it would negotiate the synth type, etc.

    This was cumbersome since the port may be in use by other ephemeral services and if you restart quickly then it may be in TIMEWAIT, both of which cause the engine to either delay or at least wait for the socket to be freed up again.

    The new code will take an arbitrary TCP port and find a free one from that arbitrary number, then this port number is given to the engine as a server and the GUI as a client. In the above example you can see the following message:

    Dec 13 23:33:23 brighton  -port 37763

    This means I have randomly found 37763 to be available, unfortunately this guarantees that the existing engine will be listening on a different port. The following should work:

    startBristol -jack -mini -port 5128
    startBristol -engine -b3 -port 5128

    Here you are directing the app to take a fixed port and use the same port for both requests.

    I acknowledge that having the system default to a method that makes multitimbral break rather that one that works is kind of strange but this method can be made to work the same was as previously when you specify the port, the issues of using a fixed port are awkward and as far I a know, very few people have really played about with the multitimbral mode of operation.

    Two notes:
    1. There were concerns about bristol opening up TCP ports, you can use UNIX domain sockets by using "-host unix:"
    2. I might consider a way to find out the correct dynamic port if you specify -engine without a -port option.

    Option 2 is quite a bit of work to do correctly. Not impossible, but perhaps rather a lot of work for something that is corrected with a suitable set of startup options.
    Hope that fixes it all up.

    Kind regards, nick