Skip to content

Instantly share code, notes, and snippets.

@fxadecimal
Last active April 23, 2025 15:53
Show Gist options
  • Save fxadecimal/242e08b9de93d69fa2dccea5d4b0f19b to your computer and use it in GitHub Desktop.
Save fxadecimal/242e08b9de93d69fa2dccea5d4b0f19b to your computer and use it in GitHub Desktop.
IQaudIO Pi-DAC+ setup and test on PI 4 B

IQaudIO Pi-DAC+

https://www.abacus-electronics.de/media/catalog/product/cache/9c3a2daba5047ee8e854883f2a48c941/p/i/pi-dac.jpg

Setup

1. Modify PI Config.txt

sudo nano /boot/firmware/config.txt

# modify the config.txt
dtparam=audio=off
dtoverlay=iqaudio-dacplus
# save and quit

sudo reboot

2. Test and check DAC

#list dacs:
aplay -l

# select dac: iqaudio-dacplus
# hit f6 and select dac
alsamixer

# play sample sound
aplay /usr/share/sounds/alsa/Front_Center.wav

3. Signal Generator

# install play command via sox
sudo apt install sox

play -n synth [seconds] [waveform] [frequency]

# play 1000hz sine for 5 seconds
play -n synth 5 sine 1000

# play 500hz sawtooth continuously
play -n synth 0 sawtooth 500

Mixing waveforms:

# Mix a 440Hz sine wave and a 660Hz sine wave for 5 seconds
sox -m -n synth 5 sine 440 -n synth 5 sine 660 -d

# sox: The main command.
# -m: Specifies mixing the inputs.
# -n: Creates a null input (needed for synth).
# synth 5 sine 440: Generates the first 5-second, 440Hz sine wave.
# -n synth 5 sine 660: Generates the second 5-second, 660Hz sine wave.
# -d: Sends the mixed output to the default audio device.
Waveform Command
Sine sine 1000
Square square 440
Triangle triangle 200
Sawtooth sawtooth 1500
White noise synth 5 whitenoise
Pink noise synth 5 pinknoise

Links

https://www.abacus-electronics.de/iqaudio-pidac.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment