add dbus command to allow checking of wether hardware is currently exported
[a2jmidid.git] / internals.txt
blobffee01bef8b52821b2bc1b747f17308a52820c31
1 = Threads =
2 jack_process:
3  add new ports
4  reads queued snd_seq_event's
5  if PORT_EXIT: mark port as dead
6  if PORT_ADD, PORT_CHANGE: send addr to a2j_port_thread (it also may mark port as dead)
7  else process input event
8  remove dead ports and send them to a2j_port_thread
10  remove dead ports and send them to a2j_port_thread
11  add new ports
12  queue output events
14 main_loop:
15  free deleted ports
16  create new ports or mark existing as dead
18 = ringbuffers =
20  * early_events ( alsa_midi_event_t + data)
21  * new_ports
22  * port_add (snd_seq_addr_t)
23  * port_del (port_t *)
25 = port life cycle =
26 == port birth ==
27  * during jack process function execution, in a2j_port_event(), event
28    about port creation is received from system alsa seq client and
29    port alsa seq address is written to port_add ringbuffer.
30  * In main loop, a2j_update_ports() is called. a2j_update_ports()
31    reads port alsa seq address from port_add ringbuffer. If port is
32    new one and should be exported, it is created by calling
33    a2j_port_create() in a2j_update_port_type() and port pointer is
34    added to new_ports ringbuffer.
35  * during jack process function execution, in a2j_add_ports(), port
36    pointer is read from new_ports ringbuffer and port is added to port
37    hash.
39 == port death ==
40  * during jack process function execution, in a2j_port_event(), event
41    about port destruction is received from system alsa seq client and
42    port is marked as dead.
43  * during jack process function execution, in
44    a2j_jack_process_internal() ports marked as dead are removed from
45    port hash and port address is written to port_del ringbuffer.
46  * In main loop, a2j_free_ports() is called. It pops port pointers
47    from port_del ringbuffer and frees ports.
49 = Call graph generation =
50   CFLAGS='-dr' ./waf configure
51   ./waf
52   make cg
53   file build/call_graph.*