Friday, 2014-01-31

ghaydnthis is it: http://pastebin.com/AqUDGpJN00:05
*** ghaydn has quit IRC01:01
*** ghaydn has joined #ingen01:31
*** ghaydn has quit IRC01:46
*** Anchakor_ has quit IRC02:29
*** edogawa has joined #ingen08:07
*** thorwil has joined #ingen08:09
*** Anchakor_ has joined #ingen08:35
*** Anchakor_ has quit IRC09:48
*** Anchakor_ has joined #ingen09:50
*** thorwil has quit IRC14:05
*** dongle is now known as dongl14:23
*** edogawa has quit IRC15:31
*** edogawa has joined #ingen15:31
*** Anchakor_ has quit IRC16:57
*** Anchakor_ has joined #ingen16:57
rgareusdrobilla: can ingen be easily changed to take the same approach to ringbuffering Atom communication in the same way as jalv (and ardour3) does?19:12
drobillargareus: Explain?  That's how the whole thing does work.19:12
rgareusdrobilla: ie not use sigc direct delivery -  see http://dev.drobilla.net/ticket/954#comment:319:12
LAbotTitle: #954 (issues with LV2 Atom Transfer from/to GUI) – drobillad (at dev.drobilla.net)19:12
drobillargareus: Not really.19:13
drobillargareus: Why?  I highly doubt that has anything to do with your problem19:13
rgareusdrobilla: could there be  'ui active' flag. that prevents the backend from reading (and responding) to messages from the UI until the UI is completely initialized?19:15
rgareusdrobilla: UI writes to ringbuffer, but the backend won't read from that ringbuffer until all the signals are connected.19:16
rgareusdrobilla: does that make sense? or do you think that's just a bad workaround?19:16
drobillargareus: Mmmmmmmm, well, sort of, but that screams deadlock to me19:16
drobillaUI does something weird and the whole thing seizes up19:16
drobillargareus: What does "completely initialized" even mean?19:17
drobillaThe question is, if the instance init is sending them, why is it not then ready to receive stuff right away?19:17
rgareusdrobilla: the instance is ready to receive.  ingen is not19:19
drobillargareus: what part of ingen?19:20
rgareusdrobilla: ingen only hooks up signals later.  Also while it's creating the instance _plugin_ui is unset,19:20
drobillaIf it's not clear, I don't actually know what the problem is here yet.19:21
rgareusdrobilla: NodeModule::port_activity()  {  if (!_plugin_ui) { return;} ...19:21
drobillargareus: but the GUI/main thread is what must call emit_signals19:21
rgareusdrobilla: the UI sends a message while ingen is at    _plugin_ui = plugin->ui(app().world(), _block);19:22
drobillargareus: as long as everything is set up before it all returns back down to main, that should not be possible19:22
rgareusdrobilla: at this point _plugin_ui is just about to be asigned.19:22
drobillaThe ingen GUI is not multi-threaded19:22
rgareusdrobilla: so?19:23
drobillargareus: So there can't be a race like that19:23
rgareusdrobilla:  message is created in gui-thread. delieved to audio-thread while the GUI is still initializing...19:23
rgareusdrobilla: audio-thread processes the event, generated a reply..19:23
drobillargareus: sure, and it will go throguh the engine and generate a reply, which will get sent back to the UI19:23
rgareusdrobilla: gui-thread continues.. but the reply is lost. (bceause the GUI was not fully initialized019:24
drobillargareus: and get queued for handling *in the same thread the UI is being instantiated in* later.19:24
rgareusdrobilla: it does not get queued.19:24
drobillargareus: Literally everything gets queued, that's what ThreadedSigClientInterface does.19:25
rgareusdrobilla: it should be queued.19:25
rgareusdrobilla: are you using sigc::signal()?19:26
* rgareus reads ingen/client/ThreadedSigClientInterface.hpp19:26
rgareusdrobilla: if it should be queued and only executed later. there's a bug in there.19:27
drobillargareus: The point is that 100% of any and all communication to or from the UI is one big queue19:27
rgareusdrobilla: because I clearly see that's delivered directly.19:28
drobillaThere is no connections and signals everywhere and pointers deep into the engine business like Ardour19:28
drobillargareus: Explain.19:28
drobillayou clearly see that it's delivered directly how?  "directly" meaning what?19:28
rgareusdrobilla: just start it up like blablack did, and notice that the event does never arrive in the GUI.19:29
rgareusdrobilla: 'directly' -> use gdb and follow the execution graph.19:30
drobillaBut that reply originates from the next element in the queue19:31
rgareusdrobilla: I don't even see a call to `NodeModule::port_value_changed` or `NodeModule::port_activity` for the response.19:32
rgareus.. in the GUI thread19:32
rgareusdrobilla: how does jalv handle this? because it works in jalv.  is this apples vs. oranges? or is there a similarity?19:33
drobillargareus: apples vs spaceships19:33
drobillabut the use of 'setting the value' for this is wrong anyway19:34
drobillaI was planning on doing it later today anyway.  The feedback thing might need some non-trivial work  in the engine19:34
rgareusdrobilla: I was wondering a while ago if it's valid for a GUI to send a message during initialization19:35
drobillaI don't see how it could be a race, though.19:35
drobillargareus: Well, kinda has to be, since we have no activate()-like-thing, so let's just go with yes19:35
rgareusdrobilla: it's not a race per se. I can reproduce 100%.19:36
drobillaWell, it's not stuff happening in the GUI thread while the GUI thread is making the UI, anyway19:36
rgareusdrobilla: the initialization thread always breaks  in Ingen::Client::lv2_ui_write19:36
drobillaUnless something really hyper severely weird and wrong is going on19:36
*** thorwil has joined #ingen19:36
rgareusdrobilla: which probably triggers a context-switch for some reason.19:37
rgareusdrobilla: in line 8419:37
rgareusdrobilla: ui->world()->interface()->set_property(port->uri(),....)19:38
rgareusdrobilla: mmh it calls EMIT  which goes back to sigc, which is not thread-safe19:39
drobillargareus: wrong directly19:42
drobillargareus: er, wrong direction19:42
rgareus?19:42
drobillaI forget what class that would be in this case.  If you're in gdb, step and tell me19:43
drobillargareus: the emit stuff is engine=>GUI19:43
rgareusdrobilla: I can get back into gdb19:43
drobillaoh, right, EventWriter19:44
drobillargareus: It's a queue push19:44
drobillaIf you really don't believe me, you can just run the GUI and the engine in separate processes.  They'll talk over a socket19:45
rgareusdrobilla: how can you explain what's happening, then?19:46
drobillargareus: I have no idea.19:46
rgareusdrobilla: it's blablack who sees the issue, I do, and gdb does as well..19:47
drobillaThe signals are connected by NodeModule on construction anyway, they don't depend on the UI existing, so if value_changed and friends aren't being called *at all*, it's something deeper19:47
rgareusdrobilla: it could be a simple bug.19:47
rgareusdrobilla: or it could be a design-flaw. I don't know yet know the code+concept well enough to judge.19:47
drobillaNah.  *All* things being a big queue is why the design is good.19:48
drobillaand is why I can do fancy things like seprate GUI via TCP or LV2 ports :)19:48
drobillaanyway, clearly I can't be on IRC and get any work done anyway, so I might as well just fix it19:48
drobillaWhat is the easiest way to see the issue?  comment out the run-time sending stuff in a meter?19:49
rgareusdrobilla: if you have sisco.lv2 around.   start  gdb --args ingen -eg;  add "simple scope (Stereo) GTK",  then add breakpoints, http://pastebin.com/9ms1VvXK,  continue.19:50
rgareususe right-click > Show GUI   (double click locks the mouse-pointer in move-mode, so that you can't easily use gdb in another terminal)19:51
rgareusdrobilla: I've commented out src/sisco.c:32719:52
rgareusdrobilla: //tx_rawaudio(..);  but that's not strictly neccesary, just convenient.19:53
rgareusdrobilla: sisco's Makefile has '-g' as CFLAG by default, and I've waf configured ingen with --debug19:54
drobillaMan, those deprecation warnings sure are annoying.  Maybe I'm pushing it.19:56
drobillaTemporary nuisance vs chorus of ATOMS ARE CONFUSING WHATS GOING ON.  Tricky line to walk, that.19:57
drobillaSee also: event/atom19:57
drobillaI need to add a 'favourites' like Ardour one of these days20:02
drobillaMy Ardour favourites is entirely full of things useful for debugging, which say a lot about how much I get to actually use this crap :)20:02
* dongl peers at node.js+RTC Error500 alert-system20:10
drobillaThat set ends up coming back as a delta anyway, which is crap.  I guess I'll just fix the comms, then see what's up20:15
drobilla(delta is a messy event...)20:19
drobillaI need some kind of better design for reacting to 'special' property changes20:21
rgareus?20:22
drobillargareus: Ingen's design is based on events, all operations happen through them, like, Connect20:25
drobillargareus: Delta is the one that changes properties (delta as in diff).. but some properties are special, like changing polyphony20:25
drobillaSo it's just a massive if for all that.20:26
drobillaDesign wart, but not quite big enough to be alarming yet20:26
drobillaConsidering how dramatically this thing has evolved over the years, it's alright, I guess20:26
rgareusdrobilla: "delta as in diff" clarified it what you meant with  "delta is a messy event".20:27
rgareusdrobilla: can you reproduce the problem?20:28
rgareusdrobilla: compare ingen's behaviour with    jalv.gtk 'http://gareus.org/oss/lv2/sisco#Stereo_gtk' -- with ingen the GUi comes up with all knobs set to zero because the settings are not transferred to the GUI.20:30
LAbotTitle: LV2 Plugin Documentation (at gareus.org)20:30
drobillaI don't know why I avoided "diff" terminology both in ingen and in the patch vocabulary, which probably should have been called that20:30
drobilla"patch" in audio land doesn't make you think diff20:31
drobillaand maybe "delta" only does for mathy types?20:31
drobillargareus: Yeah, but I'm opting to start with fixing related things that need fixing anyway20:31
rgareusdrobilla: fair enough.20:32
drobillaWhich might actually be the source of the problem, but I don't know.20:33
drobillaBasically step 1 is always make sure the comms make sense.20:33
drobillaThey don't.20:33
rgareusdrobilla: If I can provide debug information, i'd be happy todo that.20:33
drobillargareus: Definitely a ton of NodeModule::value_changed being called on embed20:48
drobillaI can't tell why "a ton of".  Maybe I'll try as an LV2.  Ingen's debug dumping sucks compared to jalv -d20:48
rgareusdrobilla: I think some of them are due to loops20:49
rgareusdrobilla: gui event goes back to gui..20:50
rgareusdrobilla: ..creates another event from the gui20:50
rgareusdrobilla: For sisco.lv2, I've put a stopgap in place in the latest git revision a few days ago20:50
drobillaI wouldn't stopgap around Ingen, really, it's just pretty flaky in this regard still20:51
drobillaThis mechanism was originally for 'set port value' stuff, which avoids feedback by value equivalence20:51
drobillaBut this should be 'activity' anyway, so maybe fixing that will magically make it go away20:51
drobillargareus: How many messages does sisco init send?20:52
rgareusdrobilla: there's also value-equivalence in the GUI.  but that depends on the GTK-thread being active20:52
rgareusdrobilla: which eventually stops the loop.20:52
rgareusdrobilla: but the value of the dial itself is not updated until the GUI thread comes around20:52
rgareusdrobilla: init only one20:52
drobillaI guess you mean vs a drawing thead you are using internally20:52
drobilla(LV2 UI dictates one thread for all methods)20:53
drobillaI also personally think it's batshit insane to involve threads in UIs in the first place, but I don't really know anything about GL20:54
drobillaOn that, maybe the red book would be a good reading project20:54
drobillaIf, y'know, I had time for recreational reading projects20:54
rgareusdrobilla: which red-book? these days there's too many of them :)20:55
drobillaThe GL one.20:56
drobillaApparently there's a new edition that's all about shaders, which I guess things are, these days.20:56
drobillaMaybe if my living nightmare of having to take a course turns out to be true, I'll get lucky and some GL using course will happen next fall.20:57
drobilla(FML)20:57
rgareusdrobilla: http://glprogramming.com/red/ ?20:57
LAbotTitle: OpenGL Programming Guide : Table of Contents (at glprogramming.com)20:57
drobillaYeah20:57
rgareusor the hard-copy http://www.amazon.com/OpenGL-Programming-Guide-Official-Learning/dp/032155262820:58
drobillaI don't know much about it, other than being under the impression that there was a The GL Book, and that's the one20:58
drobilla(I have never actually read The C Book)20:58
drobillaAvoiding "feedback" in Ingen isn't so trivial, sometimes a Put can actually create something with a more expressive description21:00
drobillaMaybe I can just special case it for set_property and it'll be Good Enough™21:00
rgareusdrobilla: anyway.. initially there should be   UI => Plugin  a <http://gareus.org/oss/lv2/sisco#ui_on> .21:00
LAbotTitle: LV2 Plugin Documentation (at gareus.org)21:00
drobillargareus: So just one?21:00
rgareuswhich triggers a response  Plugin => UI   a <http://gareus.org/oss/lv2/sisco#ui_state>21:00
LAbotTitle: LV2 Plugin Documentation (at gareus.org)21:00
rgareusdrobilla: yes21:00
drobillargareus: okay, thanks21:00
drobillaLAbot: shut up21:01
LAbotdrobilla: Error: "shut" is not a valid command.21:01
drobillaSuppose I could just take its voice away21:01
rgareusdrobilla: and then there are are few 'UI => Plugin' messages21:01
drobillargareus: so not just one21:01
drobillaUI => Plugin => UI, then many UI => Plugin?21:01
rgareusdrobilla: correct21:02
drobillaeven if the response isn't received?21:02
rgareusdrobilla: the latter are generated because the UI updates its state (and then redundanly notifies the backend of those)21:02
drobillaSo, the same shit Ingen does :)21:03
rgareusdrobilla: if the first reply   Plugin => UI    does not make it though. the UI won't create further messages21:03
drobillargareus: ok21:03
rgareusdrobilla: the GUI does not care about the origin of the value-change  (it coud be user+mouse or MIDI-binding or whatever). it always tells the backend about the new state.21:05
rgareusdrobilla: I could filter out state-restore.21:05
rgareusdrobilla: but I didn't.21:05
drobillaGuess I have to make the broadcaster have a concept of 'ignore this client' when sending updates21:08
drobillaEventually I will get this insanity calmed down to be able to actually trace the damned problem :)21:08
* drobilla totally should have went outside more today21:09
rgareusdrobilla: I could probably whip up a small test-client.21:09
rgareusdrobilla: or just edit gui/sisco.c:2810   and  add a return(); as first thing in port_event()21:10
drobillargareus: If it still proves tricky, that might be useful, but this needs sorting out anyway21:10
rgareusdrobilla: this will make the GUI shut up after the first event.21:10
drobillae.g. running ingen in jalv -d and doing something like this should be a few messages, all of which totally make sense21:10
drobillaThere is a deeper philosophical issue here I'll just ignore :)21:12
drobillae.g. ingen UI does *not* assume connections are actually made when requesting21:12
drobillait sends the request, then the UI (view) is updated by the response21:13
drobillaFor special properties this may actually be how it needs to work, too.21:13
drobillaBut a bit stupid "ignore this client" will do, for now.21:13
drobilla... I really hope releasing Ingen doesn't interfere with my hobby of making it perfect :)21:14
*** thorwil has quit IRC21:16
rgareusdrobilla: FWIW, http://pastebin.com/stYHPGsF21:16
drobillargareus: Thanks21:17
drobillargareus: Hrm, I should probably figure out how to special case vectors to avoid all those type tags21:17
drobillaShame that the Turtle pretty types don't correspond to our actual needed types.  Had to put some hand-waving in my paper around this.21:17
Anchakordid you write the paper about atoms or gave up?21:18
drobillaAnchakor: Not finished yet, deadline extension and all, but I wrote it.  Almost done.21:19
Anchakorto when was the deadline extended?21:20
drobilla3rd21:20
drobillaI can send the WIP if anyone's interested21:20
AnchakorI could give my 2c on it21:20
drobillaCurrently fizzles out around 'applications', no conclusion21:21
drobillaMAKE PLUGIN UI {21:25
drobillaWRITE 021:25
drobilla} END MAKE PLUGIN UI21:25
drobillawarning: Non-port item added to module.21:25
drobillaWRITE 021:25
drobillaWRITE 021:25
drobillaHm, so there's the one write by the UI, and two more from... somewhere21:25
drobillabut this is lv2_ui_write21:25
drobillaguess it's breakpoint time21:26
drobillafuck off, SIGPIPE21:27
drobillathe jack dummy driver really isn't what I wish it was21:28
drobillargareus: Actually, it sends some on size allocate, too21:35
drobillahttp://pastebin.com/KwDtKWvx21:35
drobillaWhich ends up happening the next Gtk main tick before the next ingen event is processed, I think21:36
drobillaI am not really sure what the spec could or should say about things like this.21:38
rgareusdrobilla: odd that I don't see this in jalv.21:40
rgareusdrobilla: and an interesting feat of gtk.21:41
drobillargareus: You really should follow the universal bloody conventions when naming your types and properties :P21:41
rgareusdrobilla: you mean variable names or URIs?21:42
rgareus(or both?)21:42
drobillargareus: Probably not really problematic anyway.  Most likely happens in jalv too, you'd just have to specifically be looking for it21:42
drobillargareus: eg:MyType eg:myProperty21:42
* drobilla is not a huge fan of camel case either, except for types21:43
rgareusdrobilla: URIs, yeah. sadly all this code predates you educating me about the convention.21:43
drobillaYeah, just idly bitching, nevermind me :)21:43
drobillaI need to do some work on the book...21:44
rgareusdrobilla: I considered changing it. there's no 1.0 release yet, so I can just change it and saved state will be lost.21:44
rgareusdrobilla: I may still do this when I'm bored.21:45
drobillaYeah, nothing like some mindless renaming to feel productive without having to actually think :)21:45
rgareusdrobilla: excactly.21:46
rgareusdrobilla: though 'good urls don't change'.  I can appease my conscience that they were not good URLs to begin with and explain to users that there was no 1.0 yet.... but what a waste of time.21:48
drobillaI care less since there's an "official" scope example21:48
drobillaThings pitched as examples being weird is problematic.21:49
drobillaAnyway, it would seem the notify response isn't getting sent, period21:51
drobillalike, from the engine, it's not making it to the UI at all21:52
rgareusdrobilla: yes21:52
drobillaSo all that stuff about it getting there but racey timing not ready to receive and so on was way off21:54
rgareusdrobilla: The response is put into the Atom buffer during lilv_instance_run()21:54
rgareusdrobilla: but  I didn't see  NodeModule::port_activity()21:55
drobillaRight, and I'm currently looking for the code that scans that to decide if anything needs sendig  to clients...21:55
rgareusdrobilla: nor NodeModule::port_value_changed()21:55
drobillawhich really should be in here somewhere...21:55
drobillargareus: yeah, but that's universes above the level where it seems to get lost21:56
drobillalike, it's literally just not sent period21:56
rgareusdrobilla: IIUC the port subscriptions happens in src/gui/NodeModule.cpp only after the GUI is instantiated21:58
rgareusdrobilla: though it should really be done when the plugin is instantiated -- not the GUI.21:59
drobillathat'd do it.21:59
drobillargareus: Not really.  flood.21:59
drobillargareus: == "please send all MIDI everything ever to the UI"21:59
drobillaotherwise, at best it wants an occasional bonk so a port can light up22:00
drobillaand even that is off by default22:00
rgareusdrobilla: but even then it'll not work, because at the time the event comes. _plugin_ui == 0. the event would not make it though22:03
drobillargareus: again, the UI is not multi-threaded22:03
drobillaso no event can "come" in the middle of a function22:04
rgareusdrobilla: that's what the backtrace at ticket/954 shows anyway.22:04
drobillaI do not see how that backtrace shows this22:05
drobilla"can send a message to the backend, which is not ring-buffered but directly delivered to the back-end"  = false22:05
drobillaThe backtrace doesn't say anything about the reply22:06
drobillaWhich is not surprising, because there isn't one ;)22:06
rgareusdrobilla: mmh indeed.22:06
drobillaI don't blame you, you're conditioned by the pain of Ardour22:07
drobillaIn ingen, that whooooooooooooole world of stuff just does not exist at all.  All things are just one big linear queue, ringbuffered on both sides22:07
drobillaAssuming the monitoring stuff (set ingen:broadcast = true) works, it's just that this is being set *after* the requests, so no responses22:08
drobillai.e. you nailed it somewhere up there re: subscription22:09
drobillargareus: are you using the dynamic port subscribe stuff?22:10
drobillasomething is subscribing, but I can't find what22:11
drobillaand looking at jalv -d it does actually seem to happen first22:11
rgareusdrobilla: "dynamic port subscribe"  I don't even know what that is in LV2 context.22:11
drobillargareus: There are functions for this the UI can call22:12
drobillaRather than list static port notifications.  Added somewhat recently22:12
drobillaHm.  THe problem may be self-contained in PluginUI::create, which literally subscribes after instantiate22:13
rgareusdrobilla: from the plugin's POV (backend and UI) all ports are all static as described in the .ttl22:14
drobillathe failed to instantiate case is going to be super annoying :/22:14
drobillaYeah, I just don't actually look for notifications.  It's pretty annoying. :)22:14
rgareusdrobilla: the .ttl includes a notify part, though22:14
drobillaWhich means it was probably pushing the ttl thing too far, if *I* was too lazy to implement it22:15
drobilla... But I'm pretty lazy :)22:15
drobillargareus: If I see knobs not at zero does that mean fixed?23:15
drobilla(e.g. hold = 0.5)23:15
drobillawhite backgrounds in this UI look horrific in Ingen23:16
rgareusdrobilla: yes. and yes.23:16
rgareusdrobilla: it uses gtk styles23:16
drobillargareus: the real problem was subscribing after instantiate, all local to the same function23:17
rgareusdrobilla: so how did/do you solve this?23:19
drobilla1) grep ingen code for suil_instance_new23:20
drobilla2) find this in a function, which, immediately *AFTER* that, subscribes to port notifications23:20
drobilla3) ah23:20
drobillathat said, I fixed a bunch of cracked out comms in the process anyway23:21
drobillapretty hefty 280 byte message whenever anything changes, but I guess that's the easy/solid way if it's small enough23:32
rgareusdrobilla: another issue of /me being lazy23:32
drobillaI sometimes think about turning the Ingen way of things into a framework23:33
rgareusdrobilla: just dump the whole state (rather than the change only)23:33
drobillaWhich would be quite nice23:33
drobillaBut I have no incentive to do so since I have no other apps23:33
drobillaWell... I guess Machina could be23:33
drobillaWell, let me clean up and commit23:34
rgareusbut calling 280 bytes 'hefty' is a bit of an overstatement :)23:35
rgareusin particular compared to Kbytes of raw audio-data transmitted plugin => UI23:36
drobillaFair enough.23:37
drobillaI made atom pretty bloatey anyway since I didn't want to eventually go "shit, 16 bits wasn't enough"23:38
drobillaTotally probably would have been enough though23:38
*** edogawa has quit IRC23:46
drobillaI hope this feedback fix doesn't have consequences...23:59
drobillaQuite possible the GUI itself relies on that in several places23:59
drobillargareus: http://dev.drobilla.net/changeset/532623:59
LAbotTitle: Changeset 5326 – drobillad (at dev.drobilla.net)23:59
drobillargareus: Please confirm fix when you get the chance23:59

Generated by irclog2html.py 2.13.0 by Marius Gedminas - find it at mg.pov.lt!