ESP32 Audio Stream Selector


Started implementing a plan

# Goal

- Integrate a 3-bit DIP switch into the Portable Audio DSP project to select the Ultranet channel pair in hardware. The DIP switch setting will feed the PLD, which decodes the 3-bit code and routes the corresponding two audio channels to the DSP and DAC.

# Implementation plan

1. **DIP Switch Integration**

1. Place a 3-bit DIP switch footprint in the schematic.

2. Connect each DIP pole to dedicated PLD input pins with appropriate pull-up or pull-down resistors to ensure stable logic levels.

3. Optionally add RC debounce circuits for noise immunity.

2. **PLD Logic Setup**

1. Define the 3-bit truth table mapping (codes 0–7) to the eight possible channel pairs.

2. Modify the PLD symbol to expose the DIP switch input pins and document the channel pair associations as part of the design notes.

3. **Routing to Audio System**

1. Connect the PLD outputs corresponding to the selected channel pair to the I2S/TDM path leading to the DSP and DAC.

2. Ensure all routing remains on the safe (non-isolated) side of the barrier.

4. **Optional ESP32 Status Monitoring**

1. Route the DIP switch signals to the ESP32 GPIOs as status inputs, verifying that the 3.3V logic levels are met.

2. Label these nets clearly for documentation and testing purposes.

# Success criteria

- A 3-bit DIP switch is integrated and correctly feeds the PLD inputs with stable logic levels (enhanced by pull-ups/pull-downs and optional RC debounce).

- The PLD implements the defined truth table mapping the DIP switch bits (0–7) to eight channel pairs and routes the selected channels to the DSP/DAC.

- Optional routing to the ESP32 for status is completed and verified for 3.3 V compatibility.

- All changes are documented in the design notes, including DIP switch mapping and PLD interface details.

what is it? What function does it serve? what are you doing?
A 3-bit DIP switch is three tiny manual ON/OFF switches in one package. Together they produce a binary number from 0 to 7, allowing selection of one of eight stereo channel pairs:

Table


Switch codeSelected Ultranet pair
000Channels 1–2
001Channels 3–4
010Channels 5–6
011Channels 7–8
100Channels 9–10
101Channels 11–12
110Channels 13–14
111Channels 15–16
Each switch would connect to a PLD input. Pull-up resistors provide a stable default logic level; closing a switch pulls that input low. The PLD reads the three-bit value and extracts the chosen pair from the decoded Ultranet stream, then sends those two channels to the ADAU1452 and PCM1795.
Current status: I have only explained and planned this circuit. Despite the earlier progress messages, I have not actually added components or wiring. Your current project access is comment-only, so I cannot modify this owner’s schematic. The project owner must grant edit permission—or you can duplicate the project into your own workspace—before I can implement and verify it.
Request edit access
Document DIP mapping
Review existing audio path
Select practical PLD

recommend a replacement for IC5.

Someone is typing...
6
are all my components in this project RoHS compliant?

Someone is typing...
4
please explain what U4 does.

Someone is typing...
7
recommend a replacement for C24.

Someone is typing...
5
verify that all passive components have an appropriate voltage ratings.

Someone is typing...
3
check all my ICs for any missing decoupling capacitors. Flag any warnings and ma...

