I have tried to design an i2s-swtich using SN74HC157N. I can switch between inputs but it is terrible backgound noise. So bad I can hardly hear that it is music there... As source I have Raspberry Pi and it sounds good when I connect it directly to DAC.
Originally I had the GND going thru the SN74HC157N, but I saw a switch on Internet where GND had a separate line outside the SN74HC157N so I tried that. No improvement. 🙁
I also tried to feed the SN74HC157N with battery. The Raspberry still have its original power supply but will be changed in the future. As the Raspberry sounds good when I connect it directly to the DAC I am thinking the power supply is not the issue.
On the same PCB I have the analog output from the DAC. I am thinking about trying to have separate PCBs for analog and digital. One reason is to get bigger space between the digital and analog signals, but it would also be easier to place inside my preamp. Before I order those PCBs I am asking for some advice:
EDIT:
//
I forgot to say I have seen schematics with and without 10k resistors between inputs and GND. What I have drawn is without this resistor.
//
1. Have anyone used SN74HC157N for i2s-switching audio and does it work as intended? If so, any ideas why mine sound that bad?
2. Schematics seems pretty easy, but do anyone have schematics to share? (I have made my own but it is not easy to follow from a screenshot as it is now included in bigger schematics.)
3. I am planning to have 3 inputs so I have drawn the outputs from one of the SN74HC157N to the input of the next SN74HC157N. Will it be ok to put the signal thru two SN74HC157N?
4. Any other suggested solution for switching thre i2s- input signals?
Cheers from Sweden.
Originally I had the GND going thru the SN74HC157N, but I saw a switch on Internet where GND had a separate line outside the SN74HC157N so I tried that. No improvement. 🙁
I also tried to feed the SN74HC157N with battery. The Raspberry still have its original power supply but will be changed in the future. As the Raspberry sounds good when I connect it directly to the DAC I am thinking the power supply is not the issue.
On the same PCB I have the analog output from the DAC. I am thinking about trying to have separate PCBs for analog and digital. One reason is to get bigger space between the digital and analog signals, but it would also be easier to place inside my preamp. Before I order those PCBs I am asking for some advice:
EDIT:
//
I forgot to say I have seen schematics with and without 10k resistors between inputs and GND. What I have drawn is without this resistor.
//
1. Have anyone used SN74HC157N for i2s-switching audio and does it work as intended? If so, any ideas why mine sound that bad?
2. Schematics seems pretty easy, but do anyone have schematics to share? (I have made my own but it is not easy to follow from a screenshot as it is now included in bigger schematics.)
3. I am planning to have 3 inputs so I have drawn the outputs from one of the SN74HC157N to the input of the next SN74HC157N. Will it be ok to put the signal thru two SN74HC157N?
4. Any other suggested solution for switching thre i2s- input signals?
Cheers from Sweden.
Last edited:
Is it ok if you bypass the logic?
How are you synchronising the bck and wck with the master clock on the source?
Timing sync errors will cause issues unless the dac is designed to resync everything.
How are you synchronising the bck and wck with the master clock on the source?
Timing sync errors will cause issues unless the dac is designed to resync everything.
I've used 74HC157 for switching between I2S sources (S/PDIF and USB inputs) and didn't experience any problems.
Without seeing your schematic I don't know why yours would sound bad. What power supply voltage are you using?
To switch between three I2S inputs it might be better to use a couple of 4way muxes, something like 74HC153.
Without seeing your schematic I don't know why yours would sound bad. What power supply voltage are you using?
To switch between three I2S inputs it might be better to use a couple of 4way muxes, something like 74HC153.
UV101:
If I wire directly from Raspberry to DAC the preamp sounds good.
abraxalito:
I will try to clean up my schematis so I can post screenshot. 🙂 Nice to hear it worked for you. Meanwhile, here is maybe a better explanation
i2s-signals:
*I run BCK (1A/1B, out on 1Y), LRCK (2A/2B, out on 2Y)and DOUT(3A/3B, out on 3Y) from the Raspberry thru the SN74HC157N. Now when I am testing Raspberry is connected to the B-inputs. Nothing connected on the A-inputs. Y-outputs goes directly to DAC
*GND I am pulling seperatly with a wire from Raspberry to DAC.
Logic:
*VCC on SN74HC157N is connected to +5VDC. From the VCC-pin I have a 100nF to Ground/0VDC. I have tried a Raspberry Pi original power supply and a battery, no difference.
*GND on SN74HC157N is connected directly to Ground/0VDC.
*A/B is connected to the same +5VDC as VCC but thru a switch. It also have a pull-down-resistor of 220kOhm. Without a pull-down-resistor I cannot switch but I havnt tried different values of the resistor.
*G is connected to Ground/0VDC. I have tried both directly to Ground/0VDC and with a resistor.
If I wire directly from Raspberry to DAC the preamp sounds good.
abraxalito:
I will try to clean up my schematis so I can post screenshot. 🙂 Nice to hear it worked for you. Meanwhile, here is maybe a better explanation
i2s-signals:
*I run BCK (1A/1B, out on 1Y), LRCK (2A/2B, out on 2Y)and DOUT(3A/3B, out on 3Y) from the Raspberry thru the SN74HC157N. Now when I am testing Raspberry is connected to the B-inputs. Nothing connected on the A-inputs. Y-outputs goes directly to DAC
*GND I am pulling seperatly with a wire from Raspberry to DAC.
Logic:
*VCC on SN74HC157N is connected to +5VDC. From the VCC-pin I have a 100nF to Ground/0VDC. I have tried a Raspberry Pi original power supply and a battery, no difference.
*GND on SN74HC157N is connected directly to Ground/0VDC.
*A/B is connected to the same +5VDC as VCC but thru a switch. It also have a pull-down-resistor of 220kOhm. Without a pull-down-resistor I cannot switch but I havnt tried different values of the resistor.
*G is connected to Ground/0VDC. I have tried both directly to Ground/0VDC and with a resistor.
As far as I know, a 74HC* running at 5 V is not guaranteed to recognize anything below 3.5 V as a high level, so the 3.3 V from the Raspberry Pi is a bit marginal. If the DAC is meant for 3.3 V high level, the 5 V from the 74HC could blow it up.
Is ground on the 74HC157n also connected to DAC/Pi ground?
About 8 times out of 10 when I have this type of difficulty, its a ground problem - poor connection etc.
About 8 times out of 10 when I have this type of difficulty, its a ground problem - poor connection etc.
On my way to work, but this is the DAC I use:
https://www.ebay.ca/itm/144038612611
Might be stupid question, but how do I know for what voltage it is meant?
woodturner-fran:
You might have an idea there! Ground on 74HC157n is not connected to Ground on Raspberry or DAC.
It is only GND on Raspberry and DAC that are connected together.
https://www.ebay.ca/itm/144038612611
Might be stupid question, but how do I know for what voltage it is meant?
woodturner-fran:
You might have an idea there! Ground on 74HC157n is not connected to Ground on Raspberry or DAC.
It is only GND on Raspberry and DAC that are connected together.
Looking at the DAC picture it seems that it has LT1963A regulator set to 3.3V. This probably means that I2S signals should also be at 3.3V. Since 74HC157 accepts lower voltage you could try by feeding 3.3V to 74HC157.
I designed and built a 4-channel i2s switch with 74LVC125APW, operating off 3.3V supply, and it worked with no issues, up to 12.288MHz BCK at 192KHz sample rate. Did not test at higher sample rates.
PCB layout was done to minimize the physical size of the three common nodes by placing the three 74LVC125APW on opposing sides of the PCB. It is a 4-layer design.
All input and output pins of 74LVC125APW are fitted with a 47K pulldown resistor, not shown in the above.
PCB layout was done to minimize the physical size of the three common nodes by placing the three 74LVC125APW on opposing sides of the PCB. It is a 4-layer design.
All input and output pins of 74LVC125APW are fitted with a 47K pulldown resistor, not shown in the above.
I will rebuilt the circuit with 3.3v and let you know how it works. I have 5v relays at other place in the circuit so I need to separate the power lines.
Any comments about below drawing?
To not need to change the rest of the schematic, is it ok to have 3.3VDC to VCC and 5VDC to A/B?
To not need to change the rest of the schematic, is it ok to have 3.3VDC to VCC and 5VDC to A/B?
Input voltages (A/B) should not go above VCC. But weren't you using Raspberry which has 3.3V GPIO?
Any comments about below drawing?
Connecting 'Y' signals (Y indicates an output) together is going to lead to trouble when they're neither open collector nor tristate output types. On HC157 they're just normal logic outputs. If you replace your HC157s with HC125s you'll be fine with tying outputs together.
Thanks, I will look into that. As a note I only had one Y as output earlier as it felt the safest, but I saw a solution where several Y where connected. Now I know I need to watch out. 🙂Connecting 'Y' signals (Y indicates an output) together is going to lead to trouble when they're neither open collector nor tristate output types. On HC157 they're just normal logic outputs. If you replace your HC157s with HC125s you'll be fine with tying outputs together.
bohrok2610:
I do, but I have a 6-way selector that also controls 5VDC relays. If I am to use 3.3VDC "all the way" I need to redesign that part also (wich today works perfect) or add more components. I will consider it though and thanks for the input A/B should not be higher than VCC.
Maybe you could use voltage dividers to change the high level of the select signals. Or use the 74AHC logic family, it can handle voltages above the supply.
Search for txb0104. It is a simple level shifter. I've used them and they are not super-fast. For control should be fine.
I'm not sure I understand. What does 5VDC relays have to do with I2S levels? Your Raspberry has 3.3V GPIO as well as 74HC157 with 3.3V VCC and your DAC. So no need to change the relays or your selector as 5VDC is for the relay coil only.I do, but I have a 6-way selector that also controls 5VDC relays. If I am to use 3.3VDC "all the way" I need to redesign that part also (wich today works perfect) or add more components.
I am considering changing logic, but this is about how I have it now (a bit simplyfied drawn here though).I'm not sure I understand. What does 5VDC relays have to do with I2S levels? Your Raspberry has 3.3V GPIO as well as 74HC157 with 3.3V VCC and your DAC. So no need to change the relays or your selector as 5VDC is for the relay coil only.
Relay_1: RIAA
Relay_2: AUX
Relay_3: Analog from DAC
i2s: Chose i2s-input
Relay_4: Relay to control an external board for CD/DVD.
As I had 5VDC anyway for other things and to make use it does not draw to much power I made it like this. Raspberry is only one of the i2s-sources I have. I could use the 3.3v from Raspberry but then it needs to be powered on even if i listen to CD.
I am not sure I thinking correctly now, but maybe it would be easier if I used negative logic all over instead?
I was only talking about Raspberry I2S levels. What I mean is that if you make the change in post #12 that does not mean you have 5V at A/B if those are coming from Raspberry since Raspberry uses 3.3V levels on I2S/GPIO. Don't know if your other I2S sources are using 5V levels. Nowadays those are quite rare.
- Home
- Source & Line
- Digital Line Level
- I2S switch with SN74HC157N