It sounds like you're experiencing a Bluetooth-related crash (bluetoothd segfault) when your Arch Linux system with Xfce suspends, leading to buzzing noises. This issue can stem from various sources, including software bugs, configuration problems, or hardware compatibility issues. Here's a comprehensive approach to diagnose and resolve the problem:
1. Ensure System is Fully Updated
First, make sure your system and all packages are up-to-date. This can resolve issues caused by known bugs that have been fixed in newer versions.
sudo pacman -Syu
After updating, reboot your system to apply any kernel or service updates:
sudo reboot
2. Verify Bluetooth Packages
Ensure that you have the latest Bluetooth-related packages installed:
sudo pacman -S bluez bluez-utils bluez-firmware
3. Check Bluetooth Service Status
After updating, check the status of the Bluetooth service to see if it's running correctly:
systemctl status bluetooth.service
Look for any errors or warnings that might indicate issues beyond the segfault.
4. Disable Bluetooth Autosuspend
Power management features like autosuspend might interfere with Bluetooth functionality. Disabling autosuspend for the Bluetooth adapter can help:
-
Identify Your Bluetooth Adapter:
Use lsusb to find your Bluetooth adapter’s vendor and product ID.
lsusb | grep -i bluetooth
Example output:
Bus 001 Device 005: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Here, 0a12 is the vendor ID and 0001 is the product ID.
-
Create a Udev Rule:
Create a new udev rule to disable autosuspend for your Bluetooth adapter.
sudo nano /etc/udev/rules.d/10-bluetooth-autosuspend.rules
Add the following line, replacing 0a12 and 0001 with your adapter’s vendor and product IDs:
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0a12", ATTR{idProduct}=="0001", TEST=="power/control", ATTR{power/control}="on"
-
Reload Udev Rules:
sudo udevadm control --reload
sudo udevadm trigger
5. Modify Bluetooth Service for Suspend/Resume
Ensure that the Bluetooth service handles suspend and resume correctly by restarting it upon resume.
-
Create a Systemd Sleep Hook:
sudo nano /lib/systemd/system-sleep/bluetooth-restart.sh
-
Add the Following Script:
#!/bin/sh
case "$1" in
post)
systemctl restart bluetooth.service
;;
esac
-
Make the Script Executable:
sudo chmod +x /lib/systemd/system-sleep/bluetooth-restart.sh
6. Investigate and Handle bluetoothd Crash
Since bluetoothd is crashing with a segmentation fault, consider the following steps:
-
Check for Known Bugs:
-
Review Detailed Logs:
Examine more detailed logs to pinpoint the issue.
journalctl -xeu bluetooth.service
Look for patterns or specific errors that occur before the crash.
-
Reinstall BlueZ and Related Packages:
Corrupted installations can cause unexpected crashes.
sudo pacman -Syyu bluez bluez-utils bluez-firmware
-
Check for Conflicting Services or Configurations:
Ensure that no other services or custom configurations are conflicting with Bluetooth.
- Disable any custom Bluetooth scripts or tools temporarily to see if the issue persists.
- If using a Bluetooth manager (e.g.,
blueman), try uninstalling it to test if bluetoothd remains stable.
-
Consider Downgrading BlueZ:
If the issue started after a recent update, you might want to downgrade BlueZ to a previous stable version using the Arch Linux Archive or Arch Rollback Machine.
7. Adjust Audio Settings to Prevent Buzzing
The buzzing noise might be related to audio devices reinitializing improperly when bluetoothd crashes. To mitigate this:
-
Restart PulseAudio or PipeWire:
Depending on your audio backend, restart it after resuming from suspend.
For PulseAudio:
pulseaudio -k
pulseaudio --start
For PipeWire:
systemctl --user restart pipewire
systemctl --user restart pipewire-pulse
-
Set Appropriate Audio Profiles:
Ensure that your Bluetooth audio devices are set to the correct profiles (e.g., A2DP Sink for high-quality audio).
-
Use alsamixer or pavucontrol:
Adjust audio levels and settings to minimize buzzing or interference.
8. Alternative Bluetooth Managers
If you're using a specific Bluetooth manager within Xfce, try switching to an alternative like Blueman, which is known for better stability in some cases.
sudo pacman -S blueman
After installation, launch Blueman and manage your Bluetooth devices through it.
9. Kernel Considerations
Bluetooth functionality is tightly coupled with the kernel. Ensure you’re using a stable and recent kernel version that supports your Bluetooth hardware.
-
Check Current Kernel Version:
uname -r
-
Install the Latest Kernel:
sudo pacman -S linux
Reboot after installation.
-
Consider Alternative Kernels:
If issues persist, you might try the LTS (Long-Term Support) kernel.
sudo pacman -S linux-lts
Update your bootloader configuration accordingly and reboot.
10. Final Steps: Seek Community Support
If after following all the above steps the issue remains unresolved:
-
Arch Linux Forums: Post detailed information about your issue, including logs and steps you've taken, on the Arch Linux Forums.
-
Reddit: The r/archlinux subreddit is also a valuable resource.
-
Bug Reports: Consider filing a bug report with the BlueZ project, including the core dump and relevant logs to aid developers in diagnosing the issue.
Summary
By systematically updating your system, adjusting Bluetooth and power management settings, investigating the cause of the bluetoothd crash, and ensuring proper audio configurations, you can address the Bluetooth issues and eliminate the buzzing noise after suspend. If the problem persists, leveraging community resources and possibly filing a bug report will be essential steps toward a resolution.
Note: Always back up configuration files before making changes, and proceed with caution when modifying system settings.