I’ve set up a separate user account on my system for work-related stuff. I usually use my employer’s hardware, but we’re allowed to use our own device and sometimes it’s simply convenient to work on my linux instead of a Mac.

This has led me to a problem that I haven’t encountered before: bluetooth seems straight-up wonky when I switch between users. I have bluetooth headphones, for example, that have always worked fine. Noticing that they didn’t receive any sound when I switched to the work account was the first hiccup.

No problem, I thought, I’ll re-pair every time I switch from the one account to the other. No such luck. Pairing works, but it’s associated with the previous account. Not even “forgetting” the device helped.

No problem, I thought. I’ve got an extra bluetooth headset. I’ll pair the one while I’m in the one account and the other while I’m in the other account. No such luck. I get stuck in a “connected”, “disconnected” loop.

I had hoped that this was an audio issue and used arch’s pulseaudio documentation to make audio sharable between accounts, which worked for a wired connect, but it’s at that point that I realized, this doesn’t work for bluetooth devices, because of the issues described above.

Has anyone managed to get this working? I’m open to workarounds, as long as they work consistently and allow me to switch back and forth between accounts.

  • hallettj@leminal.space
    link
    fedilink
    English
    arrow-up
    3
    ·
    6 days ago

    I’ve got a solution for a situation that is temptingly similar, but unfortunately probably not helpful for your specific case since I’m using partitions instead of user accounts. I have a separate partition for work (specifically a second SSD) because my employer insisted I install remote access software, and that’s not going on my personal partition. I ran into a problem where my Bluetooth MAC is the same on both partitions (because it’s the same device), but only one partition has the pairing keys for my headphones. On the other partition the headphones see the computer as an already-paired device, so refuse to pair again, but can’t connect either due to lack of a key.

    I fixed the problem by copying the pairing state files from one partition to the other, and now my devices connect seamlessly either way. I think those files are in /var/lib/bluetooth/<BT-Adapter-MAC-address>, but my memory isn’t super clear.

    • Entitle9294@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 days ago

      That’s exactly the route that I was going. Although I’m back at work today and noticed that even a usb-connected wired headset has some issues. I have to do some more testing, but the only way I’ve been able to make things work seamlessly is by logging out with my private user entirely while I’m working :/

  • just_another_person@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    6 days ago

    There’s a few things at play here, but the main thing is that whatever Bluetooth daemon is running is likely running in userspace. Switch users, get a different PID and Bluetooth daemon.

    It looks like Arch uses Bluez as root by default though, so is it possible you have another BT manager in the mix somewhere?

    • Entitle9294@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 days ago

      I’m using Gnome and whatever it uses under the hood for bluetooth. Restarting the daemon might be worth exploring though, at least to see if behavior changes.