16 channel PC audio switch with volume control - Page 1
Forum section: electronics / beginners

author: nemail2
author_rank: Regular Contributor
timestamp: August 16, 2023, 09:06:10 am
content: Hi,I have a ton of retro computers which I want to connect to a single pair of speakers. Since every computer outputs a different volume level, I would like to also have a volume knob per input.So basically I need a DJ mixerI would like to build a device by myself since I haven't found anything similar to buy (which isn't catastrophically expensive), but while being an electronics hobbyist for a while, I haven't touched ANY audio stuff ever.So I have no idea where to start at. Do I need volume control ICs, do I need a set of amplifiers? Does something like an audio router IC exist? How costly are these things?As for the human interface, while taking up much space, I think I'd like to have a real knob per stereo channel, whether they are potentiometers or optical encoders doesn't matter for me, as long as the volume level can be stored in an MCU if I go for optical encoders.Regarding the audio switching between channels, I think it may be more cost effective to do it digitally and have one or multiple digital buttons to switch between input channels, but if viable, I can go with analog button switches which electrically connect/disconnect the inputs with the one output as well.In the "backend", if needed, I can make use of any microcontroller which is supported by the Arduino framework, but I'd prefer the good old Atmega328p, if possible.Price target wise the device shouldn't be too expensive and I do not want to go crazy with it (it should just "work good enough" but I'm willing to pay a bit more to save a ton of time, if such an opportunity would arise.Audio performance:- it shouldn't damage anything- cracks and pops while changing volume or switching inputs are OK, if not excessive and if nothing gets damaged- audio quality while nothing is being touched should be "ok", no high performance needed, since I'll only be playing audio from retro computers for shits and giggles (aka old games and so on).Any advices anyone where to start and where to look at?Thanks

author: ledtester
author_rank: Super Contributor
timestamp: August 16, 2023, 01:20:01 pm
content: A simple approach would be to just use relays but there might be some pops and crackles when you do the switching.This project uses photo-MOSFETs:https://hackaday.com/2015/11/02/escape-cable-hell-with-a-multi-io-audio-multiplexer/For volume control you could use dual ganged potentiometers which is just two pots controlled by a single knob.Analog multiplexers such as the CD4051/2/3 and related ICs have been used to create audio switches although more modern parts are available. This approach will require more supporting parts. Here's a page with some circuit ideas:https://www.neatcircuits.com/audiosw/index.htmlIf you search for "4052 audio switch" you'll find it is widely discussed on audio forums like diyaudio.com.Example of using a 4051 as a switch selector between various mono audio inputs taken from the Hafler 915 pre-amp schematic. Note the use of +/- 9V supplies.https://manualsdump.com/en/manuals/hafler-915model-0915p/14426/20

author: wasedadoc
author_rank: Super Contributor
timestamp: August 16, 2023, 01:44:25 pm
content: You do not need a mixer unless you want to hear more than one computer at a time.Do you just want the "volume controls" to be presets which you ideally set just once for each source to equalize their levels? Or do you need to regularly adjust them as user controls?I would wire the inputs directly to the pots. Take the 16 pairs of sliders to 16 or 32 relays. (Depends if they have single or dual contacts.) If you need a bit of gain put one pair of op-amps after the relays.

author: themadhippy
author_rank: Super Contributor
timestamp: August 16, 2023, 02:11:00 pm
content: simplest way would be a 16 way 2 pole switch

author: Doctorandus_P
author_rank: Super Contributor
timestamp: August 16, 2023, 02:26:43 pm
content: If you want individual volume control for each channel, then the dedicated volume IC's are an easy way to go. A chip like the good old PGA2311 has excellent sound quality and is easily controlled by a microcontroller. It is not the cheapest though, but I think it's the best. Other IC's I've seen have lower dynamic performance and more noise, but they can have multiple channels in a single IC and are cheaper. (or is that "less expensive", "lower in cost". meh...)The audio of multiple channels can be easily mixed with a few resistors and an opamp.https://duckduckgo.com/?q=summing+amplifier+opamp&ia=webThe way you set scope channels with a push button per channel and a single rotary encoder is an option. What does a "ton" of retro computers mean. Is that 1000 of them?Also, once you got your Volume IC's setup with a uC and a rotary button, then the final configuration and how many encoders you want to use is just a few extra lines of code and a bit more soldering. So you can easily make a temporary setup to see what you like best. Using a bunch of potentiometers vor the user interface and the ADC of a uC can also work, but I would add a LED and a mute button (or similar) for each channel.

