Csound Csound-dev Csound-tekno Search About

[Csnd] readclock opcode broken on linux

Date2009-11-26 22:52
FromRene Djack
Subject[Csnd] readclock opcode broken on linux
Hi list,

The opcode readclock seems to be broken on linux.
The manual example readclock.csd prints always zero.

Cheers,
René

Date2009-11-26 23:07
Frombecks
Subject[Csnd] Re: readclock opcode broken on linux
On Thu, Nov 26, 2009 at 11:52 PM, Rene Djack  wrote:
> The opcode readclock seems to be broken on linux.
> The manual example readclock.csd prints always zero.

i think i can confirm:

SECTION 1:
instr 1:  i1 = 0.000
instr 1:  i1 = 0.000
instr 1:  i1 = -0.000
Score finished in csoundPerform().


Date2009-11-27 06:53
Fromjpff@cs.bath.ac.uk
Subject[Csnd] Re: readclock opcode broken on linux
readclock reads a timing clock for sections of code.  If it is used for
very small sections it will appear to be zero.  Are you sure that is not
what you are seeing?  As far as i can tell this code has not been changed
since way back.
==John ff

> Hi list,
>
> The opcode readclock seems to be broken on linux.
> The manual example readclock.csd prints always zero.
>
> Cheers,
> René
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"




Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-27 12:39
FromRene Djack
Subject[Csnd] Re: Re: readclock opcode broken on linux
Hi,
The manual page of the readclock opcode say for the example readclock.csd:

"Its output should include lines like this:
instr 1:  i1 = 0.000
instr 1: i1 = 90.000
instr 1: i1 = 180.000
"

I have duplicated 10 000 times the line "a1 oscili 10000, 440, 1" to keep Csound busy.
Still have zeros printed.

Cheers,
René
 

2009/11/27 <jpff@cs.bath.ac.uk>
readclock reads a timing clock for sections of code.  If it is used for
very small sections it will appear to be zero.  Are you sure that is not
what you are seeing?  As far as i can tell this code has not been changed
since way back.
==John ff

> Hi list,
>
> The opcode readclock seems to be broken on linux.
> The manual example readclock.csd prints always zero.
>
> Cheers,
> René
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"




Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2009-11-27 12:50
Fromjpff@cs.bath.ac.uk
Subject[Csnd] Re: readclock opcode broken on linux
OK, will take another look

> Hi,
> The manual page of the readclock opcode say for the example readclock.csd:
>
> "Its output should include lines like this:
>
> instr 1:  i1 = 0.000
> instr 1:  i1 = 90.000
> instr 1:  i1 = 180.000
>
> "
>
> I have duplicated 10 000 times the line "a1 oscili 10000, 440, 1" to keep
> Csound busy.
> Still have zeros printed.
>
> Cheers,
> René
>
>
> 2009/11/27 
>
>> readclock reads a timing clock for sections of code.  If it is used for
>> very small sections it will appear to be zero.  Are you sure that is not
>> what you are seeing?  As far as i can tell this code has not been
>> changed
>> since way back.
>> ==John ff
>>
>> > Hi list,
>> >
>> > The opcode readclock seems to be broken on linux.
>> > The manual example readclock.csd prints always zero.
>> >
>> > Cheers,
>> > René
>> >
>> > Send bugs reports to this list.
>> > To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> "unsubscribe
>> > csound"
>>
>>
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"




Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-27 14:12
Fromjpff@cs.bath.ac.uk
Subject[Csnd] Re: Re: Re: readclock opcode broken on linux
The error is not in readclock but in clockon/clockoff.  Someone has
replaced the working function to read CPU usage with a broken one with the
wrong specification, rendering the clock opcodes useless.

The problem is that it is using an API function that reports CPU in
seconds, rounded to an integer.  So either the APi needs to be fixed or
correct code needs to be inserted.

Nasty

==John ff



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-27 14:39
FromRene Djack
Subject[Csnd] Re: Re: Re: Re: readclock opcode broken on linux
Thanks,
I'm sorry i can't help !!
René


