Jacktrip/Soundwire Meets Server Farm: Center For Computer Research in Music and Acoustics (CCRMA) Stanford University
Jacktrip/Soundwire Meets Server Farm: Center For Computer Research in Music and Acoustics (CCRMA) Stanford University
Jacktrip/Soundwire Meets Server Farm: Center For Computer Research in Music and Acoustics (CCRMA) Stanford University
Page 95
Proceedings of the SMC 2009 - 6th Sound and Music Computing Conference, 23-25 July 2009, Porto - Portugal
buffer size, sampling rate, packet size, and packet redun- Two different but related techniques are implemented.
dancy among others, can be adjusted using this “auditory The first relies on a “smart” client which can change to a
display” mechanism. new server port number after being assigned one for exclu-
sive communication. The second uses Linux’s iptables rules
to route clients into local sockets. The former technique has
2.1 Pinging the network, acoustically
the advantage of being portable (works currently on both
The advantages of evaluating very fine-grained jitter and Linux and OS X, and should be easily portable to Windows),
packet loss using these “auditory displays” have been pre- is lightweight and doesn’t require root privileges. In turn, it
viously discussed in the literature [5]. The method consists expects its clients to change connection ports. The latter
of listening to a pitched sound in order to assess delay, jitter, technique (Linux only) requires iptables privileges but pro-
and loss. The procedure produces a tone by recirculating vides a mechanism whereby “dumb” clients (e.g., embedded
audio in the network path and thus allows for fine-grained systems) can connect to a unique IP/Port pair without any
listening of the packet flow 2 . The acronym, SoundWIRE, change to their behavior. It is also computationally more
describes the technique used in this project, sound waves expensive because the kernel has to perform a port redirect
on the Internet from real-time echoes. In principle, it uses by source IP number for every packet.
the Karplus-Strong plucked string synthesis algorithm [9]
and simply replaces string delay lines running in local host 0&(1#2'-3'-#.'%%4
5(6.(#+6-)
memory with network memory.
This technique can be extended to incorporate different- 0%6$5#7()&%#,#
$%&'()#-'87'")"#,#
sounding auditory pings using other physical models [6], but $6(('$)&6(
+$/"*4-)-5#-6%*)(*.$3378/(./
the underlying approach is the same. In the case of, e.g., a 9%&'()#:
,(#)*9/)23*%$#:$#*#$,32$%
string physical model, musicians want to tune their connec-
tion to get a sounding instrument that has the highest pos- !"#$%&'()*"#
!33*/$.*"-)-5#-6%*-#$*%$/)*)(*)12%*/$.*,(#)<
!""#$%%&'(#)*
+$#:$#*;$,32$%*.2)1*/$.*32%)$/2/5*,(#)<
sible pitch (low delay) without vibrato (jitter). Users also +,&-#('./ =
0%6$5#7()&%#
evaluation service, or a central network/mixer hub, among )26$(9)#G(6#('.#
+,$5')"#B-6D#
)>'#$%&'()#B6-#=# !"#$%&'()*+&$,&)%-&,".)1
other uses. Taking advantage of multi-core computers, it "'$"H
is possible to run concurrently hundreds of clients with un- 2&<(,%#@&D'67)
LLL
Page 96
Proceedings of the SMC 2009 - 6th Sound and Music Computing Conference, 23-25 July 2009, Porto - Portugal
stops sending packets to the well- known port and starts to this technology. By connecting to the server and “listening”
send them to its own assigned one. From then on, the whole to the path, users can tune their connection to its optimal
JackTrip process is sent to a thread pool and runs indepen- settings. As mentioned above, there’s a trade-off between
dently, in its own thread. The server is freed to wait for new latency and sound quality. In the presence of jitter/vibrato,
client requests. The thread runs until the client stops send- the local buffering has to be increased to avoid late packets,
ing packets (or the server doesn’t receive them) for a certain but at the same time we don’t want to increase it too much
amount of time. At that point a signal is emitted and the (to avoid unnecessary latency). Doing this by trial and error
server deletes the client IP/port pair from the active clients requires experience and can be frustrating for new users. If,
registry and removes the process from the thread pool. The in turn, musicians can listen and tune the connection in the
implementation is written in C++ using the Qt libraries [1] same way they tune an instrument, the setup is much faster
for networking and multithreading. and intuitive. Again the goal for the musician, is that they
The architecture that uses Linux’s iptables is similar, ex- want to tune their pitch to be as high as possible (lower la-
cept that all port determination work is on the server side, tency) with the smallest possible vibrato (jitter).
and packets are redirected to a local IP/Port pair assigned
exclusively to the client. It doesn’t need to be notified of a 4.2 Star topology connection/mixing hub
new port.
Mixing and managing a remote connection when more than
two sites are involved can be very complicated. Engineers
4 SERVER APPLICATIONS
have to deal with audio channels coming from different
4.1 Quality of Service (QoS) evaluation places (sometimes on confusingly different channels), all
with different levels. They also need to make sure local
Each connection between the client and the server recircu- audio is sent to the peer with proper gains. A solution to
lates audio and implements a Karplus-Strong string model centrally manage these types of situations designates a mas-
[9]. This configuration has been discussed in detailed pre- ter location which can mix and/or relay all the channels and
viously [6]. Figure 2 shows a basic implementation of the send them back to the respective connected peers.
algorithm. The ipsi-lateral host (which in our system corre-
sponds to the server) generates excitations (plucks or noise
bursts) that are “echoed” back from the contra-lateral host
.+'/0,#8
(the client) recirculating in a loop that includes a low-pass
filter (LPF). .+'/0,#7
)*+," &'(
!"#$%&'(
-./,0
123 !"#$%*!"#!********$%&'() 45 )*+,'-.+'/0,#1/&2/&
)'3'04#5*6
Page 97
Proceedings of the SMC 2009 - 6th Sound and Music Computing Conference, 23-25 July 2009, Porto - Portugal
the server will act as a “hub” between several locations. [2] (2009) JACK: Connecting a world of audio. [Online].
Figure 3 illustrates this for an example with three clients. Available: http://jackaudio.org/
The server can mix and re-route all the audio channels be-
tween the clients, hence allowing a multi-site performance [3] Cáceres, J.-P. and Chafe, C., “JackTrip: Under the hood
with one site acting as a master relay service and/or mixer. of an engine for network audio,” in Proceedings of Inter-
national Computer Music Conference, Montreal, 2009.
5 CONCLUSIONS AND FUTURE WORK [4] Chafe, C. and Gurevich, M., “Network time delay and
ensemble accuracy: Effects of latency, asymmetry,” in
The first decade of the 21st century evidenced a dramatic Proceedings of the AES 117th Convention, San Fran-
increase in the speed and reliability of high-speed networks. cisco, 2004.
This increase is expected to continue. We have provided a
[5] Chafe, C. and Leistikow, R., “Levels of temporal reso-
system for musicians to tune and optimize their connections
lution in sonification of network performance,” in Pro-
against a reference server in a way that lets them adapt to
ceedings of the 2001 International Conference on Audi-
their given network situation. The server can also be used
tory Display. Helsinki: ICAD, 2001.
to interconnect multiple sites with arbitrary number of chan-
nels, and be a “mixing hub” that distributes audio to all the [6] Chafe, C., Wilson, S., and Walling, D., “Physical model
locations from a central place. synthesis with application to internet acoustics,” in Pro-
Scalability in network performance is a big issue that still ceedings of the International Conference on Acoustics,
needs to be solved. Learning how to connect hundreds or Speech and Signal Processing, Orlando, 2002.
even thousands of remote locations for a global-jam ses-
sion is a pending goal. Multicast at the network layer would [7] Comer, D. E., Internetworking with TCP/IP, Vol 1,
provide a solution for a fully connected peer-to-peer mesh. 5th ed. Prentice Hall, Jul. 2005.
Clients would select from a list of peers they want to con- [8] Daw, M., “Advanced collaboration with the access
nect with, and then send just one packet via multicast (us- grid,” Ariadne, vol. 42, Jan. 2005. [Online]. Available:
ing its underlying network layer implementation). Network http://www.ariadne.ac.uk/issue42/daw/intro.html
routers and switches determine when a copy needs to be
made. AccesGrid implements this [8] for a fixed number of [9] Karplus, K. and Strong, A., “Digital synthesis of
audio channels, however this infrastructure is not yet ubiqui- Plucked-String and drum timbres,” Computer Music
tous. Furthermore, when the number of audio channels and Journal, vol. 7, no. 2, pp. 43–55, 1983.
other settings differ among the clients, a new and consistent
solution is required so that they can inter-operate. [10] Peterson, L. L. and Davie, B. S., Computer Networks: A
Scaling up and distributing physical models embedded Systems Approach, 3rd Edition, 3rd ed. Morgan Kauf-
in the network path can also serve to perform “global string mann, May 2003.
network symphonies”, where the global network becomes [11] Qiao, Z., Venkatasubramanian, R., Sun, L., and Ifea-
the instrument itself, an instrument distributed throughout chor, E., “A new buffer algorithm for speech quality im-
the world. provement in VoIP systems,” Wireless Personal Commu-
nications, vol. 45, no. 2, pp. 189–207, Apr. 2008.
6 ACKNOWLEDGMENTS
[12] Renaud, A. B., Carôt, A., and Rebelo, P., “Networked
music performance: State of the art,” in Proceedings of
This work was carried out in cooperation with Musi-
the AES 30th International Conference, Saariselkä, Fin-
cianLink, Inc. and funded by National Science Founda-
land, 2007.
tion Award Grant No. IIP-0741278 with a sub-award to
CCRMA. See the online Final Report, Technical Research [13] Stevens, W. R., Fenner, B., and Rudoff, A. M., Unix Net-
Summary. 5 Fernando Lopez-Lezcano and Carr Wilkerson work Programming, Volume 1: The Sockets Networking
from CCRMA have provided continuous assistance in the API (3rd Edition), 3rd ed. Addison-Wesley Profes-
implementation and server infrastructure setup. sional, Nov. 2003.
7 REFERENCES
Page 98