Audio output devices
Default audio device
-odac flag selects the default audio output device using the default audio driver.
Specific audio device
Specify a device by name or number:Audio input devices
Default audio input
Specific input device
Simultaneous input and output
Audio drivers
Csound supports multiple audio backend drivers. Select a driver using theRTAUDIO environment variable or the -+rtaudio flag.
Available drivers
- PortAudio (
portaudioorpa) - Cross-platform (default on most systems) - JACK (
jack) - Linux/macOS low-latency audio - ALSA (
alsa) - Linux native ALSA - CoreAudio (
auhal) - macOS native - PulseAudio (
pulse) - Linux PulseAudio - WASAPI (
wasapi) - Windows native - ASIO (
asio) - Windows low-latency (requires ASIO drivers)
Selecting a driver
PortAudio
Default on most platforms. Good cross-platform compatibility:JACK (Linux/macOS)
JACK provides professional low-latency audio routing:ALSA (Linux)
Direct ALSA access for lower latency:PulseAudio (Linux)
Use PulseAudio backend:CoreAudio (macOS)
Native macOS audio:WASAPI (Windows)
Windows native low-latency:ASIO (Windows)
For professional audio interfaces with ASIO drivers:Listing available devices
List all available audio devices:Buffer configuration
Buffer sizes directly affect latency and CPU usage.Software buffer size
The-b flag sets the software buffer in sample frames:
ksmps in the orchestra).
Hardware buffer size
The-B flag sets the hardware buffer:
Recommended buffer sizes
Buffer relationship
Typically, hardware buffer should be 2-4x the software buffer:Sample rate configuration
Override sample rate
Use system sample rate
Get system sample rate
Control rate configuration
The control rate (kr) determines how often k-rate variables update:
ksmps in the orchestra:
Channel configuration
Number of output channels
Number of input channels
Common real-time configurations
Live performance with MIDI
-M0= MIDI input from default device-odac= Audio output-b 256 -B 1024= Low latency buffers-d= Suppress displays for better performance-m0= Suppress messages
Audio input processing
Multi-channel output
JACK integration
Low-latency ALSA
Troubleshooting
Audio dropouts or glitches
- Increase buffer sizes:
-b 1024 -B 4096 - Reduce number of instruments or processing
- Use
-dto suppress displays - Enable real-time scheduling (Linux):
--sched - Reduce message level:
-m0
High latency
- Decrease buffer sizes:
-b 256 -B 1024 - Use JACK or ALSA instead of PulseAudio (Linux)
- Use ASIO instead of MME (Windows)
- Enable real-time scheduling
Device not found
List devices and use exact name:Sample rate mismatch
Match Csound’s sample rate to device:Permission denied (Linux)
Add user to audio group:Real-time scheduling (Linux)
For lowest latency, enable real-time priority:- Must suppress displays (
-d) - Must use real-time audio (
-odacor-iadc) - May require system permissions
/etc/security/limits.conf: