diff --git a/src/tools/pw-gather-bluetooth-debug-info.sh b/src/tools/pw-gather-bluetooth-debug-info.sh new file mode 100755 index 000000000..e63ffc4dd --- /dev/null +++ b/src/tools/pw-gather-bluetooth-debug-info.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +LOGNAME=bt-debuginfo-$(date +%Y%m%d-%H%M%S).txt + +echo "-------- cat /proc/version" >> "/tmp/$LOGNAME" +cat /proc/version > "/tmp/$LOGNAME" + +echo "-------- lsusb -v 2>&1 | egrep 'bDeviceProtocol(.*)Bluetooth' -B7 | head -1 " >> "/tmp/$LOGNAME" +lsusb -v 2>&1 | egrep 'bDeviceProtocol(.*)Bluetooth' -B7 | head -1 >> "/tmp/$LOGNAME" + +echo "-------- btmgmt info" >> "/tmp/$LOGNAME" +btmgmt info >> "/tmp/$LOGNAME" + +echo "-------- hciconfig hci0 features" >> "/tmp/$LOGNAME" +hciconfig hci0 features >> "/tmp/$LOGNAME" + + +if [ "$(id -u)" = "0" ]; then + echo "-------- cat /sys/kernel/debug/usb/devices" >> "/tmp/$LOGNAME" + cat /sys/kernel/debug/usb/devices >> "/tmp/$LOGNAME" +else + echo "-------- cat /sys/kernel/debug/usb/devices skipped" >> "/tmp/$LOGNAME" + echo "WARNING: Skipping the collection of kernel usb debug info (can only be accessed as root)" + echo " To include kernel usb debug info, re-run the script as root/via sudo" + echo " " +fi + +echo "-------- bluetoothctl devices" >> "/tmp/$LOGNAME" +bluetoothctl devices >> "/tmp/$LOGNAME" + +echo "-------- bluetoothctl info" >> "/tmp/$LOGNAME" +bluetoothctl devices | awk '{ print $2 }' | xargs -n 1 bluetoothctl info >> "/tmp/$LOGNAME" + +# avinfo is not installed on every system +echo "-------- avinfo codec information" >> "/tmp/$LOGNAME" +AVINFO=$(which avinfo) +if [ "$AVINFO" = "" ]; then + echo "avinfo not found - probably not installed on system" >> "/tmp/$LOGNAME" +else + bluetoothctl devices | awk '{ print $2 }' | xargs -n 1 "$AVINFO" +fi + +echo "Information on your bluetooth setup collected into /tmp/$LOGNAME"