06-20-2021, 10:32 PM
(06-03-2021, 07:02 PM)TRS-80 Wrote: 1. A2DP profile (regular audio) works, but HSP (headset profile) results only in buzzing sound from earpiece. It seems the latter has not been implemented yet?
This is probably 8723cs driver issue. Buzzing noise does not happen when I use USB Bluetooth adapter on PinePhone.
Even if HSP does work, we need to solve another problem (at least on PinePhone).
Currenly audio is handled by audio codec in A64 SoC while voice calling, so that
it does not require main CPU to process audio.
Because of that, any audio source/sink connected outside of audio codec cannot be directly used for calling. (e.g. USB Headset)
We probably have to:
1. create a profile for routing modem audio to main CPU (alsa or pulseaudio?)
2. craete a way to loopback audio source/sink into modem.
I have experimented my idea with USB headset.
With some manual adjustment with pavucontrol, voice calling over USB headset seemed to be working.
Here is my script I hacked together:
Code:
#!/bin/sh
source_pine=alsa_input.platform-sound.Voice_Call__hw_PinePhone_0__source
source_usb=alsa_input.usb-Creative_Technology_Ltd_Sound_Blaster_JAM_V2_XXXXXXXXXXXXXXXXXX-00.mono-fallback
sink_pine=alsa_output.platform-sound.Voice_Call__hw_PinePhone_0__sink
sink_usb=alsa_output.usb-Creative_Technology_Ltd_Sound_Blaster_JAM_V2_XXXXXXXXXXXXXXXXXX-00.mono-fallback
# mix modem audio
amixer -c 0 cset "name=AIF2 Digital ADC Capture Switch" on
amixer -c 0 cset "name=AIF2 ADC Mixer AIF1 DA0 Capture Switch" on
# mute internal mic and speaker
amixer -c 0 cset "name=Mic1 Capture Switch" off
amixer -c 0 cset "name=Line Out Playback Switch" off
ffmpeg -f pulse -i "$source_pine" -f pulse -device "$sink_usba" 1 &
job1=$!
ffmpeg -f pulse -i "$source_usb" -f pulse -device "$sink_pine" 2 &
job2=$!
echo Press enter to stop
read l
kill $job1 $job2
amixer -c 0 cset "name=AIF2 Digital ADC Capture Switch" off
amixer -c 0 cset "name=AIF2 ADC Mixer AIF1 DA0 Capture Switch" off