Close
0%
0%

Flexible Audio Hub

A very versatile digital audio hub, enabling DIY audio systems using either custom or garden variety modules.

Similar projects worth following

The Challenge

My ears and speakers will last a lifetime (I hope), but home theatre audio standards do not. My old stereo amplifier works fine, why can't I get an HDMI upgrade module that gives it CEC (control via TV remote)? If I buy a 5.1 channel amplifier, why do I have to throw it in the bin to upgrade to Atmos?

A modern AVR (Audio-Video Receiver) is a fantastic piece of technology, but they are available only in certain fixed configurations and are not easily modifiable.


How Will We Alleviate The Problem?

  1.  A modular "hub" that allows incremental upgrades, e.g. an extra analog input, an extra two channels of amplification, or even another hub...
  2. Compatibility with other open source projects in this field.
  3. Ability to make use of readily available (cheap!) modules from China.
  4. Compatible with Arduino and Raspberry Pi, so you can work with open source home automation software (e.g. limit the volume and turn off the subwoofer if someone's in bed, or play your wake-up alarm at rock concert levels throughout the house)

The modular system will be entirely open-source so that any interested person can make their own module to serve their unique needs (or for fun). Eventually I would like to see compatible modules available from multiple vendors (much like Raspberry Pi & Arduino add-ons).


(Notes Working Towards) The Specification

It's still a work in progress!

A very preliminary draft is on github.

The first stage will be electrical & communications protocol only.

Currently, I am going with the same connector as FreeDSP. But I'd like something better - if anyone knows a connector that is a reasonable pitch (0.5 - 2mm), keyed, upwards-compatible with extra pins (e.g. a 16-pin plug can fit into a 20-pin socket), and cheap, please get in contact!

Previously, I started a similar project using a backplane, because edge connectors are cheap, but the design I was using had the switching complexity by necessity in every module, was difficult to integrate into a chassis, and did not offer full flexibility for multiple simultaneous outputs. Now I will move that complexity to a "hub" board.

Each module should (yes, it's optional) have an ID EEPROM & accept a few basic commands (Enable, select channel) via I2C. This can be achieved via a PCA9500 I/O expander or ATtiny, for example. Modules without the ID/Control interface will require more configuration effort and might waste a bit more power (the central hub will not have power switches per module).

The hub will be controlled by I2C, and a C++ library will be provided that will be usable via Arduino and Raspberry Pi. The hub will be able to be daisy-chained. 


Why You No Video?

Yes, I would love to do video too. However, it's proving difficult to get my hands on the right chips. Once the audio hub is finished, video will be a future project :)


The Modules

This project is all about the hub.

  • Hub - a multiplexer used to select between multiple source and/or sink modules. I'm aiming for 8 connections, which are each able to be used as input, output, or processing loop. They'll be connected via a crossbar topology such that any input can be sent to any number of outputs. Multiple inputs will be able to be sent to multiple outputs simultaneously.

But, a hub alone is worthless. I will be using a Raspberry Pi as the central controller, with Arduino compatibility a key design consideration (the central controller only has to send some fairly simple I2C commands). And of course we need some modules to interconnect to do anything useful, so here are some that I'll probably be starting with:

  • Analog Input - 6 channels, configurable as one group of 5.1, or 3 groups of stereo
  • Analog Output - as per input
  • Amplifier - 2 channels, will be based on some cheap class D module
  • Headphone Amplifier - 2 channel, high quality op-amps
  • Control Interface - IR/serial...
Read more »

  • Soldering Begins

    Andrew Bolin06/25/2018 at 10:12 0 comments

    Quick update - boards arrived, they look good.

    I'm starting assembly with just the bare bones - 2 bus switches, enough to select between two inputs. And leaving off all the "just in case" resistors (I'll add them in when things inevitably start acting crazy).

    One small problem I found tonight - I selected the wrong package for the shift register. Did I make the mistake when ordering, or when laying out? ... one for the philosophers perhaps.

    Getting the hang of my dirt cheap "Bakon" soldering iron with it's knife tip that is poorly tinned...

    Will hopefully find a local supplier for the shift register tomorrow.

  • Layout Done

    Andrew Bolin06/08/2018 at 10:23 0 comments

    A bit of progress to report:

    * Design updated to allow any combination of switching between the 4 modules

    * Layout complete and sent off to manufacture!


    Four layer boards are way more expensive than two layer. I think the design could probably have been done on two layers, but it would have taken me much longer. This layout is nowhere near optimal, and it took me long enough, so the time savings are worth the cash for now.

    You can't see it in the picture but I put a couple of chips on the back to make routing easier too (side note: is there a way to make changes to the circuit in the layout and then import them back into the schematic? I should look into that...)

    Next: start writing some Arduino software to control the switches on the hub, and some Raspberry Pi software to talk to the Arduino. (Yes, the Raspberry Pi could easily do it all but I don't want it to require a pi).

  • Incapacitated Laptop

    Andrew Bolin04/27/2018 at 03:54 0 comments

    Progress on hold for a while, my laptop has some defective firmware or something and needs to go to the laptop hospital :(

  • Prelminiary Specification

    Andrew Bolin04/22/2018 at 06:17 0 comments

    I've hacked together something so I can start coding and start shaking out some problems.

    https://github.com/andrew-bolin/flexible_audio_hub/blob/master/SPECIFICATION.md

    Open for comments, as always :)

  • 74-series FTW

    Andrew Bolin04/22/2018 at 01:43 0 comments

    After my frustration with Vivado, I've done a discrete logic implementation of the "MVP".


    A hub with 4 connections, with 4 switches, so it's essentially 2 inputs and 2 outputs. Each input can be switched to any one output, no output, or both outputs. That's enough flexibility to get some control software started, and plug in some real modules for testing.

    Full schematic on github.

    Next: layout, ordering parts

  • Vexing Vivado

    Andrew Bolin04/21/2018 at 10:52 0 comments

    I have a Zynq that is colossal overkill for this task, but I can't get the damn tools to co-operate.

    (I want to start with the Zynq because why not)

    Vivado (2018.1) on Linux (Ubuntu Gnome) crashes at the drop of a hat. Right click, crash. Hover over a button, crash. I guess it's some bug in its GUI. Any suggestions welcome...

    I do have an older Spartan chip but I can't remember how to drive the old Xilinx ISE, maybe I should give Altera or Lattice a go. Or some good old hard wired logic.

    For my reference:

    #
    # An unexpected error has occurred (11)
    #
    Stack:
    /opt/Xilinx/Vivado/2018.1/tps/lnx64/jre/lib/amd64/server/libjvm.so(+0x923da9) [0x7f62e7182da9]
    /opt/Xilinx/Vivado/2018.1/tps/lnx64/jre/lib/amd64/server/libjvm.so(JVM_handle_linux_signal+0xb6) [0x7f62e71893f6]
    /opt/Xilinx/Vivado/2018.1/tps/lnx64/jre/lib/amd64/server/libjvm.so(+0x9209d3) [0x7f62e717f9d3]
    /lib/x86_64-linux-gnu/libc.so.6(+0x37140) [0x7f6325935140]
    /opt/Xilinx/Vivado/2018.1/tps/lnx64/jre/lib/amd64/libawt_xawt.so(+0x42028) [0x7f62c8320028]
    /opt/Xilinx/Vivado/2018.1/tps/lnx64/jre/lib/amd64/libawt_xawt.so(+0x42288) [0x7f62c8320288]
    /opt/Xilinx/Vivado/2018.1/tps/lnx64/jre/lib/amd64/libawt_xawt.so(Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl+0x17c) [0x7f62c831867c]
    [0x7f62d72224cf]

  • Github now open

    Andrew Bolin04/19/2018 at 09:40 0 comments

    Just uploaded the draft outline schematic to github.


    Next step is probably to use an FPGA dev board I have to build up the switching logic and see how much real estate it uses, and connect it up to the Pi (skipping the hub microcontroller and just using the Pi to start with)...

  • Starting the Schematic

    Andrew Bolin04/18/2018 at 11:40 0 comments

    Late. Tired. Been drafting schematic. Will upload to github tomorrow.

    hub core has hierarchical connectors too, I just haven't imported to the main sch

  • Pi Plug & Play Prioritised

    Andrew Bolin04/17/2018 at 01:04 0 comments

    So I realised it would probably be a good marketing / UX decision to make my hub as easy as possible to use with a Raspberry Pi.

    To that end, I'm going to make the Hub essentially a "HAT". The shape & size may not be suitable, but I can easily make it pin compatible, so people can just plug in a 40-pin ribbon cable. The hub will have a 12V power supply and 5V regulator to provide power to the Raspberry.


    Now the Pi also has a great variety of DACs, amplifiers, etc available, so I'll make a Hub:Pi adapter to plug these in. Hub connections, for now, are going to be 16 pin (8x2) headers as per FreeDSP. This Hub:Pi adapter will be Pi Zero sized, and carry power (5v & 3v3), I2S audio, I2C for control, and will optionally have an I/O expander for HATs that need some GPIO pins (unless I discover an overwhelmingly standard pin used for mute, these will be unrouted, user to connect jumper wires).

    I'll try to get some rough PCB renders together soon so this is easier to visualize. For now, here's a block diagram.

  • Design/Indecision

    Andrew Bolin04/15/2018 at 12:13 0 comments

    This weekend has been spent poring over parts catalogs and datasheets.


    In the end, I'm more confused than when I started ;)

    Parts Chosen

    • 2x8 header, 2.54mm pitch - as used by FreeDSP. For my first run of boards at least. I'd prefer a more user-friendly connector, but I can use a keyed socket to help a little.
    • 74CBTLV3245 - 8 bit bus switch, 75c. Again, a first run quick and dirty choice, in a 2x2 matrix if I can figure out the routing.
    • TCA9546A - 4 channel I2C bus switch. Yes, you can do this with a normal bus switch chip, but I want to switch control independently from the audio. This specialty part is worth the $1.75 to have in-band control anyway. (And there's an 8 channel variant for 25c more)

    Learnings

    • TDM (Time Division Multiplexing) - as well as being an generic term, this is apparently a specific method of transmitting 8 channel audio over only a few wires.
    • Bus switches are not that cheap if you want to do crossbar switching.
    • This project will end up being be a lot more software than hardware to get the level of user experience I want.

    Next Steps

    • Check if TDM is commonly supported by DACs & ADCs used in readily available modules (I fear it is not).
    • Check if TDM frequencies will be difficult to work with (48k samples/sec, 32 bits, 8 channels... it's too late at night)
    • Figure out if a CPLD is practical for a bidirectional crossbar switch, or if the "FP" aspect of FPGA is worth it (the CPLD or FPGA will likely to be under $10 @ qty 1, but the FPGA needs memory etc.)

    Open to suggestions of CPLD/FPGA - I have used Xilinx in the past, but I see Altera has a third-party usb programmer for like $2...

View all 10 project logs

Enjoy this project?

Share

Discussions

turnkit wrote 03/25/2021 at 08:22 point

any progress?!  this is an excellent project.

  Are you sure? yes | no

Mark R. Florkowski wrote 04/17/2018 at 01:20 point

Euroblock connectors are fairly standard in the pro audio applications. I don't know what you would classify as cheap, but they come in a number of different sizes, and cost about a dollar a piece. I would recommend Phoenix Contact branded ones, as they are very high quality. 

  Are you sure? yes | no

Andrew Bolin wrote 04/18/2018 at 11:36 point

Thanks for the tip - I'll check 'em out.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates