Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] sensekey

Date2006-12-12 14:55
FromMichael Gogins
SubjectRe: [Cs-dev] sensekey
These options occur in the first place because Csound maintains two internal buffers (the spout buffer that is ksmps sample frames long and another that is -b sample frames long). 

In my view the intermediate -b buffer should be removed. It would then be impossible to have inconsistent ksmps and -b, and Csound would run slightly faster also.

The sound card also has a buffer (the -B buffer) and then, on top of that, the operating system itself may or may not have a buffer. Too many buffers.

The argument to -B should also be changed to multiples of spout, with a default of 2. The possibility of inconsistent settings would then disappear.

I have never understood the rationale for the intermediate buffer. Can someone explain this? What is gained by setting ksmps small and -b bigger?

Regards,
Mike

-----Original Message-----
>From: Jonathan Murphy 
>Sent: Dec 12, 2006 1:06 AM
>To: Developer discussions 
>Subject: Re: [Cs-dev] sensekey
>
>
>The other defaults, according to the manual (CommandFlags.html) are:
>
>Linux: -b 256  -B 1024
>Mac:   -b 1024 -B 4096
>Win:   -b 4096 -B 16384
>
>It's occurred to me that this presents a conundrum.
>
>For full duplex operation, -b needs to be an integer multiple of
>ksmps. If the default ksmps is 10, then none of the other defaults are
>appropriate. However, in terms of 16-bit audio, the defaults for -b
>and -B are appropriate, and make much more sense than if they were
>geared towards a ksmps of 10. What I mean is this:
>
>sr = 44100
>ksmps = 10
>
>The user wants full duplex operation, so they set -b 100, -B 400. With
>my onboard soundcard, which uses the old but extremely common AC97
>codec, I can't use this buffer size. JACK uses the alsa api to query
>the card as to actual capabilities, and won't run with a buffer size
>indivisible by 16. This seems to me to be a simple, efficient usage of
>available resources. I suspect that what the codec really does, once the
>sample-rate and time source are set, is just to count samples, but
>that it counts them in bytes, or words, for the sake of efficiency.
>If I use the alsa plugin, it lets me get away with -B 400, but I'm
>pretty sure that what's really going on is that it's secretly changing
>the buffer size to 512, rather than failing over 400. This would
>imply, further, that csound is not going to be getting the expected
>sample-frame size from the adc, and that this is going to cause
>problems, because the real size is no longer going to be an integer
>multiple of ksmps.
>
>Does this make sense? If so, if anyone else can find the time to run
>some tests (preferably using JACK, as it's the most reliable) it would
>be really helpful in terms of being able to present accurate
>information. 
>
>If it turns out that this is in fact the case, then perhaps 
>sr = 48000
>kr = 8
>might be a better default? 
>
>Thanks in advance, and I hope that I'm wrong.
>
>Jonathan.
>
>jpff  writes:
>
>> regarding values for sr and kr, the code has defaults that were
>> determined after a net-discussion.  Current values are
>>            sr = 44100
>>            kr = 4410
>>
>> We have not discussed suitable defaults for -b and -B as far as i can remember
>> ==John ffitch
>>
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share your
>> opinions on IT & business topics through brief surveys - and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>-------------------------------------------------------------------------
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share your
>opinions on IT & business topics through brief surveys - and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-12-13 16:18
FromAnthony Kozar
SubjectRe: [Cs-dev] sensekey
This is probably not the original rationale, but there are certainly times
when you will want a more accurate kr, and thus end up with a ksmps smaller
than -b can reasonably be set.

(At least as far as I can tell, I can not set -b lower than about 1024 on my
computer and get real-time sound).

*shrug*

Anthony

Michael Gogins wrote on 12/12/06 9:55 AM:

> I have never understood the rationale for the intermediate buffer. Can someone
> explain this? What is gained by setting ksmps small and -b bigger?


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net