I found a simple solution using just ALSA and uses little CPU - around 3-5% on RPi 3 using latest Jessie build and a USB Audio Device
It appears that recent builds all come with ALSA's dmix plugin built-in. This allows you to share and output audio output stream
Create New .asoundrc
pi@raspberrypi:~ $ sudo nano .asoundrc
Copy/Paste this based on USB Audio Device is the second card in system
pcm.LineOut {
type dmix # Kernel PCM
ipc_key 1112233 # Any Unique Number Number
slave {
pcm "hw:1,0" # Card # of USB Audio from aplay -l
period_time 0
period_size 1024
buffer_size 8192
rate 48000
#periods 128
}
}
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
Modify ALSA settings to make the USB Audio device the default using
alsamixer
<F6>
Select the USB Sound Card
Change Inout to Line if you have a high end Audio device, otherwise leave as Mic
Modify volumes to 40-50%
On exit, save settings
alsactl store
Start the stream playback from Audio In direct to Audio Out (& will return to command line)
arecord -f dat | aplay -D "LineOut" &
<CR>
Reduce volume of line input:
amixer set Line,0 0%
Use dmix shared pcm device to insert wav file previously recorded from line in:
aplay -D LineOut -R 48000 hiVol.wav
When it's all done restore the volume back to normal:
amixer set Line,0 50%
alsamixer
)?