author: tooki
author_rank: Super Contributor
timestamp: August 16, 2023, 02:31:50 pm
content: Quote from: themadhippy on August 16, 2023, 02:11:00 pmAny source for such a beast that isn’t a >$100 custom-ordered part?

author: themadhippy
author_rank: Super Contributor
timestamp: August 16, 2023, 03:01:11 pm
content: QuoteDidnt say it was the cheapest. ok its 23 way,so room future expansion ,but a bit less than $100 even with added p+p and taxes.https://www.hificollective.co.uk/catalog/audio-note-stereo-wafer-switch-p-1406.html

author: tychob
author_rank: Contributor
timestamp: August 16, 2023, 03:23:02 pm
content: How about a pure analogue active mixer circuithttps://sound-au.com/articles/audio-mixing.htm#s3?You'll need 16 audio taper potentiometers, and 16 switches (for mute), but other than that its pretty simple.

author: EPAIII
author_rank: Super Contributor
timestamp: August 17, 2023, 06:28:32 am
content: I worked in TV engineering in the US for all my career and there were times when I needed to construct things like audio mixers. And they needed to meet "broadcast standards".I found that I was able to make such equipment with standard, off the shelf OP amps like the venerable 741. Yes, the 741, which many here will just laugh at. But it was EASILY capable of functioning at every stage of an audio mixer, from the pre-amp at the input, through the line level stages, the mixing stages, and even the output stages where a balanced, 600 Ohm (actually lower impedance) line was required. I will confess that I did like to use an FET based OP amp for the input stage.Today there are far better OP amps available and they can be employed in much the same manner to construct very capable, analog audio circuits. I would start with a dual, tracking LINEAR power supply producing +12 and -12 Volts with ground between them. I emphasized "LINEAR" because I don't like switching supplies for audio, but that's me. Then find the best OP amps for each stage of the mixer and design using standard OP amp circuits with them. I would include a variable gain at the input stage of a stage between that and the mixing buss so that levels can be matched. A reference like the Op Amp Cookbook by Jung should provide you with just about all you need to know except the latest chip numbers.https://www.google.com/search?q=op+amp+cookbook+jung+pdf&client=firefox-b-1-d&sca_esv=557690181&channel=fen&sxsrf=AB5stBgBbfbFE9nyXGa300t0oMyEKXkwZQ%3A1692250138473&ei=GrDdZJDDHNa6qtsPrJOmgAU&oq=OP+amp+cook+&gs_lp=Egxnd3Mtd2l6LXNlcnAaAhgCIgxPUCBhbXAgY29vayAqAggCMgcQABiABBgKMgcQABiABBgKMgcQABiABBgKSKJcUK8TWLY_cAN4AZABAJgBpwGgAbMKqgEDOS40uAEByAEA-AEBwgIKEAAYRxjWBBiwA8ICChAAGIoFGLADGEPCAggQLhixAxiABMICERAuGIAEGLEDGIMBGMcBGNEDwgILEAAYgAQYsQMYgwHCAg4QLhiABBixAxjHARjRA8ICCBAAGIAEGLEDwgILEC4YigUYsQMYgwHCAhcQLhixAxiABBiXBRjcBBjeBBjgBNgBAcICBxAjGIoFGCfCAgcQABiKBRhDwgITEC4YigUYsQMYgwEYxwEY0QMYQ8ICCxAAGIoFGLEDGIMBwgILEC4YgAQYxwEYrwHCAg4QABiKBRixAxiDARiRAsICCxAuGIAEGMcBGNEDwgIFEC4YgATCAgUQABiABMICCBAuGIAEGOUEwgIIEAAYgAQYiwPCAhEQLhiABBjlBBiLAxioAxigA8ICBhAAGBYYHuIDBBgAIEGIBgGQBgq6BgYIARABGBQ&sclient=gws-wiz-serp

author: nemail2
author_rank: Regular Contributor
timestamp: August 17, 2023, 07:48:42 pm
content: Thank you all for the great suggestions, I'll answer some questions:Quote from: ledtester on August 16, 2023, 01:20:01 pmIf easily doable, I'd prefer transistors for switching, I assume that'd be lower everything (power consumption, wear, noise, ...).The hackaday project looks very interesting but also the CD4051/2/3 looks tempting.Quote from: wasedadoc on August 16, 2023, 01:44:25 pmright, I just want the volume control per PC but ideally it should be relatively easily adjustable, since volume levels may change when I swap sound cards or whatever.16 pairs of sliders and 16/32 relays sounds rather space consuming and expensive thoQuote from: themadhippy on August 16, 2023, 03:01:11 pmI had that planned at some point in time but that alone wouldn't allow me to change the voltage - which admittedly wouldn't be a mandatory feature, but very nice to have.Also, I didn't know where to get switches like that. The price is affordable, considering it is a one time thing and considering the cost of different possible solutions.Quote from: tychob on August 16, 2023, 03:23:02 pm16 pots and 16 switches sounds rather expensive as well... but I'll consider it.Quote from: EPAIII on August 17, 2023, 06:28:32 amWhile your suggestions sounds very promising, I'm afraid I won't be able to build a device like that without further extensive studies.bottom line:Again thank you for all your suggestions, I'll read any further ideas/posts and I gues no matter what route I choose, I'll have to read and learn a bit more about the topic. I understand absolutely nothing when it comes to terms like pre-amp, line level stages, output stages, x impedance loads and where you can put which loads and where not and what would happen if you do, and so on.Basically I have a pair of active cheap-ass logitech PC speakers, then there are currently ten, potentially more retro PCs with sound cards (some of them give a louder output than the others) and I want to be able to switch between them ideally with the press of a button + adjust (permanently) the voltage of a selected channel via a knob. the device should not be too bulky nor way to expensive (i guess up to 100EUR/USD would be ok).I appreciate all the input and help and I absolutely understand that nobody will design that thing for me as a turn-key solution so I'll now return to the drawing board and try to come up with something which I'll then come back with to all of you to discuss it further :-)

author: switchabl
author_rank: Frequent Contributor
timestamp: August 17, 2023, 08:07:10 pm
content: Quote from: nemail2 on August 17, 2023, 07:48:42 pmIf you can find a copy of "Small Signal Audio Design" by Douglas Self that should answer many of the questions that you probably have right now (and some you didn't know to ask). It also discusses different approaches to signal switching, mixing and volume control, along with their (dis)advantages.

author: mariush
author_rank: Super Contributor
timestamp: August 17, 2023, 09:36:33 pm
content: You can get encoders that output a value as a binary value, for example 16 positions with detents, and each position has a unique 4 bit code.Here's an example :https://www.digikey.com/en/products/detail/panasonic-electronic-components/EVQ-V9C00116E/1738883So you could use parallel to serial register chips to save IO pins on a microcontroller, you just read the position of all 16 encoders in one shot by reading 8 bytes from the parallel to serial shift registers. If there's a change, you know which way the encoder was turned and apply the new volume if needed, maybe have 16 leds around the encoder to visually see the volume level for each channel all the time so you can use a led driver or two to control the 16 pots x 16 ledsIf you need only one input to be active at a time, you could just use analogue switches, no need for relaysThere's cheap volume control chips like LM1971 :https://www.digikey.com/en/products/detail/texas-instruments/LM1971MX-NOPB/366746- has mute and volume control from 0 to 62 in 1 stepsOr the newer fancier better LM1972, around 4.5$ each :https://www.digikey.com/en/products/detail/texas-instruments/LM1972MX-NOPB/366747Or you could maybe save some money by using a chip with 4 independent channels, ex Rohm BD3464FV-E2https://www.digikey.com/en/products/detail/rohm-semiconductor/BD3464FV-E2/5720878BD3465 is like the BD3464 but also has some kind of audio mixer functionality, may be possible to use it to mix 3 inputs into a 4th or something like that. See datasheet forhttps://www.digikey.com/en/products/detail/rohm-semiconductor/BD3465FV-E2/10444648BD34602FS-M can do 6 channels, independent control on each, some kind of mixing like the previous, but it starts to get expensive at 9$ a piece :https://www.digikey.com/en/products/detail/rohm-semiconductor/BD34602FS-ME2/10249240For switching between channels, maybe chips like NX3L4051PW would work :https://www.digikey.com/en/products/detail/nxp-usa-inc/NX3L4051PW-Q100J/4020464It's 8 to 1 , but you could use 2 for the first group of 8, 2 for the second group of 8 , then another one to switch between groups.ISL84781IRZ / MAX4781 would probably also work, but they're more expensive at $4-$6 a piece.

author: Nominal Animal
author_rank: Super Contributor
timestamp: August 17, 2023, 09:47:44 pm
content: You can get 16 Alps RK12L12C0C0P volume potentiometers (dual 5kΩ audio taper) from Mouser for just over 20€ total.The thing that worries me is ground loops. Your setup is bound to have some, methinks.Which is why I wonder if you could just add a BT audio transmitter like KCX_BT_EMITTER to each audio source (seehere), and do all the selection and mixing digitally on your PC, or a dedicated SBC or high-power MCU with BT that you connect your speakers to. 32 audio channels is on the order of 40 Mbit/s data stream (1.5 Msps), which should not be a burden on even a Raspberry Pi class SBCs. Plus, you can then do digital recordings of the audio, and if desired, pair any of the BT audio sources temporarily to other devices, for example if you decide to record some of the audio at some point.I don't know what kind of cheap BT audio transmitter dongles are available at the usual suspects; there might already be something you could use as-is.

author: themadhippy
author_rank: Super Contributor
timestamp: August 17, 2023, 09:49:53 pm
content: cant you just set the master volume on the individual pc's to level match?

author: Nominal Animal
author_rank: Super Contributor
timestamp: August 17, 2023, 09:50:40 pm
content: Quote from: themadhippy on August 17, 2023, 09:49:53 pmRetro computers don't have that.

author: abeyer
author_rank: Frequent Contributor
timestamp: August 17, 2023, 10:02:29 pm
content: Quote from: nemail2 on August 16, 2023, 09:06:10 amHave you really looked? I've seen 16+ channel berhinger mixers on ebay well under $100. Technically a mixer might be overkill, but it's a much more common item than an off-the-shelf switch with separate volume controls..I don't want to discourage your project, if you want a project, but this doesn't seem like something that's going to save you money by building yourself.

author: themadhippy
author_rank: Super Contributor
timestamp: August 17, 2023, 10:52:48 pm
content: QuoteThats 16 mono channels,for 16 stereo inputs your looking at a 32 channel desk or 24 monos with an additional 4 stereo inputs

author: donlisms
author_rank: Frequent Contributor
timestamp: August 17, 2023, 11:32:11 pm
content: I tend to agree that buying a cheap mixer would get it done most easily and most bestly. Ground loops could then be managed by clever wiring feeding the balanced inputs (1 - shield connected only at this end, 2 - the computer's tip connection, 3 - the computer's ground connection).If I were doing this, my simple attempt would be a trim pot for each input - petty cheap! and just leave them all unswitched, on the assumption I wouldn't be listening to several of them at once.But the point about ground loops is a good one, and passive solutions can't fix them. So then... differential inputs, treating the source signals as floating on their own grounds, and outputting unbalanced signals to be mixed.And I'm suddenly reminded that you probably want to preserve stereo, so all the numbers just doubled. Sigh. You need a 32 channel mixer.

author: tooki
author_rank: Super Contributor
timestamp: August 18, 2023, 01:50:21 pm
content: I’ll also throw into the ring something I’ve been meaning to try out myself: doing it entirely digitally.Analog Devices makes their graphical DSP software (Sigma Studio) available to anyone, so you can literally just drag and drop things like inputs/outputs, mixers, EQs, etc. to connect them, and it spits out the code for the DSP.The big advantage to this approach, beside the flexibility afforded by it being in software, is that you avoid a lot of analog noise pitfalls, since only the ADC and DAC stages have analog circuitry.In terms of ease of design, though, I think you’d be hard-pressed to do better than an analog mixer with pots. You could even make each channel a small daughtercard so that you just lay out channel cards and then use a ribbon cable to the output board. (I would use better op amps than the 741, though. The venerable 5532 is a great choice, methinks.)

author: Buriedcode
author_rank: Super Contributor
timestamp: August 19, 2023, 06:09:45 pm
content: A purely mechanical approach would be 5x 3pole, 4way rotary switches. Main switch selects the bank - 1-4, and the other four select an input for that bank. 3-pole so that none of the grounds have to be connected to eachother preventing ground loops (the main output will have its ground connected to whatever device is elected of course).It's not solid state, and would require the user to change two knobs to select one of the 16 inputs, but it'll be pretty cheap (3p4way rotary switches by C&K are what £2?) and requires no power.Solid state analogue would require a common ground connection between inputs - unless you use transformers which is cost prohibitive - but could be done with 4051's/4052's and 4066's (or even 2n7000's) to shunt unused inputs to ground (the cross talk on the 4051 isn't great).I guess we really have no idea if the retro computers have floating or fixed ground connections and I would be very hesitant to plug multiple mains power devices with audio outputs into one common ground, regardless of whether you're doing this digitally or all analogue.

author: Nominal Animal
author_rank: Super Contributor
timestamp: August 19, 2023, 07:37:50 pm
content: Note: the KCX_BT_EMITTER I mentioned above has been reported to have unacceptably long latency (100+ ms), which makes itunsuitablefor this!There is aESP32-A2DPlibrary for Arduino at Github by pschatzmann, but the ADC on the ESP32's tends to be only 12-bit, so one would need to create their own frontend and ADC at minimum; for example using PCM1808.Many audio ADCs like PCM1808 produce an I2S digital data stream, so one option would be to isolate that digital stream (typically using a 12.288 MHz master clock, 256×48kHz). However, it ends up being more expensive than using ESP32's powered by and sharing a ground with each retro computer.ESP32-S3seems best suited for I2S in the ESP32 family, although all ESP32's seem to have basic I2S support. I'd consider testing the idea with theOlimex ESP32-S3-DevKit, which is Open Source Hardware.

author: EPAIII
author_rank: Super Contributor
timestamp: August 19, 2023, 11:32:26 pm
content: You really don't need a lot of studies. The book by Jung that I suggested will provide the design advise on practically all that you need. I strongly suggest that you buy or download one.I believe I didn't address an audio switch. While an OP amp could be used, I would instead use an IC. I believe the 4066 would do the job. A good way to use it is for one section providing a switched path for the signal and a second section being used as a path to ground at the input of that first section. Those two sections receive opposite logic signals so one is on and the other is off. This combination of low resistance path to ground when OFF and low resistance path through when ON provides a very good ON/OFF signal ratio. Used this way you would need 8 4066s for 16 channels. They are available in through hole and surface mount packages.https://www.mouser.com/c/semiconductors/switch-ics/analog-switch-ics/?q=4066https://www.ti.com/lit/ds/symlink/cd4066b-mil.pdf?HQS=dis-mous-null-mousermode-dsf-pf-null-wwe&ts=1692455554929&ref_url=https%253A%252F%252Fwww.mouser.pe%252FOn the other hand, if you want to use ready-made audio modules for this, just say so. I can suggest some. But it will be a more expensive route. IIRC, there are even audio mixers that can be ganged together to make more channels. But, again it is a more expensive route. I would be happy to research one of these options for you, even perhaps coming up with a suggested schematic. But doing all of them would be a bit of a burden.Quote from: nemail2 on August 17, 2023, 07:48:42 pm

author: EPAIII
author_rank: Super Contributor
timestamp: August 19, 2023, 11:40:38 pm
content: I saw that someone mentioned stereo. Are we actually talking about 32 audio channels? And will you need dual level controls for the left and right channels of one audio signal? Will you want a or multiple balance controls?

author: Psi
author_rank: Super Contributor
timestamp: August 19, 2023, 11:51:36 pm
content: I would just find a chip that can do analog audio mux that includes a volume control per input channel.The more channels the better, but if you can only find a 4 channel for example. You just mix the outputs of them with a new MUX chip. Building things up until you have the number of channels required. Obviously the 2nd level of mux chips can be cheap/simple ones as they don't need a volume control.I'd use a MCU to control them all, the volume control would probably be I2C / SPI anyway.Is it the best way to you it, probably not, but its pretty simple/straight-forward.The sort of thing you could throw a prototype PCB together in a day or so

author: ledtester
author_rank: Super Contributor
timestamp: August 19, 2023, 11:59:44 pm
content: Quote from: Buriedcode on August 19, 2023, 06:09:45 pmAnother purely mechanical approach would be to use "push button bank switches" like in this pic:Pushing in one button pushes out all of the others so only one switch can be activated at a time.

author: EPAIII
author_rank: Super Contributor
timestamp: August 22, 2023, 08:28:51 am
content: "... so only one switch can be activated at a time.?Unless you cheat by pressing two buttons at one time. Or three. Or four. Or ...Well, you get the idea.And finding a 16 gang version is not going to be easy. 8, 10, possibly 12, but 16? I don't know.Quote from: ledtester on August 19, 2023, 11:59:44 pm

author: wasedadoc
author_rank: Super Contributor
timestamp: August 22, 2023, 11:43:32 am
content: For the switching you won't get much simpler than 16 TRS jacks and a flying lead with a TRS plug. Similar method served the phone companies well for many years before human operators were replaced by Strowger switches. Wire the jacks without connecting their ground connections together and no possibility of introducing ground loops.

author: themadhippy
author_rank: Super Contributor
timestamp: August 22, 2023, 12:36:58 pm
content: QuoteNot just telephones,it was also widely used in tv,radio and music production to route audio and make rerouting simple

author: ledtester
author_rank: Super Contributor
timestamp: August 23, 2023, 05:11:39 am
content: Quote from: EPAIII on August 22, 2023, 08:28:51 amOne could employ a banking idea with a 2-gang and an 8-gang (or even a single and an 8-gang).

author: darkspr1te
author_rank: Frequent Contributor
timestamp: August 23, 2023, 06:27:05 am
content: I also agree with the TRS jack idea as you can squeeze a lot of 3.5 sockets into a small area and then you just require one mast cable to slot into what ever source you choose,A alternative is find a broken beringher 16 stereo channel digital mixer on ebay and fix it or rob it of it's audio control stage as the wifi model has 4 boards (power, mcu,wifi,audio) and can be hacked into a lot of things audio related.darkspr1te

author: EPAIII
author_rank: Super Contributor
timestamp: August 23, 2023, 07:51:14 am
content: In radio and TV land these are called patch panels. I designed a number of stations and yes, I did always include them.But they were for emergency situations or times where something unusual happened and the normal electronic routing equipment was not designed or installed for that unusual task. Or for maintenance purposes when test signals had to be inserted or readings taken at various points in the system.For normal day to day operations, audio and video was routed with electronic switching systems, often following parallel paths. However it was common practice to install patch panels at the inputs and outputs of those electronic routing devices. This allowed things to be re-configured when unusual events occurred. These electronic switching systems were installed in a central location, taking up a significant amount of rack space. A video or audio signal only needed to be brought into them at one input in order to be available at any or all of the outputs which went to different locations in the station. Even audio mixers were primarily used when programming was being created or at the location where the on-air feed was being sent to the transmitter. They were not normally used for routing the audio to different points.Patch panels were a bit of a maintenance problem due to the mechanical contacts. Many stations had a regular maintenance routine where they were "exercised" by inserting and removing patch cords multiple times to break any corrosion that may be forming on the "normal" contacts. Electronic switching equipment is far more reliable.Music production is another thing and the facilities are often allowed to just grow when the musicians acquire different items of equipment. Audio mixers of course are more important. But the musicians are not engineers and things can grow into great tangles. I have seen recording studios where audio cables are run everywhere and someone simply goes behind the equipment and moves them around when needed. I have seen some real messes. Sooner or later someone decides to hire an engineer, perhaps on a part time basis, and then the facility starts to grow up.Quote from: themadhippy on August 22, 2023, 12:36:58 pm