2009/11/27 <jpff@cs.bath.ac.uk>
The error is not in readclock but in clockon/clockoff.  Someone has
replaced the working function to read CPU usage with a broken one with the
wrong specification, rendering the clock opcodes useless.

The problem is that it is using an API function that reports CPU in
seconds, rounded to an integer.  So either the APi needs to be fixed or
correct code needs to be inserted.

Nasty

==John ff



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2009-11-27 15:23
Fromjpff@cs.bath.ac.uk
Subject[Csnd] Re: readclock opcode broken on linux
> The error is not in readclock but in clockon/clockoff.

Closer look says that the errror was in clockon and clockoff but it is
easily fixable -- just checked in code to CVS.

Now to find out when I messed up

==John ff




Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-06-20 13:40
Frommenno
Subject[Csnd] readclock opcode broken on linux
I still get only zeroes as output when using the example from the manual.
Does the problem still exist?
I'm using Ubuntu, csound doubles.



; Select audio/midi flags here according to platform
; Audio out   Audio in
-odac           -iadc    ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o readclock.wav -W ;;; for file output any platform



; Initialize the global variables.
sr = 44100
kr = 44100
ksmps = 1
nchnls = 1

; Instrument #1.
instr 1
  ; Start clock #1.
  clockon 1
  ; Do something that keeps Csound busy.
  a1 oscili 10000, 440, 1
  out a1
  ; Stop clock #1.
  clockoff 1
  ; Print the time accumulated in clock #1.
  i1 readclock 1
  print i1
endin



; Initialize the function tables.
; Table 1: an ordinary sine wave.
f 1 0 32768 10 1

; Play Instrument #1 for one second starting at 0:00.
i 1 0 10
; Play Instrument #1 for one second starting at 0:01.
i 1 1 1
; Play Instrument #1 for one second starting at 0:02.
i 1 2 1
e




greetings,
Menno

--
View this message in context: http://csound.1045644.n5.nabble.com/readclock-opcode-broken-on-linux-tp1115093p4506247.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-06-20 13:49
FromVictor Lazzarini
SubjectRe: [Csnd] readclock opcode broken on linux
works here on OSX.

Victor
On 20 Jun 2011, at 13:40, menno wrote:

> I still get only zeroes as output when using the example from the  
> manual.
> Does the problem still exist?
> I'm using Ubuntu, csound doubles.
>
> 
> 
> ; Select audio/midi flags here according to platform
> ; Audio out   Audio in
> -odac           -iadc    ;;;RT audio I/O
> ; For Non-realtime ouput leave only the line below:
> ; -o readclock.wav -W ;;; for file output any platform
> 
> 
>
> ; Initialize the global variables.
> sr = 44100
> kr = 44100
> ksmps = 1
> nchnls = 1
>
> ; Instrument #1.
> instr 1
>  ; Start clock #1.
>  clockon 1
>  ; Do something that keeps Csound busy.
>  a1 oscili 10000, 440, 1
>  out a1
>  ; Stop clock #1.
>  clockoff 1
>  ; Print the time accumulated in clock #1.
>  i1 readclock 1
>  print i1
> endin
> 
> 
>
> ; Initialize the function tables.
> ; Table 1: an ordinary sine wave.
> f 1 0 32768 10 1
>
> ; Play Instrument #1 for one second starting at 0:00.
> i 1 0 10
> ; Play Instrument #1 for one second starting at 0:01.
> i 1 1 1
> ; Play Instrument #1 for one second starting at 0:02.
> i 1 2 1
> e
> 
> 
>
>
> greetings,
> Menno
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/readclock-opcode-broken-on-linux-tp1115093p4506247.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"
>

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-06-20 14:51
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] readclock opcode broken on linux
In the immortal words, it works for me (OpensSuSE11.4 x86_84)

....
PortAudio: selected output device '/dev/dsp1'
writing 512-byte blks of shorts to dac
SECTION 1:
ftable 1:
new alloc for instr 1:
readclock1: 0
instr 1:  i1 = 0.000
B  0.000 ..  1.000 T  1.000 TT  1.000 M:  10000.0
readclock1: 0.01
instr 1:  i1 = 10.000
B  1.000 ..  2.000 T  2.000 TT  2.000 M:  10000.0
readclock1: 0.02
instr 1:  i1 = 20.000
B  2.000 ..  3.000 T  3.000 TT  3.000 M:  10000.0
Score finished in csoundPerform().
inactive allocs returned to freespace
end of score.              overall amps:  10000.0
           overall samples out of range:        0
0 errors in performance
Elapsed time at end of performance: real: 3.117s, CPU: 0.180s
517 512-byte soundblks of shorts written to dac



==John ff



Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-06-20 15:09
FromFrancois PINOT
SubjectRe: [Csnd] readclock opcode broken on linux
It works on my linux box (ubuntu 11.04, csound 5.13 compiled from git (Jun 9 2011))

Francois



2011/6/20 menno <nabob_cd@yahoo.com>
I still get only zeroes as output when using the example from the manual.
Does the problem still exist?
I'm using Ubuntu, csound doubles.

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
; Audio out   Audio in
-odac           -iadc    ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o readclock.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

; Initialize the global variables.
sr = 44100
kr = 44100
ksmps = 1
nchnls = 1

; Instrument #1.
instr 1
 ; Start clock #1.
 clockon 1
 ; Do something that keeps Csound busy.
 a1 oscili 10000, 440, 1
 out a1
 ; Stop clock #1.
 clockoff 1
 ; Print the time accumulated in clock #1.
 i1 readclock 1
 print i1
endin
</CsInstruments>
<CsScore>

; Initialize the function tables.
; Table 1: an ordinary sine wave.
f 1 0 32768 10 1

; Play Instrument #1 for one second starting at 0:00.
i 1 0 10
; Play Instrument #1 for one second starting at 0:01.
i 1 1 1
; Play Instrument #1 for one second starting at 0:02.
i 1 2 1
e
</CsScore>
</CsoundSynthesizer>


greetings,
Menno

--
View this message in context: http://csound.1045644.n5.nabble.com/readclock-opcode-broken-on-linux-tp1115093p4506247.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2011-06-20 18:54
Frommenno
Subject[Csnd] Re: readclock opcode broken on linux
Interesting...
this is my output - i am using jack.
I have no idea what could be wrong here. Any suggestions?

Menno


time resolution is 1000.000 ns
PortAudio real-time audio module for Csound
virtual_keyboard real time MIDI plugin for Csound
PortMIDI real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 5.13 beta (double samples) Jun 16 2011
libsndfile-1.0.21
UnifiedCSD:  /media/ManualUSB/improved examples/niks/readclock.csd
STARTING FILE
Creating options
Creating orchestra
Creating score
orchname:  /tmp/csound-FcTfk6.orc
scorename: /tmp/csound-a45mhn.sco
Loading command-line libraries:
  /usr/local/lib/libloris.so
graph init 
rtmidi: PortMIDI module enabled
RAWWAVE_PATH: /usr/local/share/csound/rawwaves/
rtaudio: JACK module enabled
orch compiler:
22 (23) lines read
	instr	1	
Elapsed time at end of orchestra compile: real: 0.002s, CPU: 0.020s
sorting score ...
	... done
