summaryrefslogtreecommitdiffstats
path: root/thesis/thesis.tex
blob: 4afc5d3050a969644be510a26f9166b9bf3c70f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
\documentclass[12pt,a4paper,oneside,titlepage]{paper}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{listings}
\lstdefinelanguage{Ini}{basicstyle=\ttfamily\tiny,
  columns=fullflexible,
  tag=[s]{[]},
  tagstyle=\color{blue}\bfseries,
  usekeywordsintag=true
}[html]
\lstdefinelanguage{bash}{basicstyle=\ttfamily\tiny}
\usepackage{ulem}
\usepackage{lmodern}
\usepackage{multirow}
\usepackage{url}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage{float}
\floatstyle{boxed}
\restylefloat{figure}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\definecolor{osc-out}{RGB}{150,0,255}
\definecolor{osc-in}{RGB}{0,0,255}
\definecolor{audio-in}{RGB}{255,0,0}
\definecolor{audio-out}{RGB}{0,206,0}

\usepackage{hyperref}
\hypersetup{hidelinks, colorlinks = false}
\usepackage[font=scriptsize]{caption}
\usepackage[authoryear]{natbib}

% glossary
\usepackage[acronym,nonumberlist,toc]{glossaries}
\newacronym{asdf}{ASDF}{Audio Scene Description Format}
\newacronym{bs}{BS}{Binaural Synthesis}
\newacronym{brs}{BRS}{Binaural Room Synthesis}
\newacronym{cnmat}{CNMAT}{Center for New Music and Audio Technologies}
\newacronym{gpl}{GPL}{GNU General Public License}
\newacronym{lgpl}{LGPL}{GNU Lesser General Public License}
\newacronym{hoa}{HOA}{Higher Order Ambisonics}
\newacronym{ip}{IP}{Internet Protocol}
\newacronym{jack}{JACK}{JACK Audio Connection Kit}
\newacronym{oop}{OOP}{Object-oriented Programming}
\newacronym{osc}{OSC}{Open Sound Control}
\newacronym{posix}{POSIX}{Portable Operating System Interface}
\newacronym{pubsub}{PubSub}{Publish-subscribe message pattern}
\newacronym{pd}{Pd}{PureData}
\newacronym{raii}{RAII}{Ressource acquisition is initialization}
\newacronym{ssr}{SSR}{SoundScape Renderer}
\newacronym{tcp}{TCP}{Transmission Control Protocol}
\newacronym{udp}{UDP}{User Datagram Protocol}
\newacronym{vbap}{VBAP}{Vector Based Amplitude Panning}
\newacronym{wfs}{WFS}{Wave Field Synthesis}
\newacronym{xml}{XML}{Extensible Markup Language}
\makeindex
\makeglossaries



