Csound Csound-dev Csound-tekno Search About

RE: [Cs-dev] MME rtaudio plugin for Win32

Date2005-02-17 15:45
From"gogins@pipeline.com"
SubjectRE: [Cs-dev] MME rtaudio plugin for Win32
What needs to be done with rtpa.c and pa_blocking.c? If I knew what it was,
I would do it.

Original Message:
-----------------
From: Istvan Varga istvan@csounds.com
Date: Thu, 17 Feb 2005 15:40:15 +0100
To: csound-devel@lists.sourceforge.net
Subject: [Cs-dev] MME rtaudio plugin for Win32


Is anyone interested in having a port of rtwin32.c from Csound 4.24.1 ?
I thought that PortAudio should be better, but it appears from recent
posts that some people have problems with Csound5 real time audio on
Windows. A better solution would be to fix rtpa.c/pa_blocking.c, though.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-02-17 16:52
FromIstvan Varga
SubjectRe: [Cs-dev] MME rtaudio plugin for Win32
gogins@pipeline.com wrote:

> What needs to be done with rtpa.c and pa_blocking.c? If I knew what it was,
> I would do it.

I do not know, the complaints are by Art Hunkins and Dave Phillips.
The only possible problems I have with rtpa.c are:
   * it tends to hang at the end of performance under Linux (at least
     on my system); not a serious issue - can still be stopped with ^C
     - but annoying.
   * it uses some static variables; this is only a coding issue, though.
In addition, I am not sure why there is a need for a blocking I/O wrapper
when the new PortAudio API does support blocking I/O (assuming that it
is actually usable).


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-02-17 17:41
FromDave Phillips
Subject[Cs-dev] PortAudio report, Cs5 Linux
Greetings:

  I just tried using -+rtaudio=pa with the csd file appended below. Cs5 
was built with a CVS update from about two hours ago. Here's what 
happens with -odac2 (my Delta 66):

[dlphilp@localhost dlphilp]$ csound -+rtaudio=pa -odac2 -d -m0 
-M/dev/snd/midiC0D0 midi-in.csd
Localisation of messages is disabled, using default language.
JACK real-time audio module for Csound by Istvan Varga
PortAudio real-time audio module for Csound by John ffitch
ALSA real-time audio module for Csound by Istvan Varga
0dBFS level = 32767.0
time resolution is 1.248 ns
Csound version 5.00 beta (float samples) Feb 17 2005
libsndfile-1.0.11
UnifiedCSD:  midi-in.csd
STARTING FILE
Creating options
Creating orchestra
Creating /tmp/fileZJEGZy.orc (0x810e800)
Creating score
orchname:  /tmp/fileZJEGZy.orc
scorename: /tmp/fileBp0luN.sco
**** allocgen tanh to 0x40686730
**** allocated 44
rtaudio: PortAudio module enabled
orch compiler:
12 lines read
        instr   1
sorting score ...
        ... done
Csound version 5.00 beta (float samples) Feb 17 2005
midi channel 1 using instr 1
displays suppressed
0dBFS level = 32767.0
orch now loaded
audio buffered in 512 sample-frame blocks
ALSA lib pcm_hw.c:1057:(snd_pcm_hw_open) open /dev/snd/pcmC1D0c failed: 
No such device
ALSA lib pcm_hw.c:1057:(snd_pcm_hw_open) open /dev/snd/pcmC1D0p failed: 
No such device
Found 3 PortAudio devices:
Device  0: /dev/dsp
           Maximum channels in:      16
           Maximum channels out:     16
           Default sample rate:   44100.000
Device  1: Sound Blaster Live!
           Maximum channels in:       2
           Maximum channels out:      2
           Default sample rate:   44100.000
Device  2: M Audio Delta 66
           Maximum channels in:      12
           Maximum channels out:     10
           Default sample rate:   44100.000
Suggested PortAudio output latency = 0.023220 seconds.
paBlockingWriteOpen: nchnls 1 sr 44100.000000 buffer frames 1024 device 2
paBlockingWriteOpen returned -9998.                        
<------------------ ???
PortAudio error -9998: Invalid number of channels.   <----------------- ???
Failed to initialise real time audio output
inactive allocs returned to freespace
end of score.              overall amps:      0.0
           overall samples out of range:        0
0 errors in performance
Removing temporary file /tmp/fileFMtJ91 ...
Removing temporary file /tmp/fileBp0luN.sco ...
Removing temporary file /tmp/fileZJEGZy.orc ...



And here's what happens with -odac0 (my SBLive):

[dlphilp@localhost dlphilp]$ csound -+rtaudio=pa -odac0 -d -m0 
-M/dev/snd/midiC0D0 midi-in.csd
Localisation of messages is disabled, using default language.
JACK real-time audio module for Csound by Istvan Varga
PortAudio real-time audio module for Csound by John ffitch
ALSA real-time audio module for Csound by Istvan Varga
0dBFS level = 32767.0
time resolution is 1.248 ns
Csound version 5.00 beta (float samples) Feb 17 2005
libsndfile-1.0.11
UnifiedCSD:  midi-in.csd
STARTING FILE
Creating options
Creating orchestra
Creating /tmp/filelz2HGZ.orc (0x810e800)
Creating score
orchname:  /tmp/filelz2HGZ.orc
scorename: /tmp/fileta8Vig.sco
**** allocgen tanh to 0x40686730
**** allocated 44
rtaudio: PortAudio module enabled
orch compiler:
12 lines read
        instr   1
sorting score ...
        ... done
Csound version 5.00 beta (float samples) Feb 17 2005
midi channel 1 using instr 1
displays suppressed
0dBFS level = 32767.0
orch now loaded
audio buffered in 512 sample-frame blocks
ALSA lib pcm_hw.c:1057:(snd_pcm_hw_open) open /dev/snd/pcmC1D0c failed: 
No such device
ALSA lib pcm_hw.c:1057:(snd_pcm_hw_open) open /dev/snd/pcmC1D0p failed: 
No such device
Found 3 PortAudio devices:
Device  0: /dev/dsp
           Maximum channels in:      16
           Maximum channels out:     16
           Default sample rate:   44100.000
Device  1: Sound Blaster Live!
           Maximum channels in:       2
           Maximum channels out:      2
           Default sample rate:   44100.000
Device  2: M Audio Delta 66
           Maximum channels in:      12
           Maximum channels out:     10
           Default sample rate:   44100.000
Suggested PortAudio output latency = 0.023220 seconds.
paBlockingWriteOpen: nchnls 1 sr 44100.000000 buffer frames 1024 device 0
paBlockingWriteOpen returned 0.
Opened PortAudio output device 0.
writing 1024-byte blks of shorts to dac0
 (unknown)
SECTION 1:
Allocating 33060 bytes
ftable 1:
Allocating 33060 bytes
ftable 2:
Allocating 33060 bytes
ftable 3:
new alloc for instr 1:   <--- response to keypress on my CZ101
new alloc for instr 1:
Killed


It works, but latency with -+rtaudio=pa and -odac0 is on the order of 1 
second. Ouch.

I tried again with -odac:plughw:2 and latency was reduced to negligible. 
Also, Ctrl-C did not end the process cleanly, I still had to kill it by pid.

Summarizing: With -+rtaudio=pa here's what happens with my audio devices:

    -odac2   Csound complains about channels, then quits.
    -odac0   Csound runs the file, but latency is awful.
    -odac:plughw:2 Csound runs the file with very low latency
    -odac:plughw:0 ditto

Again, the system here is Red Hat 9, GCC 3.2.2, ALSA 1.04.

Best regards,

dp


; midi-in.csd
; a test file

; for Linux with ALSA audio and MIDI devices
; -odac:plughw:2 -M/dev/snd/midiC0D0 -dm6




        instr 1
iamp    ampmidi 5000
kfreq   cpsmidib
a1      oscili  iamp,kfreq,1
a2      oscili  iamp,kfreq*1.003,2
a3      oscili  iamp,kfreq*.997,3
asig    =       a1+a2+a3
kenv    linenr  1,.07,.11,.01
        out     asig*kenv
        endin



; ==============================================


f1 0 8192 10 .1 0 .2 0 0 .4 0 0 0 0 .8
f2 0 8192 10 1 0 .9 0 0 .7 0 0 0 .4
f3 0 8192 10 .5 0 .6 0 0 .3 0 0 0 .9
f0 10000
e





   


Istvan Varga wrote:

> gogins@pipeline.com wrote:
>
>> What needs to be done with rtpa.c and pa_blocking.c? If I knew what 
>> it was,
>> I would do it.
>
>
> I do not know, the complaints are by Art Hunkins and Dave Phillips.
> The only possible problems I have with rtpa.c are:
>   * it tends to hang at the end of performance under Linux (at least
>     on my system); not a serious issue - can still be stopped with ^C
>     - but annoying.
>   * it uses some static variables; this is only a coding issue, though.
> In addition, I am not sure why there is a need for a blocking I/O wrapper
> when the new PortAudio API does support blocking I/O (assuming that it
> is actually usable).
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-02-18 05:55
Fromjpff@codemist.co.uk
SubjectRe: [Cs-dev] MME rtaudio plugin for Win32
Is the use of statics in rtpa a real problem?  I suppose if one has
multiple sound cards then there may be an issue, but I rather do not
want two csounds to attempt to use realtime audio at the same time.
  Just musing......
==John ffitch


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net