Link Menu Search Expand Document

Troubleshooting

Table of contents

  1. USB issues
  2. Crash after suspend (sleep)
  3. Network
    1. Slow wifi between clients
    2. General slow wifi on Linux
  4. Keyboard volume keys not working
  5. Network connection (wifi) stops working

USB issues

Sometimes after the computer idles for a bit, my mouse stops working and I get the error (on dmesg) saying:

[2579695.232432] usb 1-2: new full-speed USB device number 81 using xhci_hcd
[2579695.232590] usb 1-2: Device not responding to setup address.
[2579695.440575] usb 1-2: Device not responding to setup address.
[2579695.648431] usb 1-2: device not accepting address 81, error -71
[2579695.648525] usb usb1-port2: unable to enumerate USB device
[2579696.780284] usb 1-2: new full-speed USB device number 82 using xhci_hcd
[2579696.912235] usb 1-2: device descriptor read/64, error -71

Disconnecting the device for a few seconds and then reconnecting it sometimes works. If that doesn’t work, try this (as root):

echo Y > /sys/module/usbcore/parameters/old_scheme_first
echo Y > /sys/module/usbcore/parameters/use_both_schemes

Then disconnect the device for a few seconds and reconnect it.

Crash after suspend (sleep)

NOTE: this is most likely unrelated to the issue I have, but not sure what else to try at this point.

Not sure yet why this happens, or even if this solves the issue but should be worth trying.

As root, run:

echo XHC > /proc/acpi/wakeup

Check this post for more info: https://askubuntu.com/questions/987755/suspend-not-working-help-needed-to-debug

Network

Slow wifi between clients

I had two laptops (A and B) connected to the same wifi.

When laptop A pinged the router, response time was around 3ms. When laptop B pinged the router, response time was around 3ms.

When laptop A pinged laptop B, response time was over 300ms.

Seems to be an issue with wireless card power. On both laptops, run:

sudo iwconfig wlan0 power off

Replace wlan0 with the name of your interface. Test pinging again.

For me, this solved the issue and pings between laptop A and B are now around 4ms.

General slow wifi on Linux

If you are using the iwlwifi driver, what helped me was editing the /etc/modprobe.d/iwlwifi.conf file and adding the following lines to it:

options iwlwifi swcrypto=1
options iwlwifi 11n_disable=8
options iwlwifi bt_coex_active=0

Turn off wifi, reload the iwlwifi module (rmmod iwlwifi && modprobe iwlwifi) and check if it got any better.

Keyboard volume keys not working

They keys for raising, lowering and muting the volume on X11 are respectively:

  • XF86AudioRaiseVolume
  • XF86AudioLowerVolume
  • XF86AudioMute

When using i3 you have to bind those keys to the appropriate command that they should execute. In my case, I use pactl set-sink-volume to set the volume and pactl set-sink-mute to mute or unmute the sound.

Run pactl list sinks to figure out the sink number that needs to be passed as argument for set-sink-volume. I use the following bindings for i3 to deal with this stuff:

bindsym XF86AudioRaiseVolume exec --no-startup-id ~/bin/change-volume.sh up 
bindsym XF86AudioLowerVolume exec --no-startup-id ~/bin/change-volume.sh down
bindsym XF86AudioMute exec --no-startup-id ~/bin/change-volume.sh mute

The change-volumen.sh script looks like the following:


#!/bin/sh

if [ "$#" -ne 1 ]; then
    echo "Usage: $0 <up|down|mute>"
fi

sinks=$(pactl list sinks | grep "Name: "|cut -d':' -f2)
echo $sinks

vol=""

for sink in $sinks; do
    case "$1" in
        up) 
            pactl set-sink-volume "$sink" +5%
        ;;

        down)
            pactl set-sink-volume "$sink" -5%
        ;;

        mute)
            pactl set-sink-mute "$sink" toggle
        ;;

        *)
            echo "Invalid command $1"
        ;;
    esac
done

Network connection (wifi) stops working

In my Arch Linux install my wireless connection would stop working after sometime (usually when I left the computer idle for some time and then came back to it). The connection would still show as active, but I couldn’t ping anything (not even the local gateway) and of course, couldn’t really connect to anything. Whenever I’d try to open a website, the browser would just stay forever in a state trying to load it and eventually would time out.

The solution ended up being described in this forum post. In summary, I just added the following to the file /etc/sysctl.d/10.wmem_max_fix_disconnection.conf:

net.core.wmem_max = 2097152

Then reboot the machine, and you are good to go. If you don’t want to reboot the machine right away, run the following command instead:

$ echo 2097152 | sudo tee /proc/sys/net/core/wmem_max

Gilgalab Knowledge Base