\graphicspath{{../images//}}

\begin{document}
  \begin{titlepage}
    \centering
    \includegraphics[width=0.3\textwidth]{tu-berlin-logo.pdf}\par\vspace{1cm}
    {\scshape\LARGE Technische Universität Berlin\par}
    \vspace{1cm}
    {\scshape\Large Master Thesis\par}
    \vspace{1.5cm}
    {\huge\bfseries A Networking Extension for the SoundScape Renderer\par}
    \vspace{2cm}
    {\Large\itshape David Runge\par}
    \href{dave@sleepmap.de}{dave@sleepmap.de}
    \vfill
    supervised by\par
    Henrik von Coler and Stefan Weinzierl
    \vfill
    {\large \today\par}
  \end{titlepage}

  \pagestyle{empty}
  \section*{Eidesstattliche Erklärung}
  \vspace{1cm}
  Hiermit erkläre ich, dass ich die vorliegende Arbeit selbstständig und
  eigenhändig sowie ohne unerlaubte fremde Hilfe und ausschließlich unter
  Verwendung der aufgeführten Quellen und Hilfsmittel angefertigt habe.\\
  Berlin, den \today\par\\
  \vspace{2cm}
  \noindent\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\\
  David Runge

  \begin{abstract}
    \gls{wfs} as a technological concept has been around for
    many years now and all over the world several institutions run small and
    some even large scale setups ranging from single speaker lines to those
    facilitating a couple of hundred loudspeakers respectively.\\ 
    The still evolving implementations are driven by several rendering
    engines, of which two free and open-source ones, namely sWONDER and
    SoundScape Renderer, have (partially) been developed at TU Berlin.\\
    The latter due to its current design is not yet able to render for large
    scale setups, ie.\ those using several computers to render audio on a
    loudspeaker setup, due to the high amount of channels.\\
    Its solid codebase however, which additionally offers a framework for many
    more renderering types, and the ongoing development, deems further work on
    this application a good future investment.\\ 
    This work is about the extension of the SoundScape Renderer's functionality
    to turn it into a networking application for large scale \gls{wfs} setups.
  \end{abstract}

  \tableofcontents
  \cleardoublepage
  \pagestyle{headings}
  \setcounter{page}{1}

  \section{Introduction}
    \label{sec:introduction}


  \cleardoublepage
  \section{Free and open-source spatial audio renderers}
    \label{sec:freespatialaudiorenderers}
    To date there exist three (known of) free and open-source spatial audio
    renderers, which are all \href{http://jackaudio.org/}{\gls{jack}}
    \citep{website:jackaudio2016} clients:
    \begin{itemize}
      \item \href{https://sourceforge.net/projects/swonder/}{sWONDER}
        \citep{website:swonder2016}, developed by Technische Universität
        Berlin, Germany 
      \item \href{https://github.com/GameOfLife/WFSCollider}{WFSCollider}
        \citep{website:wfscollider2016}, developed by
        \href{http://gameoflife.nl/en}{Game Of Life Foundation}
        \citep{website:gameoflife2016}, The Hague, Netherlands
      \item \href{http://spatialaudio.net/ssr/}{\gls{ssr}}
        \citep{website:ssr2016}, developed by Quality \& Usability Lab,
        Deutsche Telekom Laboratories and TU Berlin and Institut für
        Nachrichtentechnik, Universität Rostock 
    \end{itemize}
    Currently only WFSCollider and the \gls{ssr} are actively maintained and
    developed, thus sWONDER, although used in some setups, loses significance.
    Generally it can be said, that different concepts apply to the three
    renderers, which are about to be explained briefly in the following
    sections.

    \subsection{Spatial audio renderers and their appliance}
      \label{subsec:spatialaudiorenderersandtheirappliance}
      \subsubsection{Wave Field Synthesis}
        \label{subsubsec:wavefieldsynthesis}
      \gls{wfs} describes a spatial technique for rendering
      audio. As such it aims at synthesizing a sound field of desired acoustic
      preference in a given listening area, assuming a planar reproduction to be
      most suitable for most applications.\\
      \gls{wfs} is typically implemented using a curved or linear loudspeaker array
      surrounding the listening area.\\
      Several free and open-source renderer applications exist for \gls{wfs}
      environments, with varying stages of feature richness.\\
      The proposed work will focus on one of them and its extension towards \gls{wfs}
      on large scale systems.
      \subsubsection{Higher order ambisonics and vector based amplitude panning}
        \label{subsubsec:hoaandvbap}
      \subsubsection{Binaural (Room) Synthesis}
        \label{subsubsec:binaural}

    \subsection{WONDER}
      \label{subsec:WONDER}
      sWONDER \citep{baalman2007} consists of a set of C++ applications that
      provide \gls{bs} and \gls{wfs} rendering. In 2007 it was specifically
      redesigned \citep{baalmanetal2007} to cope with large scale \gls{wfs} setups in
      which several (computer) nodes, providing several speakers each, drive a
      system together.\\
      In these setups each node receives all available audio streams (which
      represent one virtual audio source respectively) redundantly and a master
      application signals which node is responsible for rendering what source
      on which speaker.\\
      It uses \gls{osc} for messaging between its parts and for
      setting its controls. Apart from that, it can be controlled through a
      Graphical User Interface (GUI), that was specifically designed for it.
      Unfortunately sWONDER has not been actively maintained for several years,
      has a complex setup chain and many bugs, that are not likely to get fixed
      any time soon.

    \subsection{HOA-Pd}
      \label{subsec:hoapd}
    \subsection{WFSCollider}
      \label{subsec:wfscollider}
      WFSCollider was built on top of
      \href{https://supercollider.github.io}{SuperCollider} 3.5
      \citep{website:supercollider} and is also capable of driving large
      scale systems. It uses a different approach in
      doing so, though: Whereas with sWONDER all audio streams are distributed
      to each node, WFSCollider usually uses the audio files to be played on
      all machines simultaneously and synchronizes between them.\\
      It has a feature-rich GUI in the ``many window'' style, making available
      time lines and movement of sources through facilitating what the sclang
      (SuperCollider programming language) has to offer.\\
      As WFSCollider basically is SuperCollider plus extra features, it is also
      an \gls{osc} enabled application and can thus also be used for mere
      multi-channel playback of audio.\\
      Although it has many useful features, it requires MacOSX (Linux version
      still untested) to run, is built upon a quite old version of
      \href{https://supercollider.github.io}{SuperCollider} and is likely never
      to be merged into it, due to many core changes to it.

    \subsection{SoundScape Renderer}
      \label{subsec:soundscaperenderer}
      \gls{ssr}, also a C++ application, running on Linux and
      MacOSX, is a multi-purpose spatial audio renderer, as it is not only
      capable of \gls{bs} and \gls{wfs}, but also \gls{hoa}
      and \gls{vbap}.\\
      It can be used with a GUI or headless (without one), depicting the
      virtual sources, their volumes and positions, alongside which speakers
      are currently used for rendering a selected source.
      \gls{ssr} uses TCP/IP sockets for communication and is therefore not directly
      \gls{osc} enabled. This functionality can be achieved using the capapilities of
      other applications such as \gls{pd} \citep{website:puredata2016} in
      combination with it though.\\
      Unlike the two renderers above, the \gls{ssr} is not able to run large-scale
      \gls{wfs} setups, as it lacks the features to communicate between instances of
      itself on several computers, while these instances serve a subset of the
      available loudspeakers.

  \cleardoublepage
  \section{Methods}
    \label{sec:methods}
    The \gls{ssr}, due to its diverse set of rendering engines, which are made
    available through an extensible framework, and its relatively clean
    codebase, is a good candidate for future large scale \gls{wfs} setups. These type
    of features are not yet implemented though and will need testing.\\
    Therefore I propose the implementation and testing of said feature, making
    the \gls{ssr} capable of rendering on large scale \gls{wfs} setups with many nodes,
    controlled by a master instance.\\
    The sought implementation is inspired by the architecture of sWONDER, but
    instead of creating many single purpose applications, the master/node
    feature will be made available through flags to the \gls{ssr} executable, when
    starting it. This behavior is already actively harnessed eg.\ for selecting
    one of the several rendering engines.
    \begin{figure}[!htb]
      \centering
      \includegraphics[scale=0.9, trim = 31mm 190mm 24mm 8mm, clip]
      {ssr-networking.pdf}
      \caption{A diagram displaying the \gls{ssr} master/node setup with TCP/IP
        socket connections over network (green lines), audio channels (red
        dashed lines) and \gls{osc} connection (blue dashed line). Machines are
          indicated as red dashed rectangles and connections to audio hardware
        as outputs of \gls{ssr} nodes as black lines below them.}
      \label{fig:ssr-networking}
    \end{figure}
    While the \gls{ssr} already has an internal logic to know which loudspeaker will
    be used for what virtual audio source, this will have to be extended to be
    able to know which renderer node has to render what source on which
    loudspeaker (see Figure~\ref{fig:ssr-networking}).
    To achieve the above features, the \gls{ssr}'s messaging (and thus also settings)
    capabilities have to be extended alongside its internal logic concerning
    the selection of output channels (and the master to node notification
    thereof). To introduce as little redundant code as possible, most likely a
    ``the client knows all'' setup is desirable, in which each node knows about
    the whole setup, but is also set to only serve its own subset of
    loudspeakers in it. This will make sure that the rendering engine remains
    functional also in a small scale \gls{wfs} setup.\\
    The lack of a direct \gls{osc} functionality, as provided by the two other
    renderers, will not be problematic, as master and nodes can communicate
    through their builtin TCP/IP sockets directly and the master can, if
    needed, be controlled via \gls{osc}.
    \subsection{Prelimenaries}
      \label{subsec:preliminaries}
      In preparation to the work an implement a side-by-side
      installation, using Arch Linux on a medium scale setup, facilitating the
      \gls{wfs} system of the Electronic Studio at TU Berlin. Unfortunately the
      proprietary Dante driver, that is used in that system is very complex to be
      built, as well as underdeveloped and thus keeps the system from being
      easily updated, which is needed for testing purposes (finding a suitable
      real-time, low-latency Linux kernel), trying out new software features,
      building new software and keeping a system safe. The driver will most
      likely require changes to the hardware due to implemention of hardware
      branding by the vendor and dire testing before usage.\\
      Although eventually using a proper \gls{wfs} setup for testing will be necessary,
      it is luckily not needed for implementing the features, as they can already
      be worked out using two machines running Linux, \gls{jack} and the development
      version of \gls{ssr}.\\
      The hardware of the large scale setup at TU Berlin in H0104 is currently
      about to be updated and therefore a valuable candidate for testing of the
      sought after \gls{ssr} features.
    \subsection{Outline}
      \label{subsec:outline}
      Initially extending the \gls{ssr}'s features was aimed at 
      \subsubsection{Remote controlling a server}
        \label{subsubsec:remote_controlling_a_server}
      \subsubsection{Remote controlling clients}
        \label{subsubsec:remote_controlling_a_client}
      \subsubsection{Rendering on dedicated speakers}
        \label{subsubsec:rendering_on_dedicated_speakers}
    \subsection{Publisher/Subscriber interface}
      \label{subsec:publisher_subscriber_interface}
      The \gls{ssr} internally uses a \gls{pubsub}, which is a design pattern,
      to implement control through and over several parts of its components.\\
      In \gls{oop} \gls{pubsub} - also called observer, listener messaging - is
      usually comprised of a publisher class, handling the messages, without
      explicitely implementing how they will be used and a subscriber class,
      that allows for its implementations to subscribe to the messages
      provided. Filtering takes place to enable subscribers to only receive a
      certain subset of the messages.\\
      The \gls{ssr} implements a content-based filtering system, in which each
      subscriber evaluates the messages received and acts depending on its own
      constraints to implement further actions upon it.\\
      The abstract class Publisher defines the messages possible to send and
      provides means to subscribe to them. The global Controller class is its
      only implementation within the \gls{ssr}.\\
      The abstract class Subscriber in turn defines the messages understood,
      while its implementations in RenderSubscriber, Scene, OscSender and
      NetworkSubscriber take care of how they are used.\\
      This system enables a versatile messaging layout, in which components can
      call the publisher functionality in Controller, which in turn will send
      out messages to all of its subscribers.

    \subsection{IP interface}
      \label{subsec:ip-interface}
      The \gls{ssr} from early on incorporated a network interface, that
      accepts specially terminated \gls{xml}-formatted strings over a \gls{tcp}
      port, called “\gls{ip} interface”. This has the benefit of reusing the
      same \gls{xml} parser code in use for scene and reproduction
      description.\\
      A downside is however, that - from the perspective of other software - it
      is complicated to use, as a conversion to \gls{xml} has to be attempted
      before sending a message to the \gls{ssr}. Additionally the message has
      to be linted (error checked) before sending and again parsed, after
      receiving an answer from the application.\\

      \paragraph{OSC through PureData}
        \label{par:osc_through_puredata}
        To allow \gls{osc} communication, the \gls{ssr} incorporates a Lua
        based \gls{pd} external. It uses two externals (iemnet and pdlua)
        alongside a Lua library for parsing and creating \gls{xml} (SLAXML).

      \paragraph{Sending and receiving}
        \label{par:sending_and_receiving}
        As mentioned in
        section~\nameref{subsec:publisher_subscriber_interface}, the
        NetworkSubscriber class (part of the \gls{ip} interface) implements the
        subscriber interface. This means: The network interface subscribes to
        the messages the publisher (the Controller instance) has to offer.
        Every time a function of the \gls{ssr}'s Controller instance, that was
        inherited from Publisher, is called, it will issue the call on all of
        its subscribers, too.\\

  \cleardoublepage
  \section{Results}
    \label{sec:results}
    \subsection{Open Sound Control interface}
      \label{subsec:osc-interface}
      \gls{osc} is an “open, transport-independent, message-based protocol
      developed for communication among computers, sound synthesizers, and
      other multimedia devices” \citep{website:oscv1.0} developed at the
      \gls{cnmat}.  Its 1.0 specification was published by Matthew Wright in
      2002 \citep{website:oscv1.0} and the protocol has found widespread
      implementations (as libraries) in several programming languages and
      through that many use-cases in free and closed audio and video related
      applications (e.g. Ardour \citep{website:ardour}, Cubase
      \citep{website:steinberg}, Max/MSP \citep{website:cycling74},
      SuperCollider \citep{website:supercollider}) since then.\\
      \gls{osc}'s syntax is defined by several parts, which are discussed
      briefly in this section.\\
      /begin{itemize}
        \item Atomic data types, which are also reflected in type tags (see
          Table~\ref{tab:ssr-osc-data-type-acronyms} for details)
        \item Address patterns (a \gls{osc}-string starting with a “/”)
        \item Type tag string (a string, beginning with a “,”, holding a set of
          type tags, describing a collection of atomic data types)
        \item Arguments, a set of binary representations of each argument
        \item Messages, consisting (in sequence) of an address pattern, a type
          tag string and \textit{n} \gls{osc} arguments.
        \item Bundles, consisting of a set of Messages.
        \item Packets, the unit of transmission (sent over \gls{udp} or
          \gls{tcp}), consisting of a message or a bundle.
      /end{itemize}
      According to the specification, applications sending \gls{osc} packets
      are considered a client and the ones receiving packets a server.
      Applications can therefore be client and server at the same time.
      \begin{table}[!htb]
        \scriptsize
        \centering
        \begin{tabular}{ p{2cm} | p{8cm} }
          \textbf{\gls{osc} type tag} & \textbf{Type} \\
          \texttt{i} & int32 \\
          \texttt{f} & float32 \\
          \texttt{s} & \gls{osc}-string \\
          \texttt{b} & \gls{osc}-blob \\
          \hline
          \texttt{h} & 64 bit big-endian two's complement integer\\
          \texttt{t} & \gls{osc}-timetag\\
          \texttt{d} & 64 bit (“double”) IEEE 754 floating point number\\
          \texttt{S} & Alternate type represented as an \gls{osc}-string (for
          example, for systems that differentiate “symbols” from “strings”)\\
          \texttt{c} & an ascii character, sent as 32 bits\\
          \texttt{r} & 32 bit RGBA color\\
          \texttt{m} & 4 byte MIDI message. Bytes from MSB to LSB are: port id,
          status byte, data1, data2\\
          \texttt{T} & True. No bytes are allocated in the argument data.\\
          \texttt{F} & False. No bytes are allocated in the argument data.\\
          \texttt{N} & Nil. No bytes are allocated in the argument data.\\
          \texttt{I} & Infinitum. No bytes are allocated in the argument
          data.\\
          \texttt{[} & Indicates the beginning of an array. The tags following
            are for data in the Array until a close brace tag is reached.\\
          \texttt{]} & Indicates the end of an array.\\
        \end{tabular}
        \caption{Acronyms (type tags) for atomic data types, used in \gls{osc}
        messages and bundles \citep{website:oscv1.0}.}
        \label{tab:ssr-osc-data-type-acronyms}
      \end{table}

      \subsubsection{liblo}
        \label{subsubsec:liblo}
        Liblo \citep{website:liblo2017} is an implementation of the \gls{osc}
        protocol for \gls{posix} systems. It was initially developed by Steve
        Harris and is now actively maintained by Stephen Sinclair.\\
        The library, written in C, offers a C++ abstraction layer and is
        released under the \gls{lgpl} v2.1 or greater. Additionally there are
        wrappers for the Perl and Python programming languages.\\
        Due to its long standing availability and usage in many small and
        large-scale software projects, alongside its fairly straight forward
        implementability, it was chosen as the candidate for establishing a
        \gls{osc} interface for the \gls{ssr}.\\
        At the time of writing liblo's lastet stable release (0.28) was issued
        on 27th January 2014. Many changes and improvements have been applied
        to the codebase since then. One of them is the implementation of a
        ServerThread for the C++ abstraction layer, which runs a Server object
        on a separate thread automatically.\\
        In programming, threads are a way to implement simultaneous and/ or
        asynchroneous execution of code. The liblo Server class, at the core of
        the C++ side of the library, is responsible for assigning a network
        port to listen to for incoming messages, listening for messages,
        executing code on their arrival (callback handling) and sending
        messages to clients. As most applications, that use liblo, use
        \gls{osc} only as a messaging system, it usually means, that the
        application itself is not single-purpose and is busy computing
        something else most of the time. Therefore it makes sense to run a
        Server object on a separate background thread, to not interfere with
        the executional flow of the rest of the program.\\
        The ServerThread class is able to free its ressources upon going ot of
        scope, known as \gls{raii}. For this reason, the latest development
        version instead of the current stable version of liblo was chosen for
        the implementation.

      \subsubsection{Client-Server setup}
        \label{subsubsec:client_server_setup}
        \begin{figure}[!htb]
          \centering
          \includegraphics[scale=1.0, trim = 20mm 204mm 10mm 10mm, clip]
          {ssr-client-server-shared-output.pdf}
          \caption{A diagram displaying a \gls{ssr} client/server setup, in
            which the server and the clients render audio collectively (e.g.
            \gls{wfs}). The server instance is not controlled via \gls{osc},
            but controls its clients through it.\\
            {\color{osc-in}\textbf{--}} \gls{osc} input
            {\color{osc-out}\textbf{--}} \gls{osc} output
            {\color{audio-in}\textbf{--}} Audio input
            {\color{audio-out}\textbf{--}} Audio output
          }
          \label{fig:ssr-client-server-shared-output}
        \end{figure}
        \begin{figure}[!htb]
          \centering
          \includegraphics[scale=1.0, trim = 20mm 204mm 10mm 10mm, clip]
          {ssr-client-server-separate-output.pdf}
          \caption{A diagram displaying a \gls{ssr} client/server setup, in
            which the server and the clients render audio to separate outputs
            (e.g.\ multiple \gls{bs} renderers). The server instance is not
            controlled via \gls{osc}, but controls its clients through it.\\
            {\color{osc-in}\textbf{--}} \gls{osc} input
            {\color{osc-out}\textbf{--}} \gls{osc} output
            {\color{audio-in}\textbf{--}} Audio input
            {\color{audio-out}\textbf{--}} Audio output
          }
          \label{fig:ssr-client-server-separate-output}
        \end{figure}
        \begin{figure}[!htb]
          \centering
          \includegraphics[scale=1.0, trim = 20mm 204mm 10mm 10mm, clip]
          {ssr-external-client-server-shared-output.pdf}
          \caption{A diagram displaying a \gls{ssr} client/server setup, in
            which the server and the clients render audio collectively (e.g.
            \gls{wfs}). The server instance is controlled by an \gls{osc}
            capable application (acting as another client) and controls its
            clients through \gls{osc} as well.\\
            {\color{osc-in}\textbf{--}} \gls{osc} input
            {\color{osc-out}\textbf{--}} \gls{osc} output
            {\color{audio-in}\textbf{--}} Audio input
            {\color{audio-out}\textbf{--}} Audio output
          }
          \label{fig:ssr-external-client-server-shared-output}
        \end{figure}
        \begin{figure}[!htb]
          \centering
          \includegraphics[scale=1.0, trim = 20mm 204mm 10mm 10mm, clip]
          {ssr-external-client-server-separate-output.pdf}
          \caption{A diagram displaying a \gls{ssr} client/server setup, in
            which the server and the clients render audio separately (e.g.\
            multiple \gls{bs} renderers). The server instance is controlled by
            an \gls{osc} capable application (acting as another client) and
            controls its clients through \gls{osc} as well.\\
            {\color{osc-in}\textbf{--}} \gls{osc} input
            {\color{osc-out}\textbf{--}} \gls{osc} output
            {\color{audio-in}\textbf{--}} Audio input
            {\color{audio-out}\textbf{--}} Audio output
          }
          \label{fig:ssr-external-client-server-separate-output}
        \end{figure}
        \begin{figure}[!htb]
          \centering
          \includegraphics[scale=1.0, trim = 20mm 204mm 10mm 10mm, clip]
          {ssr-external-clients-only-separate-output.pdf}
          \caption{A diagram displaying a \gls{ssr} client cluster setup, in
            which a set of clients render audio separately (e.g.\ multiple
            \gls{bs} renderers). An \gls{osc} capable application acts as a
            \gls{ssr} server instance and controls the clients.\\
            {\color{osc-in}\textbf{--}} \gls{osc} input
            {\color{osc-out}\textbf{--}} \gls{osc} output
            {\color{audio-in}\textbf{--}} Audio input
            {\color{audio-out}\textbf{--}} Audio output
          }
          \label{fig:ssr-external-clients-only-separate-output}
        \end{figure}
        \begin{figure}[!htb]
          \centering
          \includegraphics[scale=1.0, trim = 20mm 204mm 10mm 10mm, clip]
          {ssr-external-clients-only-shared-output.pdf}
          \caption{A diagram displaying a \gls{ssr} client cluster setup, in
            which a set of clients render audio collectively (e.g.\ medium or
            large-scale \gls{wfs} setup). An \gls{osc} capable application acts
            as a \gls{ssr} server instance and controls the clients.\\
            {\color{osc-in}\textbf{--}} \gls{osc} input
            {\color{osc-out}\textbf{--}} \gls{osc} output
            {\color{audio-in}\textbf{--}} Audio input
            {\color{audio-out}\textbf{--}} Audio output
          }
          \label{fig:ssr-external-clients-only-shared-output}
        \end{figure}
  \cleardoublepage
      \subsubsection{Layered clients}
        \label{subsubsec:layered_clients}
      \subsubsection{Message interface}
        \label{subsubsec:message_interface}
        \gls{osc} offers the possibility of a hierarchical path tree, that can be used to group messages 
        \begin{table}[!htb]
          \scriptsize
          \centering
          \caption*{(Data types and their acronyms are listed in
            Table~\ref{tab:ssr-osc-data-type-acronyms}.)
          }
          \begin{tabular}{ p{2cm} | p{1cm} | p{3.5cm} | p{3cm} }
            \textbf{Path} & \textbf{Types} & \textbf{Description} &
            \textbf{Example}\\
            \hline
            \texttt{/message\_level} & i & Set message level of sender &
            \texttt{[/message\_level, 1]} \\
            \noalign{\smallskip}
            \texttt{/message\_level} & ssi & Set message level of a specific
            client & \texttt{[/message\_level, “127.0.0.1”,
            “50002”, 1]} \\
            \noalign{\smallskip}
            \texttt{/subscribe} & F & Unsubscribe sender & \texttt{[/subscribe,
            false]} \\
            \noalign{\smallskip}
            \texttt{/subscribe} & Fss & Unsubscribe specific client &
            \texttt{[/subscribe, false, “127.0.0.1”, “50002”]}\\
            \noalign{\smallskip}
            \texttt{/subscribe} & T & Subscribe sender & \texttt{[/subscribe,
            true]} \\
            \noalign{\smallskip}
            \texttt{/subscribe} & Ti & Subscribe sender with specific message
            level & \texttt{[/subscribe, true, 1]} \\
            \noalign{\smallskip}
            \texttt{/subscribe} & Tssi & Subscribe specific client with
            specific message level & \texttt{[/subscribe, true, “127.0.0.1”,
            “50002”, 1]} \\
          \end{tabular}
          \caption{\gls{osc} messages relevant for subscribing and setting of
            message levels for clients.\\
            Understood by server.
          }
          \label{tab:ssr-osc-subscribe}
        \end{table}
        \begin{table}[!htb]
          \scriptsize
          \centering
          \caption*{(Data types and their acronyms are listed in
            Table~\ref{tab:ssr-osc-data-type-acronyms}.)
          }
          \begin{tabular}{ p{3cm} | p{1.2cm} | p{3.5cm} | p{3cm} }
            \textbf{Path} & \textbf{Types} & \textbf{Description} &
            \textbf{Example}\\
            \hline
            \texttt{/processing/state} & F & Unset processing state &
            \texttt{[/processing/state, false]} \\
            \noalign{\smallskip}
            \texttt{/processing/state} & T & Set processing state &
            \texttt{[/processing/state, true]} \\
            \noalign{\smallskip}
            \texttt{/tracker/reset} & & Reset tracker &
            \texttt{[/tracker/reset]} \\
            \noalign{\smallskip}
            \texttt{/transport/rewind} & & Rewind the \gls{jack} transport &
            \texttt{[/transport/rewind]} \\
            \noalign{\smallskip}
            \texttt{/transport/seek} & s & Seek to time code in
            \gls{jack} transport & \texttt{[/transport/seek, “42:00:00”]} \\
            \noalign{\smallskip}
            \texttt{/transport/state} & F & Unset \gls{jack} transport
            state & \texttt{[/transport/state, false]} \\
            \noalign{\smallskip}
            \texttt{/transport/state} & T & Set \gls{jack} transport
            state & \texttt{[/transport/state, true]} \\
          \end{tabular}
          \caption{\gls{osc} messages relevant for processing, tracker and
            (\gls{jack}) transport related settings.\\
            Understood by server and clients.
          }
          \label{tab:ssr-osc-processing-tracker-transport}
        \end{table}
        \begin{table}[!htb]
          \scriptsize
          \centering
          \caption*{(Data types and their acronyms are listed in
            Table~\ref{tab:ssr-osc-data-type-acronyms}.)
          }
          \begin{tabular}{ p{4.3cm} | p{1cm} | p{2.5cm} | p{4.3cm} }
            \textbf{Path} & \textbf{Types} & \textbf{Description} &
            \textbf{Example}\\
            \hline
            \texttt{/reference/orientation} & f & Set azimuth of reference
            point & \texttt{[/reference/orientation, -90.0]} \\
            \noalign{\smallskip}
            \texttt{/reference/position} & ff & Set position of reference &
            \texttt{[/reference/position, 1.5, 2.0]} \\
            \noalign{\smallskip}
            \texttt{/reference\_offset/orientation} & f & Set azimuth of
            reference offset position &
            \texttt{[/reference\_offset/orientation, -90.0]} \\
            \noalign{\smallskip}
            \texttt{/reference\_offset/position} & ff & Set position of
            reference offset & \texttt{[/reference\_offset/position, 1.5,
            2.0]}\\
          \end{tabular}
          \caption{\gls{osc} messages relevant for reference management.\\
            Understood by server and clients.
          }
          \label{tab:ssr-osc-reference}
        \end{table}
        \begin{table}[!htb]
          \scriptsize
          \centering
          \caption*{(Data types and their acronyms are listed in
            Table~\ref{tab:ssr-osc-data-type-acronyms}.)
          }
          \begin{tabular}{ p{4.5cm} | p{0.9cm} | p{2.5cm} | p{4.3cm} }
            \textbf{Path} & \textbf{Types} & \textbf{Description} &
            \textbf{Example} \\
            \hline
            \texttt{/scene/amplitude\_reference
            \_distance} & f & Set amplitude
            reference distance. &
            \texttt{[/scene/amplitude\_reference
            \_distance, 6.0]}\\
            \noalign{\smallskip}
            \texttt{/scene/auto\_rotate\_sources} & F & Disable automatic
            rotation of sources. & \texttt{[/scene/auto\_rotate\_sources,
            false]}\\
            \noalign{\smallskip}
            \texttt{/scene/auto\_rotate\_sources} & T & Enable automatic
            rotation of sources. & \texttt{[/scene/auto\_rotate\_sources,
            true]}\\
            \noalign{\smallskip}
            \texttt{/scene/clear} & & Delete all sources &
            \texttt{[/scene/clear]}\\
            \noalign{\smallskip}
            \texttt{/scene/load} & s & Load scene from \gls{asdf} file. &
            \texttt{[/scene/load, “example.asd”]}\\
            \noalign{\smallskip}
            \texttt{/scene/save} & s & Save scene to \gls{asdf} file. &
            \texttt{[/scene/save, “example.asd”]}\\
            \noalign{\smallskip}
            \texttt{/scene/volume} & f & Set scene master volume. &
            \texttt{[/scene/volume, 0.23]}\\
          \end{tabular}
          \caption{\gls{osc} messages relevant for scene management.\\
              Understood by server and clients.
          }
          \label{tab:ssr-osc-scene}
        \end{table}
        \begin{table}[!htb]
          \scriptsize
          \centering
          \caption*{(Data types and their acronyms are listed in
            Table~\ref{tab:ssr-osc-data-type-acronyms}.)
          }
          \begin{tabular}{ p{3.5cm} | p{1.5cm} | p{2.5cm} | p{4.3cm} }
            \textbf{Path} & \textbf{Types} & \textbf{Description} &
            \textbf{Example} \\
            \hline
            \texttt{/source/delete} & i & Delete source with given id &
            \texttt{[/source/delete, 1]}\\
            \noalign{\smallskip}
            \texttt{/source/file\_channel} & ii & Set a source's file channel &
            \texttt{[/source/file\_channel, 1, 2]}\\
            \noalign{\smallskip}
            \texttt{/source/port\_name } & is & Set a source's \gls{jack} input
            port name & \texttt{[/source/port\_name, 1, “system:capture\_2”]}\\
            \noalign{\smallskip}
            \texttt{/source/gain} & if & Set a source's gain &
            \texttt{[/source/gain, 1, 0.2]}\\
            \noalign{\smallskip}
            \texttt{/source/model} & is & Set a source's model &
            \texttt{[/source/model, 1, “point”]}\\
            \noalign{\smallskip}
            \texttt{/source/mute} & iF & Unmute a source &
            \texttt{[/source/mute, 1, false]}\\
            \noalign{\smallskip}
            \texttt{/source/mute} & iT & Mute a source &
            \texttt{[/source/mute, 1, true]}\\
            \noalign{\smallskip}
            \texttt{/source/name} & is & Set a source's name &
            \texttt{[/source/name, 1, “Daisy”]}\\
            \noalign{\smallskip}
            \texttt{/source/new} & i & Create a new source stub using id &
            \texttt{[/source/new, 1]}\\
            \noalign{\smallskip}
            \texttt{/source/new} & sssffffTFF & Create a new source
            (auto-generated id) with name, model, port number, X-coordinate,
            Y-coordinate, orientation, gain, movability, orientation movability
            and mute status & \texttt{[/source/new, “Daisy”, “point”, “1”, 1.0,
            2.5, 90.0, 0.2, true, false, false]} \\
            \noalign{\smallskip}
            \texttt{/source/new} & sssffffisTFF & Create a new source
            (auto-generated id) with name, model, port number, X-coordinate,
            Y-coordinate, orientation, gain, file channel, properties file,
            movability, orientation movability and mute status &
            \texttt{[/source/new, “Daisy”, “point”, “1”, 1.0, 2.5, 90.0, 0.2,
            2, “properties.xml”, true, false, false]} \\
            \noalign{\smallskip}
            \texttt{/source/orientation} & if & Set a source's orientation &
            \texttt{[/source/orientation, 1, -90.0]}\\
            \noalign{\smallskip}
            \texttt{/source/position} & iff & Set a source's position &
            \texttt{[/source/position, 1, 1.5, 2.0]}\\
            \noalign{\smallskip}
            \texttt{/source/position\_fixed} & iF & Set a source movable &
            \texttt{[/source/position\_fixed, 1, false]}\\
            \noalign{\smallskip}
            \texttt{/source/position\_fixed} & iT & Set a source immovable &
            \texttt{[/source/position\_fixed, 1, true]}\\
            \noalign{\smallskip}
            \texttt{/source/properties\_file} & is & Set a source's properties
            file & \texttt{[/source/properties\_file, 1,
            “source-properties.xml”]}\\
        \end{tabular}
          \caption{\gls{osc} messages relevant for source management.\\
              Understood by server and clients.
          }
          \label{tab:ssr-osc-source}
        \end{table}
        \begin{table}[!htb]
          \scriptsize
          \centering
          \caption*{(Data types and their acronyms are listed in
            Table~\ref{tab:ssr-osc-data-type-acronyms}.)
          }
          \begin{tabular}{ p{6.5cm} | p{0.9cm} | p{4.3cm} }
            \textbf{Path} & \textbf{Types} & \textbf{Description} \\
            \hline
            \texttt{/update/cpu\_load} & f & CPU load changes.\\
            \noalign{\smallskip}
            \texttt{/update/processing/state} & T & Processing state is set.\\
            \noalign{\smallskip}
            \texttt{/update/processing/state} & F & Processing state is
            unset.\\
            \noalign{\smallskip}
            \texttt{/update/reference/orientation} & f & Reference orientation
            changes.\\
            \noalign{\smallskip}
            \texttt{/update/reference/position} & ff & Reference position
            changes.\\
            \noalign{\smallskip}
            \texttt{/update/reference\_offset/orientation} & f & Reference
            offset orientation changes.\\
            \noalign{\smallskip}
            \texttt{/update/reference\_offset/position} & ff & Reference offset
            position changes.\\
            \noalign{\smallskip}
            \texttt{/update/scene/amplitude\_reference\_distance} & f &
            Amplitude reference distance changes.\\
            \noalign{\smallskip}
            \texttt{/update/scene/auto\_rotate\_sources} & T & Auto rotation of
            sources is set.\\
            \noalign{\smallskip}
            \texttt{/update/scene/auto\_rotate\_sources} & F & Auto rotation of
            sources is unset.\\
            \noalign{\smallskip}
            \texttt{/update/scene/decay\_exponent} & f & The scene's decay
            exponent has changed.\\
            \noalign{\smallskip}
            \texttt{/update/scene/master\_signal\_level} & f & Master signal
            level has changed.\\
            \noalign{\smallskip}
            \texttt{/update/scene/sample\_rate} & i & Sample rate of the scene
            changed.\\
            \noalign{\smallskip}
            \texttt{/update/scene/volume} & f & Volume of the scene has
            changed.\\
            \noalign{\smallskip}
            \texttt{/update/source/delete} & i & A source with given id was
            deleted. \\
            \noalign{\smallskip}
            \texttt{/update/source/file\_channel} & ii & A source's file
            channel was set.\\
            \noalign{\smallskip}
            \texttt{/update/source/file\_name\_or\_port\_number} & is & A
            source's file name or port number was set.\\
            \noalign{\smallskip}
            \texttt{/update/source/gain} & if & A source's gain was set.\\
            \noalign{\smallskip}
            \texttt{/update/source/length} & ii & A source's length was set.\\
            \noalign{\smallskip}
            \texttt{/update/source/level} & if & A source's output level has
            changed.\\
            \noalign{\smallskip}
            \texttt{/update/source/model} & is & A source's model was set.\\
            \noalign{\smallskip}
            \texttt{/update/source/mute} & iF & A source was unmuted.\\
            \noalign{\smallskip}
            \texttt{/update/source/mute} & iT & A source was muted.\\
            \noalign{\smallskip}
            \texttt{/update/source/name} & is & A source's name was set.\\
            \noalign{\smallskip}
            \texttt{/update/source/orientation} & if & A source's orientation
            was set. \\
            \noalign{\smallskip}
            \texttt{/update/source/new} & i & A new source with given id was
            created. \\
            \noalign{\smallskip}
            \texttt{/update/source/port\_name} & is & A source's \gls{jack}
            port\_name was set. \\
            \noalign{\smallskip}
            \texttt{/update/source/position} & iff & A source's position was
            set. \\
            \noalign{\smallskip}
            \texttt{/update/source/position\_fixed} & iF & A source was set to
            be movable. \\
            \noalign{\smallskip}
            \texttt{/update/source/position\_fixed} & iT & A source was set to
            be immovable. \\
            \noalign{\smallskip}
            \texttt{/update/source/properties\_file} & is & A source's
            properties\_file was set.\\
            \noalign{\smallskip}
            \texttt{/update/transport/seek} & s & \gls{jack} transport seeked
            to a timecode position.\\
            \noalign{\smallskip}
            \texttt{/update/transport/state} & F & \gls{jack} transport was
            stopped.\\
            \noalign{\smallskip}
            \texttt{/update/transport/state} & T & \gls{jack} transport was
            started.\\
          \end{tabular}
          \caption{\gls{osc} messages for updating information on cpu load,
            processing, reference, scene, source, and transport of clients on a
            server.\\
            Understood by server.\\
            No examples are given, as they are mostly analogous to the ones in
            Table~\ref{tab:ssr-osc-processing-tracker-transport},
            Table~\ref{tab:ssr-osc-scene} and Table~\ref{tab:ssr-osc-source}.
          }
          \label{tab:ssr-osc-source}
        \end{table}

  \cleardoublepage
  \section{Discussion}
    \label{sec:discussion}
    \paragraph{Stress testing the \gls{osc} interface}
      \label{par:stress_testing_the_osc_interface}
  \cleardoublepage
    \paragraph{Implementing a NullRenderer}
      \label{par:implementing_a_nullrenderer}
      \begin{figure}[!htb]
        \centering
        \includegraphics[scale=1.0, trim = 20mm 204mm 10mm 10mm, clip]
        {ssr-client-server-clients-only-shared-output.pdf}
        \caption{A diagram displaying a \gls{ssr} client/server setup, in which
          only the clients render audio collectively (e.g.\ medium or
          large-scale \gls{wfs}). The server instance is not controlled via
          \gls{osc}, but controls its clients through it. Additionally its
          rendering engine does not have any outputs.\\
          {\color{osc-in}\textbf{--}} \gls{osc} input
          {\color{osc-out}\textbf{--}} \gls{osc} output
          {\color{audio-in}\textbf{--}} Audio input
          {\color{audio-out}\textbf{--}} Audio output
        }
        \label{fig:ssr-client-server-clients-only-shared-output}
      \end{figure}
      \begin{figure}[!htb]
        \centering
        \includegraphics[scale=1.0, trim = 20mm 204mm 10mm 10mm, clip]
        {ssr-client-server-clients-only-separate-output.pdf}
        \caption{A diagram displaying a \gls{ssr} client/server setup, in
          which only the clients render audio to separate outputs (e.g.\
          multiple \glspl{bs} renderers). The server instance is not controlled
          via \gls{osc}, but controls its clients through it. Additionally its
          rendering engine does not have any outputs.\\
          {\color{osc-in}\textbf{--}} \gls{osc} input
          {\color{osc-out}\textbf{--}} \gls{osc} output
          {\color{audio-in}\textbf{--}} Audio input
          {\color{audio-out}\textbf{--}} Audio output
        }
        \label{fig:ssr-client-server-clients-only-separate-output}
      \end{figure}
  \cleardoublepage
    \paragraph{Implementing AlienLoudspeaker}
      \label{par:implementing_alienloudspeaker}
    \paragraph{Interpolation of moving sources}
      \label{par:interpolation_of_moving_sources}

  \pagestyle{empty}
  \cleardoublepage
  \addcontentsline{toc}{section}{\listfigurename}
  \listoffigures
  \cleardoublepage
  \addcontentsline{toc}{section}{\listtablename}
  \listoftables
  \cleardoublepage
  \printindex
  \printglossaries
  \cleardoublepage
  \bibliographystyle{plainnat}
  \bibliography{../bib/ssr-networking}
\end{document}