[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Date Index][Thread Index][Author Index]

Ninjam tech writeup (very basic)



> Would one of youze guys mind doing a technical write-up on 
> this? I've done a few ninjams myself, but i'd love to hear 
> how you rigged everything for recording and web-streaming. 
> (By the way, those programs weren't all that cpu intensive, 
> as far as I remember?)

Ok, I'll do s basic description of a setup you need for ninjamming and
streaming the result to audiences. There won't be everything covered in 
this
writeup, if you got questions: ask. Do also understand that I use a Windows
platform, but the things described will also work on Lunix or Macs.

NINJAM:

Ninjam is a client/server structure, so there are two types of programs:

1. The Server. This one uses a minimum amount of CPU. it runs in text mode
and is configured with a config-file - rather old-school ;)

2. The client. This is what every participating musician needs.
There are two variants, the normal client (which I'll call Ninjam client or
short "Ninjam") and the Wasabi client (which I'll call "Wasabi"). There are
two main differences.

a) Wasabi doesn't support ASIO.
b) Ninjam doesn't output MIDI clock.

Ninjam and Wasabi puts a mediocre load on your system but is very allergic
to short CPU load spikes. So be sure to keep the average CPU load on the
machine that runs the client below 50%.

What's more of a problem is that you (or at least I) can't run both Ninjam
and Wasabi on the same machine. So if you need to use the ASIO driver 
(which
will most probably be the case) and need MIDI clock coming from the server
(which you will need if you have drum machines etc. running), then you'll
need two computers.
Be aware that the two clients will have a different deltaT with regard to
the server clock. That means that your drum machine (or other MIDI gear)
will run at exactly the same speed as your Ninjam, but with a fixed delay 
in
relation to Ninjam's metronome. This would be a problem if you play with
other people who listen to Ninjam's metronome.

Ninjam will (in its default setting) take your input and mix it with the
playing of the other participants, then output the whole thing to your 
audio
output. That means you can't multitrack-record the different musicians with
another software or outboard gear. Ninjam, Wasabi and the server allow for
multitrack recording in both ogg and wav formats.

Bandwidth requirements:
The server sends a copy of each channel from other musicians to each 
client.
The bandwidth requirement per (mono) channel is 60kbps.
This puts a serious load on the outbound bandwidth of the server for
anything with more than two participants.

A simple formula for , where:
n       number of participants
m       number of participants on the same network as the server*
l       number of channels per participant
k       bandwith requirement per channel (=60kbps)
B       the total outbound bandwidth requirement of the server

        B = k * ((n-1)*l)*(n-m)
          = J * (n-1)*(n-m) = J * (n^2 - nm - n + m)

which increases with a power of two function.

Two simple examples:

You sit at home where your server is running. You play with one guy, and 
you
both send stereo streams to each other. You get n=2, m=1, l=2 and

        B = 60kbps * 1*2*1 = 120kbps,

which you can handle with a normal low-bandwidth DSL link.

For three participants (also with stereo channels) and the server at 
another
place, you'd get n=3, m=0 and l=2 and thus

        B = 60kbps * 2 * 2 * 3 = 720kbps,

which is more than even a bigger home-use DSL can handle.

So the trick here:
        a) use mono channels where possible
        b) put as many musicians as possible on the same network with the
server
        c) keep the number of musicians low

If you got a professional link, lets say a 6Mbps with configurable setup of
in/out bandwidths (and the required inbound bandwidth of (n-m)*l), you 
could
set it to 5Mbps outbound/1Mbps inbound and accomodate a maximum of seven
participants.


STREAMING TO THE AUDIENCE:

This is done by a streaming client like oddcast or shoutcast and a server
like icecast or shoutcast. Kris has rented a server with 30 listener slots,
which we used.

The clients use a fair amount of system load (if you keep in mind to keep
your total load below 50% if you run it on the same machine as the Ninjam),
but nothing that can be handled. Outbound bandwidth depends on the rate you
configure in your streaming client and can be anything from 20kbps to
256kbps (also depending on what your server can handle).

If running everything on one computer, you only need a way to get Ninjam's
output to the streaming client's input, which will be either a software
audio patchbay or a connector from your audio interface's digital out to 
its
digital in.

Keep in mind that lots of programs (including the ones mentioned here) tend
to keep a firm hold on both a interface's outputs and input, even if only
one direction is used. So either get an interface with multi-client driver
structure or get many (at least two) interfaces (or computers).


RECORDING:

Several possible ways:
a) use Ninjam's/Wasabi's recording feature
b) use the Ninjam server's recording feature
c) use the streaming client's recording feature
d) use another software application
e) use outboard gear

For our concert, I used a combination of d) and c). With d), I recorded on
separate tracks my input, the output of Ninjam (which I configured not to
include my own playing) and the signal sent to the streaming client, thus
getting both separate tracks for the performers and a recording of the 
2bus.
c) was for safety reasons.


DISTRIBUTING LOAD:

As I mentioned before, because of the Ninjam/Wasabi problem I was forced to
use two laptops for the Ninjam thing alone. And everything else got evenly
distributed among these two. This gave me:

Laptop #2: Ninjam, Ninjam server, Kristal (multitrack audio recording) and 
a
browser to chat on our fan chat
        addon hardware: RME digiface
Laptop #3: Wasabi, Shoutcast client, Webcam software to record and a 
browser
to watch the Shoutcast server
        Terratec Phase26 (this sucks ass, as it doesn't have symmetrical
outputs), Logitec Sphere webcam

(You might ask about Laptop #1. This was the laptop that was used for
actually making the music. I'll write about the crazy setup some other
time).


ROOM FOR IMPROVEMENT:

* Ninjam vs. Wasabi: It would greatly simplify the system if there was a
Ninjam client that did both ASIO and MIDI. These clients are open-source -
any of you wanting to give it a try? ;)

* Premastering the output signal: heavy lossy audio compression affects
non-mastered signals more than those with great quality. This is something
that could be done easily - I'd just have to hook up my finalizer.

* Better second audio interface: the Phase26 is after all a consumer-style
device, and has no good outputs. I'm already looking (for other reasons) at
a RME Fireface 400...

* Using webcams for transmitting images to the audience, getting my own
server with huge amounts of bandwidth, become chief executive officer for
god...;-)


        Rainer