Details about Bergen and Snerd
"Bergen" and "Snerd" are the two software components that provide the basic Ygdrasil sound functionality. The two together are also called the "Bergen Sound Server." Snerd is the actual sound server (the application that actually plays sounds), while Bergen is a set of components that can be included in another application to communicate with Snerd over the network. All communication with Snerd takes place over the network, even if both are running on the same machine. Bergen and Snerd can be built into any application to provide networked sound playback capability, but they are most often found as part of Ygdrasil.
The Snerd Daemon
/usr/local/yg
/bin.linux/snerd
/usr/local/bergen/bin.linux/snerd
Snerd is usually launched from the RUN script. The RUN script sets environment variables to tell where snerd is located, then launches it in the background right before launching YG. After YG quits, the RUN script kills the snerd daemon before exiting completely. If YG quits or crashes and the sound keeps playing, the line
killall snerd will quit the Snerd
sound server.
Bergen, and How it Communicates with Snerd
Bergen is a library of C++ classes that control Snerd over the network. The YG sound node contains a bergen sound object which communicates with Snerd, sending it names of sample files, amplitudes, and location information. This update process happens continuously while Ygdrasil is running, sending a steady stream of data to Snerd so it can localize sounds appropriately. This data stream is sent using UDP.Using Snerd on a Remote Sound Server
Scenes with large amounts of audio can get pretty heavy, especially when combined with complex graphics. To speed things up, you can have a second computer handle the sound, so the main Ygdrasil machine can focus on simulation and graphics display. In this case, the "Sound Server" refers to the Snerd application AND to the second computer it's running on.
- set up a second linux box; let's call the main YG box "spectacle" and the sound server "euphonium".
- install Bergen on
euphonium, in/usr/local/bergen. - find out what euphonium's IP address is
- on
euphonium, go ahead and run snerd:
/usr/local/bergen/bin.linux/snerd
It doesn't print out any output. When you want to quit it, just hit CTRL-C. - Back on
spectacle, edit your RUN script. Comment out the line that launches snerd locally, and set the YG_SOUND_SERVER environment variable toeuphonium's IP address.
(c) Ben Chang