Hi,
I recently changed my S/PDIF interface I've been using for 2 decades for a PCI 6 ch analog audio card because the audio on this motherboard was toasted.
With several audio cards, come crackling noise. I've had a look on Amazon and even Soundblasters are plagued by this. Not wanting to test a bunch of audio cards, I sat and thought of a solution.
I could plug a noise reduction box between the PC and the AVR. Nothing fancy based on NE572 or LM1894. Simple RC divider being turned on and off with a 4066 or 4016. That sould be controlled by an Arduino Nano, reading it's data from the CamillaDSP status.
Material needed: a project box, an Arduino Nano, a USB cable, some resistors and capacitors, value to be determined experimentally, 6x 1/8 jacks and 3 stereo 1/8 audio cables, 2x 4016 or 4066 ICs.
The idea is to switch a resistor on to diminish the output going to the AVR when the CamillaDSP is paused, so the crackling is below audition level, and to remove the resistor from the circuit when CamillaDSP is running.
Arduino Nano:
PC:
Code at this stage is minimal. More to come in the next weeks.
I recently changed my S/PDIF interface I've been using for 2 decades for a PCI 6 ch analog audio card because the audio on this motherboard was toasted.
With several audio cards, come crackling noise. I've had a look on Amazon and even Soundblasters are plagued by this. Not wanting to test a bunch of audio cards, I sat and thought of a solution.
I could plug a noise reduction box between the PC and the AVR. Nothing fancy based on NE572 or LM1894. Simple RC divider being turned on and off with a 4066 or 4016. That sould be controlled by an Arduino Nano, reading it's data from the CamillaDSP status.
Material needed: a project box, an Arduino Nano, a USB cable, some resistors and capacitors, value to be determined experimentally, 6x 1/8 jacks and 3 stereo 1/8 audio cables, 2x 4016 or 4066 ICs.
The idea is to switch a resistor on to diminish the output going to the AVR when the CamillaDSP is paused, so the crackling is below audition level, and to remove the resistor from the circuit when CamillaDSP is running.
Arduino Nano:
C:
const int relayPin = 2; // Replace with the correct pin number
void setup() {
Serial.begin(9600);
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, LOW); // Ensure pin 2 starts in a known state (LOW)
}
void loop() {
if (Serial.available() > 0) {
char incomingByte = Serial.read();
if (incomingByte == '1') {
digitalWrite(relayPin, HIGH);
} else if (incomingByte == '0') {
digitalWrite(relayPin, LOW);
}
}
}
PC:
Python:
import serial
# get config
from camilladsp import CamillaClient
import sys
import time
port = 1234
cdsp = CamillaClient("127.0.0.1", port)
cdsp.connect()
# Open the serial connection to the Arduino Nano
ser = serial.Serial('COM3', 9600, timeout=1) # Replace COM3 with the correct port
while True:
# Query the CamillaDSP server for the current state
result = cdsp.query("GetState")
print(result)
# Toggle the digital pin on the Arduino Nano based on the result
if result == "Paused":
ser.write(b'1') # Send a byte to toggle the pin high
else:
ser.write(b'0') # Send a byte to toggle the pin low
# Wait for a short period before querying again
time.sleep(0.5)
Code at this stage is minimal. More to come in the next weeks.