ZAsoundserver 

FEATURES

ZAsoundserver is a client/server software for playing, spatializing and modulating sounds on SGI IRIX machines.
ZAsoundserver comes with a server application (ZAsoundserver) which will run on a sound capable machine and a client library that is linked with the graphic applications and sends commands to the server (e.g. "play sound #", "make sound # loop", "change frequency of sound #", "move sound # there" ... ). Of course, client and server can reside on the same machine.
ZAsoundserver is very optimized in terms of CPU usage.  The (UDP) socket interface between the client and the server allows virtually undelayed sound and image synchronization which is necessary for audiovisual VR experiences.

HISTORY

ZAsoundserver has been developed at Z-A Production by Jerome Felix and David Nahon for giving sound to Is the Devil Curved ? one of the first interactive creation of Maurice Benayoun with Jean-Baptiste Barriere's sound content. It has been modified and used in The Paris/New-Delhi Tunnel and in Worldskin (a CAVE application that received the AEC 1998 Interactive Arts Golden Nica)
 

DISCLAIMER

ZAsoundserver is provided to you 'as is' without any expressed or implied warranty, or fitness for any particular purpose. In no event shall Z-A be liable for any damages resulting from the use or misuse of ZAsoundserver.
 

LICENSING

ZAsoundserver is to be free and will probably become an Open Source project.
For now, Z-A continues to develop and debug it  for its own use and makes it available to  selection of users.
During this period, we ask you to NOT give copies to people who would like to use it, but ask them to contact us.
Please give us credit if you make use of ZAsoundserver (cf. official contact info bellow)
 

INSTALLATION

  • as root unpack the archive on the client machine from /usr/local so as to create /usr/local/ZAsoundserver
  • copy (or move) the executable ZAsoundserver to the /usr/local/bin directory of the server
  • copy the example directory to a regular user account
  • edit the sample config file config.zass to fit your site settings
  • make the examples and run them

  •  
    Important : be sure that the server is owned by root.sys and is 'chmod +s'ed. It should look like :
        -rwsrwsr-x    1 root     sys       130388 May 25 23:14 ZAsoundserver*
    You may have to ask your system administrator for this privilege (one can use utils/HIGHPRI for that). This is extremely important for the sound quality.
     

    USAGE

  • General  workflow

  • Sound samples should be stored on the server machine under the directory named in the config file. Subdirectories are allowed. Sounds must be 1 channel (except for ZAss_PlayDirect(), c.f. future developments), 16-bits, and all have to be sampled at the same frequency (usually 44100 or 48000 Hz).
    On 4-channel analog machines, front speakers should be connected the lineout plug, rear ones to the headphones plug.
    Odd channels are expected to be on the left, even on the right. Run sfplay 4channel.aifc (4channel.aifc is in the util dir) to check your cabling.
     
    ch1=L1 front ch2=R1    => line out
             ^
             |

             |
    ch3=L2  rear ch4=R2    => headphones out
     

    The simplest way to start the server is to use the AUTORESTARTSERVER feature in the config file. This will make the client issue a system command of the type :
    rsh SOUNDHOST -l SERVERUSER 'SERVERPATH/SERVERNAME  SERVEROPT  >&  SERVERLOG'
    Be sure that  SERVERUSER is allowed to issue such commands (you may have to use a /etc/hosts.equiv or .rhosts file, ask your system administrator)
     
     

  • Troubleshooting

  • It is interesting to use the -t timeout option so that if the client crashes without shutting the server, it will die by itself. Warning: if your client doesn't send commands on a regular basis, don't use this feature, or the server will die for no reason. You may call ZAss_TestServer on a regular basis to keep the server alive.
    The -e option is very useful if you want to track errors during development stage. This will make the server die if for instance a filename is not correct.
    When the server dies, any further call to a ZAss_ function will return 0. If you test this value you can decide to have the client stop. In case you were using the -e option, the server log file should indicate the  reason of the error.

    Note that all ZAss_xxxxx functions returns 1 on success, 0 on failure.
     
     

  • Maximum number of sound tracks

  • Because the server creates a new thread (via sproc) for each sound track, there is a limit of 16 sound tracks that can be opened at the same time. This can be modified if necessary with the -m option. Note tat if the limit is reached, the server will die.
     
     
  • Spatialization

  • ZAsoundserver implements both angular and distance spatialization effect (see the point example)

    int ZAss_OpenFileSpat(int asound, const char* afile, const char* suffix,
        float  NotSpatialisedDist, float FullySpatialisedDist,
        float StartFadeDist, float DiseapearDist, float FadeSharpness);
     

    int ZAss_SetPosition(int asound, float x, float y);

    Depending on the value of  FadeSharpness (e.g. 2, 5 or 8) you would get a different feeling of fading effect due to distance. By playing with StartFadeDist and DiseapearDist you can set the limits of your audio fog.

    Angular spatialization may not be very pleasant when close to the sound source as it may give the impression that it suddenly jumps very quickly from one side to the other. For avoiding that, create a progressive de-spatialization zone between NotSpatialisedDist and FullySpatialisedDist.

    You can easily play with diferent sets of values in the point example by editing these parameters in the sample config file.
     
     

    TIPS

    CPU optimization :
    To reduce server CPU demand, you should consider opening a sound with the proper function : If you don't need spatialization, don't call ZAss_OpenSpat()., If you don't need to control the frequency, use a xxxNoFreqxxxx function (c.f. future developments ).
    You should also consider calling the ZAss_SetPosition or ZAss_SetVolume no too often to avoid saturating the server (even if it's not as bad as  above)
    The examples provided can serve as benchmarks to test how many sounds can be played together with what type of effect.

    Track usage:
    If you call ZAss_OpenFilexxxx(track#, ....) on a track already opened, it will be closed automatically.
    If you need to free a track, call ZAss_Stop(track#)

    ... more to come
     
     

    KNOWN BUGS and LIMITATIONS

  • Stereo mode : ZAsoundserver can be used in stereo (-c 2) . In stereo, the rear gets less power than the front in the spatialization computation. This gives a better understanding of what is in front and what is behind. Nevertheless, ZAsoundserver won't give you good results with headphones, as no head masking algorithm is implemented. Better use four loudspeakers and the quadri mode (-c 4).
  • ADAT output : We have encountered a problem when using the ZAsoundserver on an Onyx2 with digital audio option.  When outputting to the analog stereo system, there was no problem; but when using the digital ADAT output, the server was interrupted from time to time during up to a few seconds. This is something we haven't been able to debug as we have no ADAT machine here (we have worked around it by using a good old Indy). If you face this kind of problem, please get in touch with us so we can fix this.
  •  Error checking : There are a few cases when the server should signal an error and doesn't do so. This happens when the client uses an optimized version of OpenFile but calls a function that changes a parameter that shouldn't be used (e.g. setLoop, setVolume - c.f. future developments ).

  •  

    FUTURE DEVELOPMENT

  • more examples and demos
  • suppression of  ZAss_PlayDirect (which was a quick hack) and creation of ZAss_OpenFileDirect() which will also accept 2 or 4 channel sounds.
  • use of a special config keyword to reverse Left/Right channels for reversed sites.
  • ability to process live streams of sounds (instead of  files) coming from either a sound input or a socket stream.
  • more Error checking
  • 8 channel implementation with height spatialization
  • server side scheduled plays like PlayAT(trackID, delay, raise-time, sustain time, decay time)
  • OpenFilexxxxx : use ORed flags to specify what feature the server will use on a file (e.g. SPATIALIZATION | VOLUME | FREQUENCY ...)

  •  

    FAQ

    Q: The output level of my Indy is very low, headphones are almost mute.
    Q: The Speaker sliders of apanel are dimmed and the buttons in the front of the Indy are useless.
    A: You are probably running in 4-channel mode (server option -c 4). In this mode, the headphone output becomes a line output and only software can control volume (like ZAss_SetVolume). See man audio(1) for details.
     
     ...  your questions here
     
     

    CONTACT

    ZAsoundserver
    Z-A Production
    64 rue de la Folie Mericourt
    75011 Paris - FRANCE
    voice: +33 1 48 06 65 66
    fax: +33 1 48 06 48 75

    http://www.Z-A.NET/zasoundserver
    zasoundserver@Z-A.NET