How to make sound to both front and back jacks

From: jin guojun <jguojun_at_gmail.com>
Date: Sat, 21 Jan 2023 00:03:06 UTC
Tried to search how to do this but did not get useful information,

The default setting hw.snd.default_unit=0 makes sound going to the back
jack.
sysctl -w hw.snd.default_unit=1 makes sound going to the front jack.

Is any way to make sound going to both jacks?

Below is the sound device information:

hdaa0: ahcich6: AHCI reset: device found
ahcich7: hdaa0: nid   0x    as seq device       conn  jack    loc
 color   misc
hdaa0: 17 40370040 4  0  CD            None  Analog  0x00       Unknown 0
hdaa0: 18 4017c040 4  0  Speaker       None  Analog  0x00       Res.C   0
hdaa0: 20 01014010 1  0  Line-out      Jack  1/8     Rear       Green   0
hdaa0: 21 01011012 1  2  Line-out      Jack  1/8     Rear       Black   0
hdaa0: 22 01016011 1  1  Line-out      Jack  1/8     Rear       Orange  0
hdaa0: 23 40170000 0  0  Speaker       None  Analog  0x00       Unknown 0
hdaa0: 24 01a19030 3  0  Mic           Jack  1/8     Rear       Pink    0
hdaa0: 25 02a19040 4  0  Mic           Jack  1/8     Front      Pink    0
hdaa0: 26 0181303f 3  15 Line-in       Jack  1/8     Rear       Blue    0
hdaa0: 27 02214020 2  0  Headphones    Jack  1/8     Front      Green   0
hdaa0: 28 411111f0 15 0  Speaker       None  1/8     Rear       Black   1
hdaa0: 29 4025d601 0  1  Headphones    None  Optical 0x00       Res.D   6
hdaa0: 30 01456150 5  0  SPDIF-out     Jack  Optical Rear       Orange  1
hdaa0: 31 411111f0 15 0  Speaker       None  1/8     Rear       Black   1
hdaa0: Patching widget caps nid=29 0x00400400 -> 0x00700400
hdaa0: Patched pins configuration:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0: 17 40370040 4  0  CD            None  Analog  0x00       Unknown 0
DISA
hdaa0: 18 4017c040 4  0  Speaker       None  Analog  0x00       Res.C   0
DISA
hdaa0: 20 01014010 1  0  Line-out      Jack  1/8     Rear       Green   0
hdaa0: 21 01011012 1  2  Line-out      Jack  1/8     Rear       Black   0
hdaa0: 22 01016011 1  1  Line-out      Jack  1/8     Rear       Orange  0
hdaa0: 23 40170000 0  0  Speaker       None  Analog  0x00       Unknown 0
DISA
hdaa0: 24 01a19030 3  0  Mic           Jack  1/8     Rear       Pink    0
hdaa0: 25 02a19040 4  0  Mic           Jack  1/8     Front      Pink    0
hdaa0: 26 0181303f 3  15 Line-in       Jack  1/8     Rear       Blue    0
hdaa0: 27 02214020 2  0  Headphones    Jack  1/8     Front      Green   0
hdaa0: 28 411111f0 15 0  Speaker       None  1/8     Rear       Black   1
DISA
hdaa0: 30 01456150 5  0  SPDIF-out     Jack  Optical Rear       Orange  1
hdaa0: 31 411111f0 15 0  Speaker       None  1/8     Rear       Black   1
DISA
hdaa0: 5 associations found:
hdaa0: Association 0 (1) out:
hdaa0:  Pin nid=20 seq=0
hdaa0:  Pin nid=22 seq=1
hdaa0:  Pin nid=21 seq=2
hdaa0: Association 1 (2) out:
hdaa0:  Pin nid=27 seq=0
hdaa0: Association 2 (3) in:
hdaa0:  Pin nid=24 seq=0
hdaa0:  Pin nid=26 seq=15
hdaa0: Association 3 (4) in:
hdaa0:  Pin nid=25 seq=0
hdaa0: Association 4 (5) out:
hdaa0:  Pin nid=30 seq=0
hdaa0: Tracing association 0 (1)
hdaa0:  Pin 20 traced to DAC 2
hdaa0:  Pin 22 traced to DAC 4
hdaa0:  Pin 21 traced to DAC 3
hdaa0: Association 0 (1) trace succeeded
hdaa0: Tracing association 1 (2)
hdaa0:  Pin 27 traced to DAC 5
hdaa0: Association 1 (2) trace succeeded
hdaa0: Tracing association 2 (3)
hdaa0:  Unable to trace pin 24 to ADC 7, undo traces
hdaa0:  Pin 24 traced to ADC 8
hdaa0:  Pin 26 traced to ADC 8
hdaa0: Association 2 (3) trace succeeded
hdaa0: Tracing association 3 (4)
hdaa0:  Unable to trace pin 25 to ADC 7, undo traces
hdaa0:  Pin 25 traced to ADC 9
hdaa0: Association 3 (4) trace succeeded
hdaa0: Tracing association 4 (5)
hdaa0:  Pin 30 traced to DAC 6
hdaa0: Association 4 (5) trace succeeded
hdaa0: Looking for additional DAC for association 0 (1)
hdaa0: Looking for additional DAC for association 1 (2)
hdaa0: Looking for additional ADC for association 2 (3)
hdaa0: Looking for additional ADC for association 3 (4)
hdaa0: Looking for additional DAC for association 4 (5)
hdaa0: Tracing input monitor
hdaa0:  Tracing nid 11 to out
hdaa0:  nid 11 is input monitor
hdaa0:  Tracing nid 34 to out
hdaa0:  Tracing nid 35 to out
hdaa0: Tracing other input monitors
hdaa0:  Tracing nid 24 to out
hdaa0:  Tracing nid 25 to out
hdaa0:  Tracing nid 26 to out
hdaa0: Tracing beeper
hdaa0: ahcich7: Pin sense: nid=20 sense=0x80000000 (connected)
hdaa0: SATA offline status=00000004
hdaa0: FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivref
pcm0: <Realtek ALC897 (Rear Analog 5.1/2.0)> at nid 20,22,21 and 24,26 on
hdaa0
pcm1: <Realtek ALC897 (Front Analog)> at nid 27 and 25 on hdaa0
pcm2: <Realtek ALC897 (Rear Digital)> at nid 30 on hdaa0