Skip to content

Commit 02f85b8

Browse files
committed
fix: restoring topology
Signed-off-by: Emilia Kurdybelska <emiliax.kurdybelska@intel.com>
1 parent b40e414 commit 02f85b8

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

case-lib/lib.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,8 @@ update_topology_filename() {
14431443
exit 1
14441444
fi
14451445
if [[ -f "$modprobe_file" ]]; then
1446-
old_topology=$(sudo cat "$modprobe_file")
1446+
modprobe_file_output=$(sudo cat "$modprobe_file")
1447+
old_topology="${modprobe_file_output#*=}"
14471448
echo "Old topology: $old_topology"
14481449
fi
14491450
# Check if the remove and insert scripts exist
@@ -1471,13 +1472,15 @@ update_topology_filename() {
14711472

14721473
# Restore the original topology after the test
14731474
restore_topology() {
1474-
if [[ -f "$old_topology" ]]; then
1475-
echo "$old_topology" | sudo tee "$modprobe_file" > /dev/null
1476-
echo "Restored original topology: $old_topology"
1477-
sudo "$remove_script"
1478-
sudo "$insert_script"
1479-
fi
1480-
check_topology
1475+
if [[ -f "$old_topology" ]]; then
1476+
echo "options snd-sof-pci tplg_filename=$old_topology" | sudo tee "$modprobe_file" > /dev/null
1477+
echo "Restored original topology: $old_topology"
1478+
1479+
echo "Reloading drivers"
1480+
sudo "$remove_script"
1481+
sudo "$insert_script"
1482+
fi
1483+
check_topology
14811484
}
14821485

14831486
# Play sound and record it

0 commit comments

Comments
 (0)