Skip to content

Commit db2e3b5

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

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

case-lib/lib.sh

Lines changed: 12 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,16 @@ 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 "Updated topology filename to: $old_topology"
1478+
1479+
# Reload drivers
1480+
echo "Reloading drivers"
1481+
sudo "$remove_script"
1482+
sudo "$insert_script"
1483+
fi
1484+
check_topology
14811485
}
14821486

14831487
# Play sound and record it

0 commit comments

Comments
 (0)