Pulseaudio SPDIF Input, LFE remix: Difference between revisions

From JoBaPedia
Jump to navigation Jump to search
No edit summary
 
Line 45: Line 45:
   pacat -r --latency-msec=1 -d 'alsa_input.usb-FMIC_Fender_Mustang_Micro_396234823131-00.iec958-stereo' | \
   pacat -r --latency-msec=1 -d 'alsa_input.usb-FMIC_Fender_Mustang_Micro_396234823131-00.iec958-stereo' | \
   pacat -p --latency-msec=1 -d 'alsa_output.usb-0ccd_USB_Audio-00.analog-surround-51'
   pacat -p --latency-msec=1 -d 'alsa_output.usb-0ccd_USB_Audio-00.analog-surround-51'
== Loop Job4 Audio to Fender Mustang Micro ==
To feed chordsplay.py songs running on job4 into Fender Mustang Micro as backing track via bluetooth
script is in /home/joachim/pa/job42fender.sh
# send linux sound to fender amp to play along
# use wired headphones on the fender amp to avoid delay
# or wireless:
#  mustang-micro->3.5-male-male-cable->3.5-female-to-6.5-male-adapter->iRig2(through)->Cuvave-TX-> ~ ->Cuvave-Rx->Amp
fender_mac='84:17:15:15:F0:20'
fender_sink="bluez_sink.${fender_mac//:/_}.a2dp_sink"
fender_source="alsa_output.usb-0ccd_USB_Audio-00.analog-surround-51.monitor"
echo -e "power on\nquit" | bluetoothctl
while ! echo -e "show\nquit" | bluetoothctl | grep 'Powered: yes'; do
echo "Wait for power on"
sleep 1
done
echo -e "connect $fender_mac\nquit" | bluetoothctl
try=0
while ! pactl list sinks short | fgrep "$fender_sink"; do
echo "Wait for $fender_sink"
try=$((try+1))
if [ $try -gt 5 ]; then
echo -e "connect $fender_mac\nquit" | bluetoothctl
echo "Restart device?"
fi
sleep 1;
done
echo "Connect $fender_source to $fender_sink. Ctrl-C to end"
pacat -r --latency-msec=1 -d "$fender_source" | \
pacat -p --latency-msec=1 -d "$fender_sink"

Latest revision as of 16:32, 7 March 2022

Route the SPDIF input of the Aureon 5.1 USB Soundcard to its 5.1 output

For my ESP32 Bluetooth to Toslink Project, start this

arecord -f S16_LE -c 2 -r 48000 -D iec958  --disable-channels --disable-format --disable-softvol --disable-resample -B 100000 -t raw | \
aplay   -f S16_LE -c 2 -r 44100 -D default --disable-channels --disable-format --disable-softvol --disable-resample -B 100000 -t raw

Bit strange: BT A2DP sends 44100 samples/s but iec958 seems to be locked to 48000, so fix speed during output or voices are a bit too high

For a good sound, the LFE needs to do some work for the small satelites

/etc/pulse/daemon.conf

enable-lfe-remixing = yes
lfe-crossover-freq = 100

To enable changes

systemctl --user restart pulseaudio.service


Loopback line in to line out

PulseAudio Control

This has long delay

Start Loopback

  • pactl load-module module-loopback

Stop loopback

  • pactl unload-module module-loopback

PulseAudio Cat

This can have short delay

Install pulseaudio manager to look for the audio device names, then write script to start the monitoring with short delay

  • sudo zypper in paman
  • paman -> look at property of sink and source (to copy/paste the long names)
  • write script to start monitoring
 pacat -r --latency-msec=1 -d 'alsa_input.usb-FMIC_Fender_Mustang_Micro_396234823131-00.iec958-stereo' | \
 pacat -p --latency-msec=1 -d 'alsa_output.usb-0ccd_USB_Audio-00.analog-surround-51'


Loop Job4 Audio to Fender Mustang Micro

To feed chordsplay.py songs running on job4 into Fender Mustang Micro as backing track via bluetooth

script is in /home/joachim/pa/job42fender.sh

# send linux sound to fender amp to play along 
# use wired headphones on the fender amp to avoid delay
# or wireless: 
#  mustang-micro->3.5-male-male-cable->3.5-female-to-6.5-male-adapter->iRig2(through)->Cuvave-TX-> ~ ->Cuvave-Rx->Amp

fender_mac='84:17:15:15:F0:20'
fender_sink="bluez_sink.${fender_mac//:/_}.a2dp_sink"
fender_source="alsa_output.usb-0ccd_USB_Audio-00.analog-surround-51.monitor"

echo -e "power on\nquit" | bluetoothctl
while ! echo -e "show\nquit" | bluetoothctl | grep 'Powered: yes'; do 
	echo "Wait for power on"
	sleep 1
done

echo -e "connect $fender_mac\nquit" | bluetoothctl
try=0
while ! pactl list sinks short | fgrep "$fender_sink"; do 
	echo "Wait for $fender_sink" 
	try=$((try+1)) 
	if [ $try -gt 5 ]; then 
		echo -e "connect $fender_mac\nquit" | bluetoothctl
		echo "Restart device?" 
	fi 
	sleep 1; 
done

echo "Connect $fender_source to $fender_sink. Ctrl-C to end"
pacat -r --latency-msec=1 -d "$fender_source" | \
pacat -p --latency-msec=1 -d "$fender_sink"