Code for controlling my home hifi/surround system
Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
http_static flake8 fixes Jan 12, 2015
xbmc Another try to get HDMI #3 working Mar 8, 2014
.gitignore Ignore .pyc files Jan 20, 2012
HK AVR RS232 Protocol.pdf Add document describing the Harman Kardon AVR 430/630 RS-232 interface Jan 13, 2012
HK AVR RS232 Protocol.txt Txt version of H/K AVR 430/630 RS-232 interface document Jan 14, 2012
README Various doc updates Jan 19, 2013
av_control.py flake8 fixes Jan 12, 2015
av_device.py flake8 fixes Jan 12, 2015
av_loop.py flake8 fixes Jan 12, 2015
av_serial_device.py flake8 fixes Jan 12, 2015
avr_command.py flake8 fixes Jan 12, 2015
avr_device.py flake8 fixes Jan 12, 2015
avr_dgram.py flake8 fixes Jan 12, 2015
avr_state.py
avr_status.py
budget.ods Updated budget/expense sheet Jun 19, 2012
devices.txt
fake_avr.py flake8 fixes Jan 12, 2015
fake_hdmi_switch.py
fake_serial_device.py
hdmi_switch.py flake8 fixes Jan 12, 2015
http_server.py flake8 fixes Jan 12, 2015
reveng_avr_icons.ods Fix more Dolby-related bit-mappings Jan 29, 2012
timed_queue.py

README

My playground for software associated with my home hifi/surround system.

Current setup
-------------

In the short term, there'll be code for controlling A/V components from my
media PC. The system currently looks something like this:

  ----------    ----------------------    ---------------    ---------------
 | Media PC |  | Cable TV set-top box |  | Playstation 3 |  | Other sources |
  ----------    ----------------------    ---------------    ---------------
     ||    \_____________________  |        |  _______________/
     ||            (HDMI)        \ |        | /
     ||                          -vv--------vv-      (HDMI)     ----
     | ------------------------>| HDMI Switch  |-------------->| TV |
     |(RS-232)                   --------------                 ----
     |                                  |
     |                                  | (SPDIF)
     |                      ------------v----------
      -------------------->| Harman/Kardon AVR 430 |
                            -----------------------
                                  | | | | |  \__________________________
              ___________________/  | | |  \______________          \   \
  (Analog)   /              _______/  |  \_____           \          \   \
            /              /          |        \           \          \   \
  ---------v--------------v---        |         |           |        --v---v--
 | Front left amp |   FR amp  |       |         |           |       | S/W amp |
  ----------------------------        |         |           |        ---------
           |              |           |         |           |          |   |
  ---------v------    ----v---    ----v--    ---v----    ---v----    --v---v--
 | Front Left spk |  | FR spk |  | C spk |  | SL spk |  | SR spk |  |   S/W   |
  ----------------    --------    -------    --------    --------    ---------

The only software needed in the above setup is for controlling the HDMI Switch
and the Surround Receiver (AVR) from the media PC using RS-232. This way I
should no longer need the IR remotes for the HDMI Switch and the AVR. Instead,
I control them from the wireless keyboard of the media PC.


Future setup
------------

In the longer term, I plan to build a hifi/surround system with digital
signalling as far as possible towards the speakers. The setup will look
something like this:

  ----------    ----------------------    ---------------    ---------------
 | Media PC |  | Cable TV set-top box |  | Playstation 3 |  | Other sources |
  ----------    ----------------------    ---------------    ---------------
           \_____________________  |        |  _______________/
                   (HDMI)        \ |        | /
                                 -vv--------vv-      (HDMI)     ----
                           ---->| HDMI Switch  |-------------->| TV |
                          |      --------------                 ----
                          |             |
                  (RS-232)|             | (HDMI or SPDIF)
                          |      -------v------
                           -----|   Audio PC   |
                                 --------------
               (AES/EBU or SPDIF) | | | |   \_______________________
              ___________________/  | |  \                          \
             /              _______/  |   \_______                   \
            /              /          |           \                   \
  ---------v------    ----v---    ----v--    -------v------------    ----v----
 | Front Left amp |  | FR amp |  | C amp |  |    Surround amp    |  | S/W amp |
  ----------------    --------    -------    --------------------    ---------
  (Analog) |  |         | |         | |         |           |          |   |
  ---------v--v---    --v-v---    --v-v--    ---v----    ---v----    --v---v--
 | Front Left spk |  | FR spk |  | C spk |  | SL spk |  | SR spk |  |   S/W   |
  ----------------    --------    -------    --------    --------    ---------

Here, the AVR (which today functions as a digital-input/analog-output pre-amp
and 3-channel power amp) is replaced by an Audio PC that will function as a
digital-input/digital-output pre-amp, and a collection of digital-input power
amps (either using digital input Class D technology, i.e. "PowerDACs"; or using
a dedicated DAC in front of a more conventional analog-input power amp). There
will be (nominally) one such amp per speaker, and it will be located reasonably
close to that speaker, in order to minimize the length of analog speaker cable.
(One exception from this rule will be the surround speakers, which probably
will share a 2-channel amp, and thus might required somewhat longer runs of
analog speaker cables.)

The Audio PC is the heart of this system, and it will perform the following
tasks:
 - Source selection (by signalling the HDMI Switch over RS-232)
 - Decoding (decoding the incoming surround signal into separate channels)
 - Upsampling/sample-widening if necessary (96kHz/24bits should be sufficient)
 - Volume control
 - Room correction (requires a microphone for measurements)
 - Crossover (depends on how many channels per amp per speaker)
 - Digital output to all the amps/DACs

All the software written for the audio PC will be available here.


Have fun! :)

Johan Herland <johan@herland.net>