[Csnd] Questions about Jack

Dear Joachim, dear list,

indeed I have currently a couple of questions regarding Jack and as you are asking for them (which I do appreciate a lot), here they are:

- what is the "Transport" button in JackCtl for and do I have to press it in order to get output - or just the "start" button to launch jack? Actually I do not get any output no matter what I do :slight_smile:
- Why does blue (current version) hang, as long Jack is active no matter if I have chosen Jack as a realtime-output device in the options or use -+rtaudio=jack in the commandline to overwrite the general blue realtime-prefereces settings? A dummy-rt-driver is chosen then, but not jack. As soon as I stop jack, blue reacts again. No sound either way...
- Why cant I choose Jack in the real-time configuration in CsoundQt0.9.6-1? If I choose Alsa, CsoundQt hangs as long as Jack is active. I do get still no output there when I specify it in the commandline-options with -odac -+rtaudio=jack. At least, CsoundQt is not hanging then while Jack is active. What am I missing?
- Is it generally possible to send 16 chnls in realtime from Csound to another application running and receive 22 chnls back from it in the same Csound-instrument, although I only have a stereo-soundcard on this machine?

I read the Csound manual and the Jack faq document but still do not get it to work. All my questions here refer to my Linux-System: Ubuntu 20.04.3 and current Version of Jack 1 (0.125.0rc1) and QjackCtl 0.5.0 installed, Csound 6.17 compiled yesterday from git.

Cheers,

Jan Jacob

sound | movement | object | space
sonic architecture | site: http://www.sonicarchitecture.de
spatial electronic composition | higher order ambisonic music

Hi Jan,
one caveat: I only work on the commandline, so I _MIGHT_ not be accurate
about a few things.

Feb 2 2022, Jan Jacob Hofmann has written:
...

- what is the "Transport" button in JackCtl for and do I have to press it in order to get output - or just the "start" button to launch jack? Actually I do not get any output no matter what I do :slight_smile:

The JACK transport is there to synchronise applications. So if you have
a DAW running as well and want to have everything in time, then you need
the transport system. If you are familiar with MIDI it's like the MIDI
transport controls like start, pause, stop and the clock to keep things
in sync. You can play without any of them.
...
One note on the whole ALSA and JACK thing. You can set up a JACK plug in
ALSA. It's not ideal, but it works. I mostly use this for realtime work.
A setup for ~/.asoundrc is at the end of this mail.

- Is it generally possible to send 16 chnls in realtime from Csound to another application running and receive 22 chnls back from it in the same Csound-instrument, although I only have a stereo-soundcard on this machine?

Yes. Within JACK a client can have as many ports as it wants (there
probably are some limits). You have to variables you can set in the
orchestra header:
nchnls = x ; Number of both input and output, if nothing else is
   ; specified
nchnls_i = y ; number of input channels

What you connect your input and output channels to is your
responsibility. You can connect multiple Csound outputs to one playback
channel of your soundcard or connect it to another application. I have
heard that you can connect ports external (with qjackctl or other
patchbays), when you set these commandline options, possibly in the
<CsOptions> block:
-odac:null -iadc:null
I haven't tested that myself.
...
Here's the setup if you want to use ALSA in Csound, but run through
JACK:
In the CSD file in the <CsOptions> block you set:
-+rtaudio=alsa

If you don't have it, you can create ~/.asoundrc . If JACK is always
running on your system, you can create
pcm.!default

Otherwise choose another name as is shown below.

# leave this name unchanged
pcm.myjack {
   type jack
   capture_ports {
     0 system:capture_1
    1 system:capture_2
   }
   playback_ports {
     0 system:playback_1
    1 system:playback_2
   }
}

# This is the device/plugin that applications shall use either
# pcm.!default tohave JACK all the time or a name of your choice
pcm.jackplay {
   type plug
   slave {
     pcm "myjack" # name of the pcm device above
   }
}
# end of snippet

HTH.

Best wishes,

Jeanette

as promised i have started a wiki page, here for csoundqt. perhaps you can have a look whether it helps: Using Jack Audio · CsoundQt/CsoundQt Wiki · GitHub

best -
  j

Thanks Jeanette and Joachim for your detailed and helpful hints. I will try it out during the next days and get back to you to report how it worked for me. If I have become an expert in the usage of Jack myself I could imagine to contribute some hints to that wonderful wiki, if I feel something should be added.

I’ll also have a closer look into the Jacko-opcodes wich were recommended to me. Right now it looks like a second way to archive my goal which is sending audio from Csound to another application (ambdec) and back via Jack.

Cheers,

Jan Jacob

sound | movement | object | space
sonic architecture | site: http://www.sonicarchitecture.de
spatial electronic composition | higher order ambisonic music

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Dear list,

there seems to be a general problem on the usage of Jack on my machine (Linux Ubuntu 20.04.3):

With Csoundqt 0.9.6-1:
- When Jack is running, I cant start Csoundqt. As soon as I quit Jack, Csoundqt launches.
- Jack is not displayed as a driver in the configuration "run" of Csoundqt. It is just Alsa, Pulse and null

With blue:
- I can choose Jack as a driver in the realtime-options, but it is replaced by a dummy at realtime performance: no sound, although jack is up and running.

@Jeanette: I have not created a .asoundrc-file yet . I seems to me very advanced and I would like to check first, If there is not a general obstacle at the connections between jack and the csound frontends. As soon as I am more advanced, I will experiment with such a file...

Cheers,

Jan Jacob

sound | movement | object | space
sonic architecture | site: http://www.sonicarchitecture.de
spatial electronic composition | higher order ambisonic music

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Dear list,

I now got back on my work on jack. Now Csound with jack-support is installed (Csound 6.17).

I could now set Alsa (Jack is now available too) in the "configure" dialog of CsoundQt like in the wiki:

https://github.com/CsoundQt/CsoundQt/wiki/Using-Jack-Audio I also set all the other options of CsoundQt and JackQtl according to that wiki.

I do still not get any realtime-output (Chownings Stia chosen for testing) but text-output of the console like this:

*** rtjack: period size (-b) must be an integer multiple of ksmpsrtaudio: JACK module enabled

Elapsed time at end of orchestra compile: real: 0.058s, CPU: 0.017s

sorting score ...

... done

Elapsed time at end of score sort: real: 0.069s, CPU: 0.027s

--Csound version 6.17 (double samples) Feb 6 2022

[commit: f5b4258794a82c99f7d85f1807c6638f2e80ccac]

sr = 48000.0, kr = 4800.000, ksmps = 10

0dBFS level = 32768.0, A4 tuning = 440.0

orch now loaded

audio buffered in 256 sample-frame blocks

reading 1024-byte blks of shorts from adc:system:capture_ (RAW)

...then the text-output stops.

Am I still missing something?

I can see the jack-ports in JackQtl.

Do I still have an asoundrc-file like Jeanette suggested to get rt-output or

is that for more particular and advanced usage than just a regular stereo-output

on the built-in soundcard of my laptop?

Best,

Jan Jacob

sound | movement | object | space
sonic architecture | site: http://www.sonicarchitecture.de
spatial electronic composition | higher order ambisonic music

Good! I think you are almost there!
Try changing ksmps to 16 or 32 - jack needs it yo be power of 2 (or integer part of its buffer size).Also check that the jack sample rate and the csd sample rate are the same. You can override the csd sr and set the system sample rate to Csound in CsoundQt options, too.
Tarmo

T, 8. veebruar 2022 18:14 Jan Jacob Hofmann <jjh@sonicarchitecture.de> kirjutas:

Dear list,

I now got back on my work on jack. Now Csound with jack-support is
installed (Csound 6.17).

I could now set Alsa (Jack is now available too) in the “configure”
dialog of CsoundQt like in the wiki:

https://github.com/CsoundQt/CsoundQt/wiki/Using-Jack-Audio I also set
all the other options of CsoundQt and JackQtl according to that wiki.

I do still not get any realtime-output (Chownings Stia chosen for
testing) but text-output of the console like this:

*** rtjack: period size (-b) must be an integer multiple of
ksmpsrtaudio: JACK module enabled

Elapsed time at end of orchestra compile: real: 0.058s, CPU: 0.017s

sorting score …

… done

Elapsed time at end of score sort: real: 0.069s, CPU: 0.027s

–Csound version 6.17 (double samples) Feb 6 2022

[commit: f5b4258794a82c99f7d85f1807c6638f2e80ccac]

sr = 48000.0, kr = 4800.000, ksmps = 10

0dBFS level = 32768.0, A4 tuning = 440.0

orch now loaded

audio buffered in 256 sample-frame blocks

reading 1024-byte blks of shorts from adc:system:capture_ (RAW)

…then the text-output stops.

Am I still missing something?

I can see the jack-ports in JackQtl.

Do I still have an asoundrc-file like Jeanette suggested to get rt-output or

is that for more particular and advanced usage than just a regular
stereo-output

on the built-in soundcard of my laptop?

Best,

Jan Jacob

sound | movement | object | space
sonic architecture | site: http://www.sonicarchitecture.de
spatial electronic composition | higher order ambisonic music

as promised i have started a wiki page, here for csoundqt. perhaps
you can have a look whether it helps:
https://github.com/CsoundQt/CsoundQt/wiki/Using-Jack-Audio

best -
j

Dear Joachim, dear list,

indeed I have currently a couple of questions regarding Jack and as
you are asking for them (which I do appreciate a lot), here they are:

  • what is the “Transport” button in JackCtl for and do I have to
    press it in order to get output - or just the “start” button to
    launch jack? Actually I do not get any output no matter what I do :slight_smile:
  • Why does blue (current version) hang, as long Jack is active no
    matter if I have chosen Jack as a realtime-output device in the
    options or use -+rtaudio=jack in the commandline to overwrite the
    general blue realtime-prefereces settings? A dummy-rt-driver is
    chosen then, but not jack. As soon as I stop jack, blue reacts again.
    No sound either way…
  • Why cant I choose Jack in the real-time configuration in
    CsoundQt0.9.6-1? If I choose Alsa, CsoundQt hangs as long as Jack is
    active. I do get still no output there when I specify it in the
    commandline-options with -odac -+rtaudio=jack. At least, CsoundQt is
    not hanging then while Jack is active. What am I missing?
  • Is it generally possible to send 16 chnls in realtime from Csound
    to another application running and receive 22 chnls back from it in
    the same Csound-instrument, although I only have a stereo-soundcard
    on this machine?

I read the Csound manual and the Jack faq document but still do not
get it to work. All my questions here refer to my Linux-System:
Ubuntu 20.04.3 and current Version of Jack 1 (0.125.0rc1) and
QjackCtl 0.5.0 installed, Csound 6.17 compiled yesterday from git.

Cheers,

Jan Jacob

sound | movement | object | space
sonic architecture | site: http://www.sonicarchitecture.de
spatial electronic composition | higher order ambisonic music

Date: Tue, 1 Feb 2022 18:24:18 +0100
From: joachim heintz<jh@JOACHIMHEINTZ.DE>
Subject: Re: Building Csound on Linux: Error message on Portaudio
while checking for the dependencies

let’s make a jack-for-csound page anywhere in the csound github wiki,
starting perhaps with your questions.

best -
joachim

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Dear Tarmo,

it works!!! Stria is playing!!! Setting ksmps to 16 really has been the last step missing.

Now that's a good start for further experiments.

Thanks to all for the help and explanations!!!

Jan Jacob

sound | movement | object | space
sonic architecture | site: http://www.sonicarchitecture.de
spatial electronic composition | higher order ambisonic music

congrats!

and please add to the wiki what you think should be added.

cheers -
  joachim

* * * done * * *

Cheers,

Jan Jacob

sound | movement | object | space
sonic architecture | site: http://www.sonicarchitecture.de
spatial electronic composition | higher order ambisonic music

excellent. i just added a note about cmake in case someone buiilds csound from sources.
best -
  joachim