I'm using TC since a while and most of the time everything works properly. But sometimes TC and/or SuperCollider produce some strange scratching noises.
Here is an example which produces the sounds:
d1 $
jux rev $
off (1/3) ((# voice "[4 | 3 | 1]") . (striate "[4 | 2 | 1]") . (|+ n "12")) $
n "c5'min f5'min" <| s "superfm!3"
# voice 9
# legato (irand 6)
# gain 0.8
TC runs on an Ubuntu 20.04, i7 8x1,8GHz, 18 GiB RAM machine.
Does anyone knows what could produce those sounds?
I don't hear scratchiness, but that does load my CPU quite heavily so that might be what's going on. The jux + off + striate + legato combo means at any given moment there might be hundreds of synths playing.
EDIT: Another note - one way to get layering of a lot of sounds without too much CPU is to use some kind of global effect (delay and reverb) rather than excessive legato.
maybe you're getting XRuns? open jackd from a terminal before starting supercollider so that you can see if it shows any XRun errors. You can do so by simply running:
You're right. I get xruns.
When I start the command in the terminal I get the following messages:
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
Cannot lock down 82280346 byte memory area (Cannot allocate memory)
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 32bit integer little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 32bit integer little-endian
ALSA: use 2 periods for playback
Cannot use real-time scheduling (RR/10)(1: Operation not permitted)
AcquireSelfRealTime error
After starting SC (I am using the startup script from the TC documentation) following messages arrive additionally:
JackEngine::XRun: client = SuperCollider was not finished, state = Running
JackAudioDriver::ProcessGraphAsyncMaster: Process error
When I start playing the example above the XRun messages repeat.
Are there any other ideas I can follow beside the hints @bgold gave?
in /etc/security/limits.conf.
The error messages from above disappear now when I start jackd -d alsa:
no message buffer overruns
no message buffer overruns
no message buffer overruns
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 32bit integer little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 32bit integer little-endian
ALSA: use 2 periods for playback
I tried the workaround with the reverb and delay effect. But I don't know excactly how to adjust delay, delayt, delayfb and room to achieve the classical legato sound. Maybe I have to experiment a bit more.
Another problem arrives when I add stut. Even with delay and reverb instead of legato the scratchiness comes again.
Sorry! I forgot to reply to this earlier. But basically, what yaxu said. Try different settings (specifically changing frame size and periods). Or other drivers / devices
I had some issues with a laptop previously, that would exhibit similar symptoms on the built in audio card when it was doing cpu scaling. If I set the performance profile to "Performance" instead of "Powersave" and turned off Intel Boost it stabilised the audio quality.
It sounds like you're working with a much older machine than mine though (8th gen i7) so possibly (probably) not related
I tried different configurations with jack, but whenever I played the example I got xruns.
I also upgraded to 22.04 LTS but imo the sound got worse. I have no experiences with pipewire. Do I have to do some more configurations in SuperCollider? I am using the startup script from the TC documentation.
In addition I will try to get hold of an external soundcard.
Side note, pipewire provides apis for both pulseaudio client applications, and JACK aware applications - so you can still use the same tools you are used to using to manage
Ah sorry I thought it had already switched. I'm on popos 22.04 which has pipewire for sound and is ubuntu based. Looks like the upcoming ubuntu 22.10 has it too.