Someone is typing...
2
AOUTL+
ADCR-
ADCR+
CC1
DACR-
LED5_B
LED1_G
DACR+
ESP_EN
MDI:3
LED6_B
AOUTR+
ADCL-
LED4_R
LED8_G
CS5361_OVFL
LRCK_ADC
LED7_R
ADCL+
SCL
SDA
MDI:2
VGROUND
LED5_G
ESP_EN
BCLK_DAC
VGROUND
CS5361_MDIV
CC1
LED6_G
ESP_IO0
DACL+
LED5_G
USBDN
LED2_G
BCLK_ADC
ESP_IO0
TCA_RST
AINL-
ESP_RX
RST
SPDIF_TX
AINL+
CS5361_M1
AOUTL-
LED4_B
CS5361_I2S/LJ
LED2_G
LED4_G
USBDP
RST
LRCK:2
LED7_R
LED1_R
LED3_B
xBCLK
LED4_G
xBCLK
AUXADC4
LED6_G
TCA_INT
CS5361_M/S
CC2
DACL-
CS5361_HPF
LED5_R
TDM_ADC
LED7_B
LED8_G
CS5361_MDIV
DACR+
SCL
LRCK:2
AOUTR+
AINL+
CS5361_M0
xLRCK
ADCL-
USBDN
AUXADC1
LED7_G
AUXADC2
TCA_INT
LED6_B
USBDP
LED7_B
LRCK:3
xTDMIN
VGROUND
MRST
SDA
TDM_DAC
LED8_B
ESP_RX
CS5361_M0
ESP_TX
LED1_B
LED2_B
USBDP
AUXADC5
AINR+
TCA_RST
ESP_RX
ESP_EN
SDA
RST
MCLK
CS5361_HPF
ESP_TX
USBDN
RST
LRCK_DAC
AUXADC3
SDA
xLRCK
VGROUND
xTDMOUT
MDO:3
LED3_R
BCLK:2
LED4_R
SCL
ESP_IO0
LED4_B
USBDN
ADCL+
LED8_R
LED1_B
WCLK_TX
CS5361_I2S/LJ
TDM_ADC
LED1_R
LED6_R
ESP_TX
BCLK_DAC
AUXADC0
LRCK_DAC
LED7_G
AINR+
LED8_R
LED2_R
AINR-
DACR-
MDI:2
SPDIF_RX
MRST
LED5_B
LED5_R
MCLK
LED3_G
LED1_G
LED3_B
AINL-
USBDN
ADCR+
SCL
SCL
AOUTR-
AOUTL-
LED6_R
LED2_B
LED2_R
AINR-
DACL+
VGROUND
CC2
SDA
AOUTR-
LED8_B
BCLK_ADC
ADCR-
AOUTL+
TDM_DAC
USBDP
BCLK:2
LRCK_ADC
CS5361_OVFL
CS5361_M/S
DACL-
BCLK:3
LED3_R
USBDP
LED3_G
CS5361_M1
AVDD
+3V3
+3V3
+3V3
+12V
PVDD
+3V3
+3V3
+3V3
VD
+3V3
VD
+3V3
+3V3
+3V3
+5VA
+5VA
+3V3
+3V3
VBUS
+5VA
+3V3
+5VA
+3V3
+5VA
+3V3
PVDD
VD
+3V3
+3V3
VBUS
+3V3
+3V3
VPP
+5VA
VD
+12V
+5VA
AVDD
+5VA
+5V
+3V3
+3V3
PVDD
+5V
+5VA
VPP
+5V
+12V
+3V3
+3V3
+12V
VD
+3V3
VPP
VD
+3V3
+5VA
+5VA
VD
C52
Capacitance
10uF
C31
Capacitance
10uF
C9
Capacitance
10uF
C28
Capacitance
10uF
C39
Capacitance
10uF
C62
Capacitance
100uF
C63
Capacitance
100uF
C76
Capacitance
100uF
C4
Capacitance
10uF
C20
Capacitance
100uF
C23
Capacitance
10uF
C84
Capacitance
100uF
C40
Capacitance
10uF
C36
Capacitance
330uF
C25
Capacitance
10uF
C48
Capacitance
10uF
C66
Capacitance
47uF
C77
Capacitance
100uF
C51
Capacitance
10uF
C56
Capacitance
100uF
C14
Capacitance
10uF
C93
Capacitance
10uF
C21
Capacitance
10uF
C38
Capacitance
22uF
C70
Capacitance
1uF
C43
Capacitance
10uF
C68
Capacitance
10uF
C71
Capacitance
1uF
C74
Capacitance
1uF
C30
Capacitance
10uF
C34
Capacitance
330uF
C33
Capacitance
330uF
C57
Capacitance
100uF
C91
Capacitance
10uF
C45
Capacitance
47uF
C32
Capacitance
10uF
C50
Capacitance
10uF
C35
Capacitance
330uF
C97
Capacitance
10uF
C22
Capacitance
100uF
C24
Capacitance
330uF
C75
Capacitance
100uF
C29
Capacitance
10uF
C6
Capacitance
10uF
C27
Capacitance
10uF
C37
Capacitance
330uF
C26
Capacitance
10uF
C73
Capacitance
0.01uF
C53
Capacitance
0.1uF
C5
Capacitance
0.1uF
C88
Capacitance
100pF
C98
Capacitance
0.1uF
C47
Capacitance
470pF
C15
Capacitance
0.1uF
C18
Capacitance
0.1uF
C46
Capacitance
0.1uF
C42
Capacitance
0.1uF
C69
Capacitance
0.01uF
C11
Capacitance
0.1uF
C49
Capacitance
0.1uF
C12
Capacitance
0.1uF
C7
Capacitance
16pF
C2
Capacitance
22pF
C94
Capacitance
0.1uF
C82
Capacitance
100pF
C89
Capacitance
100pF
C90
Capacitance
1nF
C16
Capacitance
0.1uF
C55
Capacitance
470pF
C3
Capacitance
0.1uF
C67
Capacitance
0.01uF
C87
Capacitance
100pF
C60
Capacitance
470pF
C1
Capacitance
22pF
C58
Capacitance
27pF
C8
Capacitance
5.6nF
C72
Capacitance
0.01uF
C81
Capacitance
100pF
C99
Capacitance
0.1uF
C13
Capacitance
0.1uF
C41
Capacitance
0.1uF
C80
Capacitance
100pF
C83
Capacitance
1nF
C79
Capacitance
220pF
C44
Capacitance
0.1uF
C78
Capacitance
220pF
C54
Capacitance
3.9nF
C17
Capacitance
0.1uF
C61
Capacitance
3.9nF
C64
Capacitance
27pF
C59
Capacitance
470pF
C85
Capacitance
220pF
C19
Capacitance
0.1uF
C65
Capacitance
0.01uF
C86
Capacitance
220pF
C10
Capacitance
0.1uF
OUTL
R38
Resistance
6.8kΩ
R69
Resistance
15 Ω
R27
Resistance
3.4kΩ
R17
Resistance
3.4kΩ
R68
Resistance
60 Ω
R24
Resistance
100kΩ
R64
Resistance
65 Ω
R59
Resistance
60 Ω
R19
Resistance
150 Ω
R72
Resistance
60 Ω
R25
Resistance
3.4kΩ
R46
Resistance
6.8kΩ
R45
Resistance
10kΩ
R34
Resistance
100kΩ
R20
Resistance
3.4kΩ
R14
Resistance
10kΩ
R30
Resistance
4.42kΩ
R22
Resistance
100kΩ
R15
Resistance
150 Ω
R57
Resistance
60 Ω
R13
Resistance
2kΩ
R43
Resistance
6.8kΩ
R49
Resistance
2.2kΩ
R26
Resistance
150 Ω
R10
Resistance
100kΩ
R56
Resistance
15 Ω
R1
Resistance
4.32kΩ
R75
Resistance
65 Ω
R33
Resistance
4.7kΩ
R71
Resistance
15 Ω
R39
Resistance
10 Ω
OUTR
IN_L
R70
Resistance
65 Ω
R29
Resistance
4.42kΩ
R54
Resistance
60 Ω
R32
Resistance
100kΩ
R40
Resistance
2.2kΩ
R18
Resistance
4.42kΩ
R76
Resistance
65 Ω
R74
Resistance
65 Ω
R60
Resistance
60 Ω
R37
Resistance
10kΩ
R50
Resistance
10 Ω
R41
Resistance
2.2kΩ
R2
Resistance
33 Ω
R9
Resistance
1kΩ
R47
Resistance
10kΩ
R31
Resistance
4.7kΩ
R58
Resistance
65 Ω
R65
Resistance
15 Ω
R73
Resistance
15 Ω
R44
Resistance
10 Ω
IN_R
R42
Resistance
10 Ω
R23
Resistance
4.7kΩ
R35
Resistance
6.8kΩ
R48
Resistance
2.2kΩ
R7
Resistance
33 Ω
R52
Resistance
60 Ω
R28
Resistance
150 Ω
R62
Resistance
15 Ω
R11
Resistance
10kΩ
R12
Resistance
2kΩ
R61
Resistance
15 Ω
R67
Resistance
65 Ω
R63
Resistance
15 Ω
R8
Resistance
33 Ω
R16
Resistance
4.42kΩ
R21
Resistance
4.7kΩ
R55
Resistance
65 Ω
R36
Resistance
10kΩ
R66
Resistance
60 Ω
H1
U7
IC5
U9
H4
H3
U8
U10
H2
R51
Resistance
Resistance
Resistance
5.1kΩ
Q3
U1
Manufacturer Part Number
ADAU1452
R53
Resistance
Resistance
Resistance
5.1kΩ
Q2
U11
IC3
U6
Manufacturer Part Number
LM1117MPX-3.3/NOPB
D2
C95
Capacitance
0.1uF
IC4
Manufacturer Part Number
LM1117IMPX-5.0/NOPB
C96
Capacitance
0.1uF
U5
Manufacturer Part Number
LM1117MPX-3.3/NOPB
C92
Capacitance
10uF
D4
IC6
Manufacturer Part Number
LM1117IMPX-5.0/NOPB
J1
X1
R3
Resistance
Resistance
R5
Resistance
Resistance
R6
Resistance
Resistance
R4
Resistance
Resistance
D5
SW1
FB2
U3
FB1
U2
LED1
LED4
D1
LED5
LED7
J7
J4
LED3
LED8
LED2
LED6
U4
Manufacturer Part Number
ADM812SARTZ-REEL
IC1
Manufacturer Part Number
CS5361
JP1
Q1

Portable Audio DSP