Keep Csound open with file output
Date | 2016-06-06 13:36 |
From | Chuckk Hubbard |
Subject | Keep Csound open with file output |
Hi. I gave up on ALSA for my Raspberry Pi's audio output and modified some test code to use its I2S without creating a sound device. I'd like to send Csound output through a named pipe to this driver, and have Csound block when the named pipe is full (I will probably reduce its maximum size). Csound doesn't stay open if I have a filename as -o output. I also don't expect to be able to use -o dac because the system currently has no registered audio devices and I was hoping to avoid having that extra bloat. Thanks! -Chuckk |
Date | 2016-06-06 16:37 |
From | Victor Lazzarini |
Subject | Re: Keep Csound open with file output |
f0 360000 ? Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland
|
Date | 2016-06-06 17:03 |
From | John |
Subject | Re: Keep Csound open with file output |
Surely the problem is that without -o DAC time will race away On 6 Jun 2016, at 16:38, Victor Lazzarini <Victor.Lazzarini@NUIM.IE> wrote:
|
Date | 2016-06-06 19:18 |
From | Victor Lazzarini |
Subject | Re: Keep Csound open with file output |
One can use -+rtaudio=null which should emulate the timing of an audio card without connecting to one. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland
|
Date | 2016-06-07 10:21 |
From | Chuckk Hubbard |
Subject | Re: Keep Csound open with file output |
I tried f0 800000 with i1 0 -1, yeah, it still closed immediately. I didn't think of -+rtaudio=null... just a minute... On Mon, Jun 6, 2016 at 9:18 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
|
Date | 2016-06-07 11:34 |
From | Chuckk Hubbard |
Subject | Re: Keep Csound open with file output |
So, -+rtaudio=null doesn't do the trick, either. Even with the named pipe reduced to 8 bytes and the notes and f0 extended to 200 seconds, Csound doesn't wait. It could be that the program I'm using for RPi I2S is writing over what's in its transmit FIFO instead of adding to it, so it never registers as full, or it could be that Csound just won't stay open without -odac...? -Chuckk On Mon, Jun 6, 2016 at 9:18 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
|
Date | 2016-06-07 11:36 |
From | Victor Lazzarini |
Subject | Re: Keep Csound open with file output |
did you add -o dac? ======================== Dr Victor Lazzarini Dean of Arts, Celtic Studies and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 7 Jun 2016, at 11:34, Chuckk Hubbard |
Date | 2016-06-07 11:36 |
From | Chuckk Hubbard |
Subject | Re: Keep Csound open with file output |
Even if I don't read anything from the maximum 8 byte named pipe, Csound finishes its business and closes. "512 2048 sample blks of longs written to /tmp/audio-fifo (raw)" On Tue, Jun 7, 2016 at 1:34 PM, Chuckk Hubbard <badmuthahubbard@gmail.com> wrote:
|
Date | 2016-06-07 11:37 |
From | Chuckk Hubbard |
Subject | Re: Keep Csound open with file output |
Yes, after reading your question. It stays open, even though the system has no audio devices. Next stop: fout... On Tue, Jun 7, 2016 at 1:36 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote: did you add -o dac? |
Date | 2016-06-07 11:58 |
From | Chuckk Hubbard |
Subject | Re: Keep Csound open with file output |
Using -odac, monitor and fout, unfortunately, Csound does not block when the pipe written to by fout is full; it tells me "Csound ignoring SIGPIPE: Broken pipe". Maybe this is ultimately good, if I prefer to drop samples than to increase latency. I was hoping to avoid writing a separate program with the API, but I believe it would be trivial to do this that way, no? A C program should block on a full FIFO by default. Back to work... -Chuckk On Tue, Jun 7, 2016 at 1:37 PM, Chuckk Hubbard <badmuthahubbard@gmail.com> wrote:
|
Date | 2016-06-07 12:12 |
From | Victor Lazzarini |
Subject | Re: Keep Csound open with file output |
If you are using the API, it becomes much easier. All you need is to collect the samples from Csound and put in your open named pipe. Csound will not run away because you can control how often it calls the performKsmps() function. If you are not using the API, there is another alternative. You could try to use sockets, as Csound has UDP and TCP opcodes that you could use to write audio to a destination. regards ======================== Dr Victor Lazzarini Dean of Arts, Celtic Studies and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 7 Jun 2016, at 11:58, Chuckk Hubbard |
Date | 2016-06-07 12:55 |
From | Victor Lazzarini |
Subject | Re: Keep Csound open with file output |
Interestingly I was able to make a pipe and run csound to it, in a blocking way, from one Csound instance to another (on OSX): writer $ csound -W -o pipe oscili.csd reader $ csound -W -i pipe -o dac inout.csd I would expect it to work on linux. ======================== Dr Victor Lazzarini Dean of Arts, Celtic Studies and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 7 Jun 2016, at 12:12, Victor Lazzarini |
Date | 2016-06-07 13:04 |
From | Victor Lazzarini |
Subject | Re: Keep Csound open with file output |
Maybe it didn’t block actually. I can’t say for sure, but the writer process only starts writing once I start the reader, then it races ahead. The reader needs to have a ctl-C sent to it to start outputting audio. ======================== Dr Victor Lazzarini Dean of Arts, Celtic Studies and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 7 Jun 2016, at 12:55, Victor Lazzarini |
Date | 2016-06-07 13:08 |
From | Richard |
Subject | Re: Keep Csound open with file output |
Have you also tried this with OSC? I understood that this should be possible now, or via arrays, but I may be mixing things up... Richard On 07/06/16 14:04, Victor Lazzarini wrote: > Maybe it didn’t block actually. I can’t say for sure, but the writer process only starts writing once I start the reader, > then it races ahead. The reader needs to have a ctl-C sent to it to start outputting audio. > ======================== > Dr Victor Lazzarini > Dean of Arts, Celtic Studies and Philosophy, > Maynooth University, > Maynooth, Co Kildare, Ireland > Tel: 00 353 7086936 > Fax: 00 353 1 7086952 > >> On 7 Jun 2016, at 12:55, Victor Lazzarini |
Date | 2016-06-07 13:14 |
From | Victor Lazzarini |
Subject | Re: Keep Csound open with file output |
I am actually able to use fout for this, with the same setup as before, except that I use -f instead of -W in the reader and -odac -+rtaudio=null in the writer. Once the reader is stopped I get a broken pipe error, but otherwise it works OK. ======================== Dr Victor Lazzarini Dean of Arts, Celtic Studies and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 7 Jun 2016, at 13:08, Richard |
Date | 2016-06-07 13:21 |
From | Victor Lazzarini |
Subject | Re: Keep Csound open with file output |
and Csound runs in realtime pace. ======================== Dr Victor Lazzarini Dean of Arts, Celtic Studies and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 7 Jun 2016, at 13:14, Victor Lazzarini |
Date | 2016-06-07 13:24 |
From | Richard |
Subject | Re: Keep Csound open with file output |
Ok, but I was just curious if such a thing (audio stream) could be done now using OSC... Richard On 07/06/16 14:14, Victor Lazzarini wrote: > I am actually able to use fout for this, with the same setup as before, except that I use -f instead of -W in > the reader and -odac -+rtaudio=null in the writer. Once the reader is stopped I get a broken pipe error, > but otherwise it works OK. > > ======================== > Dr Victor Lazzarini > Dean of Arts, Celtic Studies and Philosophy, > Maynooth University, > Maynooth, Co Kildare, Ireland > Tel: 00 353 7086936 > Fax: 00 353 1 7086952 > >> On 7 Jun 2016, at 13:08, Richard |
Date | 2016-06-07 13:41 |
From | John |
Subject | Re: Keep Csound open with file output |
In principle audio can be sent via OSC but it has not been tested much On 7 Jun 2016, at 13:24, Richard <zappfinger@GMAIL.COM> wrote: Ok, but I was just curious if such a thing (audio stream) could be done |