[chuck-users] Various general questions

Robin Haberkorn robin.haberkorn at googlemail.com
Sat Mar 31 18:59:34 EDT 2012

Hi Fernando!

On 23/03/12 23:04, Fernando Lopez-Lezcano wrote:
> On 03/23/2012 02:54 PM, Spencer Salazar wrote:
>> On Fri, Mar 23, 2012 at 8:37 AM, Robin Haberkorn
>> <robin.haberkorn at googlemail.com>  wrote:
>>> 3) Is there a way to use multiple sound devices in one ChucK VM?
>>> I'm using chuck on Linux-ALSA. It seems I have to specify the
>>> dac on the command line (--dacX). This could probably be used to start
>>> one VM per soundcard and exchange audio data via netout/netin. I will
>>> try this soon.
> Quick comment: on Linux you could use Jack as the audio backend. If your
> soundcards are sample synchronous they can be concatenated into one ALSA
> virtual device and Jack can use that. Otherwise Jack (at least in
> version 1.9.x) also provides the alsa_in and alsa_out clients which can
> connect the main Jack engine to asynchronous soundcards doing resampling
> to correct for the slight differences in sampling rate.

yes, I was forgetting the difficulties in using multiple sound cards,
although I should know. Of course I don't have clock-synced sound cards.
Clock-syncing appears to be a pro-feature. For the price of two or more
sound cards that can do this, I could probably buy one professional
sound card that supports a sufficient number of input channels. I don't
necessarily need more than two output channels but I could use more than
the two input channels my built-in sound card provides. (I'd like to do
"noise music" and need to process the input of multiple contact mics, my
vinyl record player etc. It all has to be in real-time.)
Unfortunately I *really* don't have the money to buy a $500 card but I
am willing to sacrifice some audio quality and a little bit of latency,
although I'd prefer adding the noise after digitizing :-)

I was spending some time getting ChucK to work with JACK and two sound
cards. It now works more or less. Unfortunately ChucK by default
connects its output/input channels which somehow appears to prevent
working with more than two input/output channels (if I enforce more
channels using --in/--out - the number of channels displayed for the
Jack device using --probe - the correct number of channels are displayed
in the JACK connections which are properly set up according to my active
JACK patch, there aren't any ChucK error messages but I still don't hear
anything sent to any output channel).
I had to apply the patch from this post:
disabling the max-number-of-channels check and channel/port
autoconnections. It now works for me, all ports are connected by the
Jack daemon according to my Jack patch. Frankly, I don't know why this
did the trick. Any insights?
Also, occasionally there are some clicks on the alsa_out-managed sound
card (a cheap lo-fi USB model). Perhaps it would work better if it only
had to synchronize between sound cards of the same model? Getting this
to work seems like Voodoo science to me.

btw. I read that PulseAudio can aggregate sound cards as well, doing
resampling in a similar manner as Jack's alsa_in/out clients. Haven't
tried it and it would be more difficult to use with ChucK which doesn't
have a PulseAudio driver.

btw. From time to time in discussions about sound card clock drifting,
some people point out that it could be possible to sync some identical
sound cards by doing some hardware hacking (use one master sound card's
clock for several sound cards). Does anyone have any experience with
this? Is it even possible with USB sound cards?
I'd be happy to give it a try if I had some instructions.

>>> 4) regarding netout/netin. This may also be useful for integration with
>>> other applications like Pure Data. Does anyone have experience with it
>>> or details about the protocol if there is any? If not I will have a look
>>> at it as soon as I need it and write a Pure Data external if necessary.
> On Linux, if the clients are on the same physical machine they can all
> be connected together without extra latency if Jack is used by all of
> them. Easy. You can even connect machines through the network using
> netjack.

Yes, JACK appears to be well suited for this task as well. The only
downside appears to be is that all input/output channels used by chuck
must be addressed by number.


> -- Fernando
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users

More information about the chuck-users mailing list