• (6.7.0-rc3-5) Bluetooth USB key now causes bugs on host and VM (BCM20702A0)


    Warrentheo
    • Minor

    I have a USB bluetooth key (BCM20702A0 Bluetooth 4.0) passed into my VM by USB ID...  Under 6.6.6 and prior, this worked fine, but starting in 6.7.0-rc3 through 6.7.0-rc5 this now seems to get a driver from the host kernel, which causes aberrant behavior on both the host and VM...

     

    Symptoms include:

     

    Full system reboot then boot into Win10 VM with device passed through by ID:

        Device manager boots with the USB device listed, but now shows "This device can not start (Code 10), profiling not started"

        First time I got this, I attempted to use WebUI to detach the device, this acted like it worked, but Windows now showed the device attached and working(???)...  Re-attaching the device Win10 went back to "(Code 10)"... Detaching the device a second time removed the device from Windows entirely, but when Re-attaching a second time, the VM locked up for 2 minutes...

     

    Performed a second full reboot and boot into Win10 VM has different behavior:

        Device again shows as (Code 10) in Windows, but the host WebUI no longer shows either the USB adapter, and now seems to have removed the other USB device I was passing through (a Synaptics USB Finger Print Reader), and the only device now showing is a pair of headphones hooked to the PC to charge, even though the Windows VM does show the device attached but in (Code 10)...

     

    2019-02-23.png.469967601a7dcd4a6da36520504b4be8.png

     

    I assume to fix this I would need to go down the road of disabling the USB driver for this device in the Syslinux config, but do we really want to go down the road of having devices like these having to have special rules that have to be remembered?  Perhaps we can add the driver, but disable it by default? Or is there a driver like VFIO-PCI for usb devices?

     

    I am willing to test solutions since I rarely use Bluetooth (Only noticed this problem when I went into device manager for other reasons), and will be remaining on 6.7.0-rc5 for now...

    qw-diagnostics-20190223-1603.zip

     

    lsusb -v for BCM20702A0 Bluetooth 4.0.txt

    Win10VM.XML




    User Feedback

    Recommended Comments

    Quote

    I assume to fix this I would need to go down the road of disabling the USB driver for this device in the Syslinux config, but do we really want to go down the road of having devices like these having to have special rules that have to be remembered?  Perhaps we can add the driver, but disable it by default?

    Yes unfortunately this is the future.  The BT drivers were added so that these devices can be utilized by Docker containers.  Similarly, when we add GPU drivers, eg, for amd and nvidia, the same issue will exist.

     

    The problem is: for containers, the Unraid host must bind devices to host drivers.  For virtual machines, the Unraid host most not bind devices to host drivers (in general).  We plan to include a UI to make this easily configurable.

     

    Quote

    Or is there a driver like VFIO-PCI for usb devices?

    Not that I'm aware of.  One option is to pass the entire USB controller through to the VM.  Give us some time to think about whether there's a better way.

    • Upvote 1
    Link to comment

    I actually do pass through a 5-port USB card to the VM as well, but every port is in use...  My motherboard has a lot of ports, but none of them can be passed through for various reasons...  I used the passthrough method for less important devices that were always attached so that I could use some of the motherboard ports...

     

    One question, does this mean that using a USB Bluetooth in docker versus vm's are mutually exclusive?  Are the command line commands to switch between them?  And bottom line, how much of this can be automated in WebUI?

     

    For now, what do I add to my syslinux to kill this driver for now?

    Link to comment
    21 minutes ago, Warrentheo said:

    For now, what do I add to my syslinux to kill this driver for now?

     

    In your diagnostics.zip is the file system/lsmod.txt which is:

    Module                  Size  Used by
    acpi_pad               20480  0
    aes_x86_64             20480  1 aesni_intel
    aesni_intel           200704  0
    ahci                   40960  5
    backlight              16384  1 video
    bluetooth             319488  4 btrtl,btintel,btbcm,btusb
    btbcm                  16384  1 btusb
    btintel                16384  1 btusb
    btrtl                  16384  1 btusb
    btusb                  40960  0
    button                 16384  0
    cdrom                  32768  1 sr_mod
    coretemp               16384  0
    crc32_pclmul           16384  0
    crc32c_intel           24576  0
    crct10dif_pclmul       16384  0
    cryptd                 20480  3 crypto_simd,ghash_clmulni_intel,aesni_intel
    crypto_simd            16384  1 aesni_intel
    dax                    20480  1 dm_mod
    dm_mod                110592  1
    e1000e                180224  0
    ecdh_generic           20480  1 bluetooth
    ghash_clmulni_intel    16384  0
    glue_helper            16384  1 aesni_intel
    i2c_core               40960  1 i2c_i801
    i2c_i801               24576  0
    intel_cstate           16384  0
    intel_powerclamp       16384  0
    intel_rapl_perf        16384  0
    intel_uncore          102400  0
    ip6_tables             24576  1 ip6table_filter
    ip6table_filter        16384  0
    ip_tables              24576  3 iptable_filter,iptable_nat,iptable_mangle
    ipt_MASQUERADE         16384  4
    ipt_REJECT             16384  2
    iptable_filter         16384  1
    iptable_mangle         16384  1
    iptable_nat            16384  1
    kvm                   360448  1 kvm_intel
    kvm_intel             204800  9
    libahci                28672  1 ahci
    md_mod                 49152  3
    mxm_wmi                16384  0
    nf_nat                 24576  1 nf_nat_ipv4
    nf_nat_ipv4            16384  2 ipt_MASQUERADE,iptable_nat
    nvme                   32768  2
    nvme_core              45056  5 nvme
    pcbc                   16384  0
    pcc_cpufreq            16384  0
    sr_mod                 20480  0
    tap                    20480  1 vhost_net
    tun                    36864  4 vhost_net
    vhost                  32768  1 vhost_net
    vhost_net              24576  1
    video                  40960  0
    wmi                    20480  2 wmi_bmof,mxm_wmi
    wmi_bmof               16384  0
    x86_pkg_temp_thermal    16384  0
    xfs                   659456  3
    xt_CHECKSUM            16384  1
    

     

    Inside your 'go' file you can try and unload those bluetooth modules, for example maybe something like this:

    rmmod bluetooth
    rmmod btbcm
    rmmod btintel
    rmmod btrtl
    rmmod btusb

     

    Sorry without that h/w I can't try it for you first.  You can type those commands via webterminal to find out how many drivers to remove before you have success in your VM.

     

    Note: we have noticed, with certain GPU cards, this technique does not always work because the host driver puts the card in a state where, despite unlinking from driver, the VM can't initialize properly.  Hopefully this is not the case with your BT device.

    Link to comment

    Added that to my go file (Reversed the order, because when I tried to type them manually, they said that bluetooth required some of the sub modules, so I tried to unload the sub modules first) :

    ......
    
    rmmod btusb
    rmmod btrtl
    rmmod btintel
    rmmod btbcm
    rmmod bluetooth
    
    # Start the Management Utility
    /usr/local/sbin/emhttp &

    and it causes these lines right after the winbindd -D part of the boot process:

    rmmod: ERROR: Module btusb is not currently loaded
    rmmod: ERROR: Module btrtl is not currently loaded
    rmmod: ERROR: Module btintel is not currently loaded
    rmmod: ERROR: Module btbcm is not currently loaded
    /var/tmp/go: line 15: $'r\357\273\277mmod': command not found

    Edited the go file with nano from the web cli, so I don't think it is a Windows text file issue...

     

    According to the internet, I added this to my syslinux config as my next attempt:

    ... bluetooth.blacklist=yes ...

    That showed up as this error in my syslog:

     bluetooth: unknown parameter 'blacklist' ignored

    Can't seem to find a way to kill this for now...  Not a huge issue for me for now, but currently will require me to rollback to 6.6.7 to be able to use Bluetooth in my VM for now (nothing I seem to find will let me attach it without it being (Code 10) for now...)

    Link to comment

    I have been trying to kill this driver for a while, and have been unable to find a workable solution...  I even reported the question General support:

    and have been unable to get an answer...  The normal solutions I have found on the internet are not working under UnRaid apparently...  I am willing to try and help any way I can, but I am stuck...

     

    We need to have a way in place to kill this if needed before 6.7.0 rolls out...  Thank you in advance, I really like UnRaid and use it everyday, and your help on this is appreciated 🙂 

    Link to comment
    On 2/23/2019 at 8:33 PM, Warrentheo said:

    According to the internet, I added this to my syslinux config as my next attempt:

    You can try adding this on your append line:

    module_blacklist=bluetooth,btbcm,btintel,btrtl,btusb

    For example, for GUI mode boot, the syslinux append line would read:

    append initrd=/bzroot,/bzroot-gui module_blacklist=bluetooth,btbcm,btintel,btrtl,btusb

     

    Link to comment

    *********************************************

    EDIT: Turns out my system really is having a GPU issue, will deal with RMA and retest this fix...

    *********************************************

     

    Adding this caused several other issues...  It booted but was glitchy at first, but still didn't allow bluetooth usb passthrough...  During playing a game with it on it suddenly crashed out, and the VM would no longer boot, it seems it breaks my daily driver Win10 VM with the webgui error message:

    Execution error internal error: Unknown PCI header type '127'

    Which from what I can see on other posts means that it is not able to do GPU passthrough correctly anymore:

     

    At first I thought I had killed my video card somehow (didn't think it could be bluetooth related), and tried several things to fix the issue, manually rebuilding the VM XML, didn't work, completely rebuilding the libvirt image and then manually rebuilding the VM's xml's didn't help either.. I decided just for troubleshooting that I would undo the bluetooth settings: 

      append fbcon=rotate:1 module_blacklist=bluetooth,btbcm,btintel,btrtl,btusb BIND=01:00.0 pci=noaer initrd=/bzroot

    and switched it back to:

      append fbcon=rotate:1 BIND=01:00.0 pci=noaer initrd=/bzroot

    and after a reboot, I was able to get my daily driver back...  I have attached a diagnostics and vm xml file from just before switching off the blacklist in sysconfig and rebooting...

    qw-diagnostics-20190324-1905.zip

    war.xml

     

     

    Edited by Warrentheo
    Link to comment

    The best solution to this is going to be a hardware solution.  That is, you need to pass the entire USB controller to your VM and use those attached ports for your bluetooth device.  The USB subsystem emulation in KVM is dicey at best.

    Link to comment


    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Status Definitions

     

    Open = Under consideration.

     

    Solved = The issue has been resolved.

     

    Solved version = The issue has been resolved in the indicated release version.

     

    Closed = Feedback or opinion better posted on our forum for discussion. Also for reports we cannot reproduce or need more information. In this case just add a comment and we will review it again.

     

    Retest = Please retest in latest release.


    Priority Definitions

     

    Minor = Something not working correctly.

     

    Urgent = Server crash, data loss, or other showstopper.

     

    Annoyance = Doesn't affect functionality but should be fixed.

     

    Other = Announcement or other non-issue.