From 6d99d780805b6271e2db608d8367c4307057e0c6 Mon Sep 17 00:00:00 2001 From: ubuntu Date: Tue, 10 Sep 2024 09:51:14 +0000 Subject: [PATCH] LNL alsabat test to support both USB Codec/AudioPlug loopback setup Signed-off-by: Santosh Avati --- test-case/check-alsabat.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test-case/check-alsabat.sh b/test-case/check-alsabat.sh index e028db78..9f7c9d77 100755 --- a/test-case/check-alsabat.sh +++ b/test-case/check-alsabat.sh @@ -81,6 +81,37 @@ then exit 2 fi +# Check device for AudioPlug Loopback enabled or not for LNL HDA +if [ "$AUDIOPLUG_LOOPBACK" == "true" ] && [ "$MODEL" == "LNLM_RVP_HDA" ]; then + + dlogi "The Device have AUDIO PLUG LOOPBACK enabled for LNLM_RVP_HDA" + + # Check for playback/capture used USB codec, if yes replace with headset device + if [ "$pcm_c" == "hw:CODEC,0" ]; then + pcm_c="hw:sofhdadsp,0" + dlogi "Capture device changed to $pcm_c" + else + pcm_p="hw:sofhdadsp,0" + dlogi "Playback device changed to $pcm_p" + fi +fi + +# Check device for AudioPlug Loopback enabled or not for LNL SDW +if [ "$AUDIOPLUG_LOOPBACK" == "true" ] && [ "$MODEL" == "LNLM_SDW_AIOC" ]; then + + dlogi "The Device have AUDIO PLUG LOOPBACK enabled for LNLM_SDW_AIOC" + + # Check for playback/capture used USB codec, if yes replace with headset device + if [ "$pcm_c" == "hw:CODEC,0" ]; then + pcm_c="hw:sofsoundwire,1" + dlogi "Capture device changed to $pcm_c" + else + pcm_p="hw:sofsoundwire,0" + dlogi "Playback device changed to $pcm_p" + fi +fi + + check_locale_for_alsabat # reset sof volume to 0dB