4

Update: Upgrading to Ubuntu 20.04.1 has now permanently resolved this issue for me.

Edit: This is more complicated than I first noted. I don't only lose the scrolling capability on suspend, it is also lost on when the system starts power-saving. I fiddled with power-save options to no avail. I have found a solution which I will post in the answers below.

I just installed Ubuntu 19.04 on my Dell Laptop (Latitude 1790) and I'm using a Microsoft Arc Mouse. When the laptop suspends and then resumes the Arc Mouse continues to work but scrolling stops functioning with the touch surface.

Restarting the laptop re-enables scrolling. However, stop and restarting bluetooth and re-pairing the mouse do not re-enable scrolling.

I suspect something related to this question may solve the problem:

Scrolling not working after suspend, looking for permanent solution

Unfortunately, I don't know how to determine the mouse device to put in the script to re-probe the device and restart scrolling. Can anyone tell me how to determine the device? Alternatively, is there another approach to solving this issue?

I've looked in lsmod but there isn't anything obvious. Here are the two lines that mention bluetooth.

bluetooth             557056  43 btrtl,btintel,btbcm,bnep,btusb,rfcomm
ecdh_generic           28672  2 bluetooth

Here are all the lsmod devices listed above or that contain bt.

dell_rbtn              20480  0
btusb                  49152  0
btrtl                  20480  1 btusb
btbcm                  16384  1 btusb
btintel                24576  1 btusb
bluetooth             557056  43 btrtl,btintel,btbcm,bnep,btusb,rfcomm

The laptop also has a touchpad and scrolling continues to work on the touchpad after suspend. I think this means the issue is isolated to the Arc Mouse.

Digging a little deeper, I found that /etc/init.d/ contains the scripts for the services and /etc/init.d/bluetooth is the script that brings up and shuts down the bluetooth service. This appears to be the relevant portion.

start)
        log_daemon_msg "Starting $DESC"

        if test "$BLUETOOTH_ENABLED" = 0; then
                log_progress_msg "disabled. see /etc/default/bluetooth"
                log_end_msg 0
                exit 0
        fi

        start-stop-daemon --start --background $SSD_OPTIONS
        log_progress_msg "${DAEMON##*/}"

        run_sdptool || :

        if test "$HID2HCI_ENABLED" = 1; then
                enable_hci_input
        fi

        log_end_msg 0
  ;;
  stop)
        log_daemon_msg "Stopping $DESC"
        if test "$BLUETOOTH_ENABLED" = 0; then
                log_progress_msg "disabled."
                log_end_msg 0
                exit 0
        fi
        if test "$HID2HCI_UNDO" = 1; then
                disable_hci_input
        fi
        start-stop-daemon --stop $SSD_OPTIONS
        log_progress_msg "${DAEMON}"
        log_end_msg 0
  ;;

Does there appear to be anything I can run from here that will allow me to reset just the mouse and not the entire subsystem?

8
  • Do you have a driver names psmouse too? Apr 23, 2019 at 22:04
  • There is no dev psmouse. It is a bluetooth mouse so it is connected through the bluetooth sub-system. sudo lsmod | grep psmouse shows psmouse is not present.
    – RaidPinata
    Apr 23, 2019 at 22:08
  • If I restart the bluetooth service, using sudo service bluetooth restart, I get scroll functionality back. Based on one of the answers to [askubuntu.com/questions/1040497/…. I'd hope I could do something a bit less extreme.
    – RaidPinata
    Apr 23, 2019 at 22:11
  • What makes it extreme? Apr 23, 2019 at 23:08
  • 1
    I might have been looking at the wrong MS Arc Mouse: microsoft.com/accessories/en-us/products/mice/arc-touch-mouse/… This has a USB Nano which would work with the script I just posted here: askubuntu.com/a/1137885/307523 This script I just posted was the same one I was thinking of for you. You can try it and it can't hurt. Then delete it if it doesn't make life better. Apr 24, 2019 at 23:29

2 Answers 2

4

I just want to tack onto your own answer because some might prefer a more automated approach to this. So from the beginning:

Create script /usr/local/sbin/restart-bluetooth.sh

#!/bin/bash
service bluetooth restart

Then(from Answer) create script in sleep directory /lib/systemd/system-sleep/00restart-bluetooth.sh

#!/bin/sh
if [ $1 = post ] && [ $2 = suspend ]
then /usr/local/sbin/restart-bluetooh.sh
fi

Then make sure the script is executable

chmod a+x /lib/systemd/system-sleep/00restart-bluetooh.sh

This works every time you wake up your machine. However, I have not tried with password lockscreen disabled.

4
  • This is great Kevin. I'll test it out. If it works for me I'll change this to the selected answer.
    – RaidPinata
    Feb 4, 2020 at 20:05
  • Great, thanks and yeah please let me know! My Arc Mouse is unfortunately still disconnecting for seemingly a different issue altogether now and I can't replicate it. It no longer happens on system suspend at least now. Feb 5, 2020 at 0:58
  • Kevin, I found that mine was happening in a pre-suspend phase (my screen goes dim) but before true suspend or screen-lock. That was part of the reason for my using my manual solution.
    – RaidPinata
    Feb 5, 2020 at 21:11
  • I looked further and found this- bbs.archlinux.org/viewtopic.php?id=245455 .. I know that's an Arch Linux forum, but still, I'm wondering if maybe it could potentially be a harder problem to solve if its related to kernel version. Feb 7, 2020 at 23:31
2

As I mentioned earlier, this occurs more than just coming out of suspend. Therefore, I need the solution to work after I come out of suspend but also be able to do it manually when power-save gets activated without going all the way to suspend.

As @WinEunuuchs2Unix and I came to in the comments, the simplest solution is to just restart bluetooth using sudo services bluetooth restart. This takes down and brings up the bluetooth and re-enables the mouse scrolling. Having to do this in a command line all the time was kind of annoying so I decided to make things a little easier on myself.

Following the information found here, I created the script in /usr/local/sbin/restart_bluetooth.sh with the following content.

#!/bin/bash
service bluetooth restart

This can be made to run without a password by editing the sudoers file using sudo visudo. After the line %sudo ALL=(ALL:ALL) ALL, I added the info for the script, using my username.

username  ALL=(ALL) NOPASSWD: /usr/local/sbin/restart_bluetooth.sh

Now that I have a working script that doesn't require a password. I set up an icon on my launcher using this guide by installing gnome-desktop-item-edit using the command sudo apt install --no-install-recommends gnome-panel. Then I created a new .desktop file by running gnome-desktop-item-edit ~/Desktop/ --create-new. The final .desktop file looks like this.

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=/usr/share/icons/ubuntu-mono-dark/status/24/bluetooth-active.svg
Name[en_US]=Restart Bluetooth
Comment[en_US]=Restarts bluetooth service to fix scrolling issue.
Exec=sudo /usr/local/sbin/restart_bluetooth.sh
Comment=Restarts bluetooth service to fix scrolling issue.
Name=Restart Bluetooth
Icon=bluetooth

Now I can fix the issue with a single click after making the icon a favorite on my launcher.

4
  • This is not a fix, but a workaround.
    – Dshiz
    Dec 26, 2019 at 9:10
  • note, it's "service bluetooth restart" (service in single form) not "serviceS bluetooth restart"
    – vir us
    Jan 5, 2020 at 12:34
  • @Dshiz, you are correct that this is a workaround. Unfortunately, I don't have any idea what is going wrong and this does what I need.
    – RaidPinata
    Jan 6, 2020 at 23:28
  • @vir us, I have fixed the typo. Thanks
    – RaidPinata
    Jan 6, 2020 at 23:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .