HTPC
Build a Linux HTPC to replace AV Receiver — Re purposing Sony speakers with onboard audio.
Motivation
We had a complete 5.1 Sony speaker system lying unusable due to lack of amplifier. The speakers came as part of a Sony Home theater, whose AV Receiver has been lost. An alternate set bought from Amazon was not very usable and the one assembled locally also was not noise free. The following configuration has finally allowed me to use these speakers without further major investment.
Hardware
The Sony Home theater system HT-DDW740 was bought somewhere around 2003. This included a STR-K740P receiver(lost), SA-WMSP4 powered sub-woofer, 4 Nos of SS-MSP2 satellites and a center speaker SS-CNP2.
The desktop computer homepc2 running Alpine Linux had a 2.1 computer speaker system F&D Model F-203G bought around 2015. The sound was good for the price paid for the speaker. The Asus motherboard PRIME H510M-E in it, has a onboard sound card ALC897 with Intel iGPU + HDMI.
On boot, kernel module is loaded and udev restores 6ch mixer state. This is followed by local.d running hda-verb pin reassignment, and finally PipeWire starts as a user service. This procedure can be applied for any speaker + hardware + Linux OS with minor changes.
Configuration
Jack Configuration
Managed to configure the onboard sound card ALC897 on a PC running Alpine Linux such that the
- Lime (Line Out): Front Left & Front Right (F&D system). Replaced both the F&D satellites speakers by Sony SS-MSP2
- Pink (Mic In): Re-assigned to Centre & LFE output using hda-verb. Right channel (RCA Red) feeds SA-WMSP4 powered sub-woofer directly. TBD: Left channel (RCA White) feed SS-CNP2 center speaker via an amplifier like TPA3110D2
- Blue (Line In): TBD: Rear Left & Rear Right. Needs a stereo amplifier to raise the signal from line level for use with these passive SS-MSP2 speakers.
Once the necessary kernel module is loaded, the utility hda-verb from alsa-tools is used to reassign the pins as shown below.
prabu@homepc2 ~> cat /etc/modprobe.d/alsa-base.conf
options snd-hda-intel model=alc897-desktop
prabu@homepc2 ~> cat /etc/local.d/subwoofer.start
#!/bin/sh
hda-verb /dev/snd/hwC0D0 0x18 SET_PIN_WIDGET_CONTROL 0x40
# hda-verb /dev/snd/hwC0D0 0x18 SET_CONNECT_SEL 0x01
hda-verb /dev/snd/hwC0D0 0x18 SET_CONNECT_SEL 0x02
In alsamixer utility, change the channel mode from default 2ch to 6ch. Issue the below command to save it in /var/lib/alsa/asound.state.
prabu@homepc2 ~> doas alsactl store
udev rules will run the alsactl restore and 6ch mode is loaded, from next boot onwards.
prabu@homepc2 ~> find /usr/lib/udev/rules.d /etc/udev/rules.d -name "*alsa*" 2>/dev/null
/usr/lib/udev/rules.d/60-persistent-alsa.rules
/usr/lib/udev/rules.d/90-pipewire-alsa.rules
/usr/lib/udev/rules.d/90-alsa-restore.rules
prabu@homepc2 ~> amixer -c 0 sget "Channel Mode"
Simple mixer control 'Channel Mode',0
Capabilities: enum
Items: '2ch' '4ch' '6ch'
Item0: '6ch'
The following utility from alsa-utils used to test the sound from each speaker, to see how the system sees them.
speaker-test -D hw:0,0 -c 6 -r 48000 -F S16_LE -t wav
Pipewire Configuration
The file “21-upmix.conf” configures PipeWire to upmix stereo content to 6 channels before sending to ALSA hardware.
WirePlumber by default selects analog-stereo profile for the ALC897. The below config file 51-alsa-surround.conf forces it to use analog-surround-51 profile, which exposes all 6 discrete channels (FL, FR, RL, RR, FC, LFE) to PipeWire.
prabu@homepc2 ~> cat .config/pipewire/pipewire.conf.d/21-upmix.conf
context.properties = {
channelmix.upmix = true
channelmix.upmix-method = simple
channelmix.lfe-cutoff = 150
channelmix.fc-cutoff = 0
}
prabu@homepc2 ~> cat .config/wireplumber/wireplumber.conf.d/51-alsa-surround.conf
monitor.alsa.rules = [
{
matches = [
{ device.name = "alsa_card.pci-0000_00_1f.3" }
]
actions = {
update-props = {
device.profile = "output:analog-surround-51+input:analog-stereo"
}
}
}
]
prabu@homepc2 ~> wpctl status|grep 5.1
│ * 43. Built-in Audio Analog Surround 5.1 [vol: 0.40]
The following test commands from pipewire-tools used to verify the working of pipewire.
prabu@homepc2 ~> pw-dump | grep -i "upmix\|channelmix\|lfe" | grep -v "name\|description\|type"
To test the setup in actual use, while mpv is playing, in another terminal run the below command.
prabu@homepc2 ~> pw-dump | grep -i "channelmix\|position" | grep -v "name\|description\|type"
The above commands confirms working when output shows both audio.position: FL,FR (stereo input from mpv) and audio.position: FL,FR,RL,RR,FC,LFE (6ch output to hardware) simultaneously.
TBD:
Blue jack hda-verb reassignment pending. Once an amplifier like TPA3110D2 is connected, subwoofer.start needs to be added as follows:
hda-verb /dev/snd/hwC0D0 0x1a SET_PIN_WIDGET_CONTROL 0x40
hda-verb /dev/snd/hwC0D0 0x1a SET_CONNECT_SEL 0x??
Run below command to determine correct routing node.
hda-verb /dev/snd/hwC0D0 0x1a GET_CONNECT_LIST 0
Usage
Finally wired up all the components on 2026-06-04. Both the newly bought Gold A543(bought) and Gold A542 salvaged from old 5.1 system has been used to power up the 2 Front speakers and center speaker respectively.
The power is currently drawn from the load terminal of phocos CML-10 connected through a 6sq-mm wire. So theoretically this is limited to 120W to 140W.
© Prabu Anand K 2020-2026