pipewire/src/tools/pw-gather-bluetooth-debug-info.sh

44 lines
1.5 KiB
Bash
Raw Normal View History

#!/bin/bash
LOGNAME=bt-debuginfo-$(date +%Y%m%d-%H%M%S).txt
echo "-------- cat /proc/version" >> "/tmp/$LOGNAME"
2021-01-13 11:54:52 +01:00
cat /proc/version > "/tmp/$LOGNAME"
2021-01-13 11:54:52 +01:00
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 "-------- hciconfig" >> "/tmp/$LOGNAME"
hciconfig >> "/tmp/$LOGNAME"
echo "-------- hciconfig hci0 features" >> "/tmp/$LOGNAME"
hciconfig hci0 features >> "/tmp/$LOGNAME"
if [ "$(id -u)" = "0" ]; then
2021-01-13 11:54:52 +01:00
echo "-------- cat /sys/kernel/debug/usb/devices" >> "/tmp/$LOGNAME"
cat /sys/kernel/debug/usb/devices >> "/tmp/$LOGNAME"
else
2021-01-13 11:54:52 +01:00
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
2021-01-13 11:54:52 +01:00
echo "-------- bluetoothctl devices" >> "/tmp/$LOGNAME"
bluetoothctl devices >> "/tmp/$LOGNAME"
2021-01-13 11:54:52 +01:00
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"