Elapsed time at end of score sort: real: 0.002s, CPU: 0.020s
Csound version 5.13 beta (double samples) Jun 16 2011
sample rate overrides: esr = 48000.0000, ekr = 1500.0000, ksmps = 32
0dBFS level = 32768.0
orch now loaded
audio buffered in 256 sample-frame blocks
reading 512-byte blks of shorts from adc (RAW)
Jack: JackClient::SetupDriverSync driver sem in flush mode
Jack: JackPosixSemaphore::Connect jack_sem.1000_default_csound5
Jack: Already connected name = csound5
Jack: Clock source : system clock via clock_gettime
Jack: JackLibClient::Open name = csound5 refnum = 6
Jack: JackClient::PortRegister ref = 6 name = csound5:input1 type = 32 bit
float mono audio port_index = 41
Jack: JackClient::PortRegister ref = 6 name = csound5:output1 type = 32 bit
float mono audio port_index = 42
Jack: JackClient::Activate
Jack: JackClient::StartThread : period = 1333 computation = 0 constraint =
1333
Jack: Create non RT thread
Jack: ThreadHandler: start
Jack: JackClient::kBufferSizeCallback buffer_size = 64
Jack: JackClient::kActivateClient name = csound5 ref = 6 
writing 512-byte blks of shorts to dac
SECTION 1:
ftable 1:
Jack: JackGraphManager::RecalculateLatency port_index = 41
Jack: JackGraphManager::RecalculateLatency port_index = 42
Jack: JackGraphManager::RecalculateLatency port_index = 41
Jack: JackGraphManager::RecalculateLatency port_index = 42
new alloc for instr 1:
readclock1: 0
instr 1:  i1 = 0.000
WARNING: rtjack: xrun in real time audio
B  0.000 ..  1.000 T  1.000 TT  1.000 M:  10000.0
readclock1: 0
instr 1:  i1 = 0.000
B  1.000 ..  2.000 T  2.000 TT  2.000 M:  10000.0
readclock1: 0
instr 1:  i1 = 0.000
B  2.000 ..  3.000 T  3.000 TT  3.000 M:  10000.0
Score finished in csoundPerform().
inactive allocs returned to freespace
end of score.		   overall amps:  10000.0
	   overall samples out of range:        0
0 errors in performance
Elapsed time at end of performance: real: 3.067s, CPU: 0.050s
Jack: JackClient::Deactivate
Jack: JackClient::Deactivate res = 0
Jack: JackPosixThread::Kill
Jack: JackClient::PortUnRegister port_index = 41
Jack: JackClient::PortUnRegister port_index = 42
Jack: jack_client_close
Jack: JackClient::Close ref = 6
Jack: JackClient::Deactivate
Jack: JackSocketClientChannel::Stop
Jack: JackPosixThread::Kill
Jack: JackClientSocket::Close
Jack: JackClientSocket::Close
Jack: JackPosixSemaphore::Disconnect jack_sem.1000_default_csound5
Jack: JackLibClient::~JackLibClient
Jack: JackShmReadWritePtr1::~JackShmReadWritePtr1 5
Jack: Succeeded in unlocking 377 byte memory area
Jack: JackLibGlobals Destroy 2629220
Jack: ~JackLibGlobals
Jack: JackPosixSemaphore::Disconnect jack_sem.1000_default_system
Jack: JackPosixSemaphore::Disconnect jack_sem.1000_default_freewheel
Jack: JackPosixSemaphore::Disconnect jack_sem.1000_default_dbusapi
Jack: JackPosixSemaphore::Disconnect jack_sem.1000_default_bridge-2245
Jack: JackPosixSemaphore::Disconnect jack_sem.1000_default_claudia
Jack: JackPosixSemaphore::Disconnect jack_sem.1000_default_a2j
Jack: no message buffer overruns
Jack: JackPosixThread::Stop
Jack: ThreadHandler: exit
Jack: JackShmReadWritePtr::~JackShmReadWritePtr 1
Jack: Succeeded in unlocking 994 byte memory area
Jack: JackShmReadWritePtr::~JackShmReadWritePtr 0
Jack: Succeeded in unlocking 31783450 byte memory area
Jack: jack_client_close res = 0
563 512-byte soundblks of shorts written to dac
Removing temporary file /tmp/csound-Z1gReE.srt ...
Removing temporary file /tmp/csound-a45mhn.sco ...
Removing temporary file /tmp/csound-FcTfk6.orc ...
menno@muziek:/usr/bin$ 


--
View this message in context: http://csound.1045644.n5.nabble.com/readclock-opcode-broken-on-linux-tp1115093p4507221.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"