Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1194862pxb; Fri, 21 Jan 2022 12:00:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgVGF6RAL87VvVHSXcE8dKCf5cQAgk7hdPrEzVj3ar4ciKAYPrKCXOODtlS42U+Dcu+TKd X-Received: by 2002:a05:6a00:1a41:b0:4c1:e6e9:3bf4 with SMTP id h1-20020a056a001a4100b004c1e6e93bf4mr5142803pfv.25.1642795208421; Fri, 21 Jan 2022 12:00:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642795208; cv=none; d=google.com; s=arc-20160816; b=AhnYtbVIiSHtRgC3mC25MZx8W/T14dkXNsvORHaUi5Dt+XBIPjJqfzEMvyzvcjpIdm 5yL4zSOIALFxd4xx3EfNuA6WdvII47bAPz8mh8nhx/d2kWe84j9FAUUPWT717623gwNA glDJtB0jaxYc/P7avfiHbPe1+NGB3N2OsBdC+Y4n6tgIc5n+TgDryRnOgSxV0liWEcU8 pk9Qx4OjM7AYpn8dqhkZoraRSFWE1hZhdYFym+TL3H0N0Fi12Vw1sYWNtBnGsTtfEiRS LLAAiqvqjtud2HXoKUnwBjXjWkV/IbPk39r7d4jzsStn+maQZ96MTlQKzgrXNzbgv+lB /s+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=sv13mTMDVKzqT3Ul4Wpi8hnjmel34SssYVJWbe9Tqa0=; b=u218wbU1bXJrfvgvFJ9pEtEejPyKw7jQj0jhqLpLlJQUSXSfuKomN7bQXOK5kMMT0H NkBethNulkFo4KIE0ZSwdIPAxFpnnjVWmv5abciGGXlzSnvpHFVDvAttHIM1YtXE9qfY zZwB0jIYbzxKEnsnepKTdl+ATQxFeOU6+uGchyeHrM9yHWM8B1T5xVG94pmUok5vd6c8 gB93C2UmfVk7PF2lk6x7slCoAurdbeG/EH3HRCD21Kf2SFENin5xPJaRoaKiEnWMiXGx xksoIdRwC4mLJgCqcg13RT4n6xKPXiCMo5q9sO9pyzBtf6cFJflCc1iHETCqFmO7Hkxl 1h+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z20si7002116pgk.122.2022.01.21.11.59.55; Fri, 21 Jan 2022 12:00:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244130AbiASTi2 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 19 Jan 2022 14:38:28 -0500 Received: from coyote.holtmann.net ([212.227.132.17]:51686 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242035AbiASTi1 (ORCPT ); Wed, 19 Jan 2022 14:38:27 -0500 Received: from smtpclient.apple (p4fefca45.dip0.t-ipconnect.de [79.239.202.69]) by mail.holtmann.org (Postfix) with ESMTPSA id A9FB9CECE1; Wed, 19 Jan 2022 20:38:25 +0100 (CET) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.40.0.1.81\)) Subject: Re: Pass through USB Bluetooth wireless interface to QEMU From: Marcel Holtmann In-Reply-To: <331ae35c-7d48-46fc-c4ae-1e60cb0f3378@molgen.mpg.de> Date: Wed, 19 Jan 2022 20:38:25 +0100 Cc: linux-bluetooth@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: References: <331ae35c-7d48-46fc-c4ae-1e60cb0f3378@molgen.mpg.de> To: Paul Menzel X-Mailer: Apple Mail (2.3693.40.0.1.81) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Paul, > To debug the issue with file transfers to the Nokia N9 [1], I would like to pass through the USB Bluetooth wireless to QEMU. > > $ lsusb > Bus 001 Device 004: ID 1bcf:28ae Sunplus Innovation Technology Inc. Laptop Integrated Webcam HD > Bus 001 Device 003: ID 8087:0a2a Intel Corp. Bluetooth wireless interface > Bus 001 Device 002: ID 8087:8001 Intel Corp. Integrated Hub > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub > Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > $ ls -ld /dev/bus/usb/001/003 > crw-rw-rw- 1 root root 189, 2 13. Jan 23:05 /dev/bus/usb/001/003 > > Then following Leif’s article *QEMU USB host device pass-through* [1], I run > > $ qemu-system-x86_64 -version > QEMU emulator version 6.2.0 (Debian 1:6.2+dfsg-1) > Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers > $ sudo qemu-system-x86_64 -cpu host -m 2G -enable-kvm -usb -device usb-host,vendorid=0x8087,productid=0x0a2a -hda /dev/shm/debian-64.img -net nic -net user,hostfwd=tcp::22223-:22 > > (`-device usb-host,hostbus=1,hostport=3` did *not* work for me.) > > In QEMU with *linux-image-5.15.0-2-amd64* 5.15.5-2 and *bluez* 5.62-2 the device is now detected, but bluetoothctl does not detect the controller. (Starting QEMU as root does not make a difference.) > > # lsusb > Bus 001 Device 002: ID 8087:0a2a Intel Corp. Bluetooth wireless interface > Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > # lsusb -t > /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M > |__ Port 1: Dev 2, If 0, Class=Wireless, Driver=btusb, 12M > |__ Port 1: Dev 2, If 1, Class=Wireless, Driver=btusb, 12M > > # bluetoothctl > Agent registered > [bluetooth]# list > [bluetooth]# > > # systemctl status bluetooth > ● bluetooth.service - Bluetooth service > Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled) > Active: active (running) since Thu 2022-01-13 23:05:25 CET; 6min ago > Docs: man:bluetoothd(8) > Main PID: 400 (bluetoothd) > Status: "Running" > Tasks: 1 (limit: 2326) > Memory: 4.4M > CPU: 24ms > CGroup: /system.slice/bluetooth.service > └─400 /usr/libexec/bluetooth/bluetoothd > > Jan 13 23:05:25 qemu systemd[1]: Starting Bluetooth service... > Jan 13 23:05:25 qemu bluetoothd[400]: Bluetooth daemon 5.62 > Jan 13 23:05:25 qemu systemd[1]: Started Bluetooth service. > Jan 13 23:05:25 qemu bluetoothd[400]: Starting SDP server > Jan 13 23:05:25 qemu bluetoothd[400]: Bluetooth management interface 1.21 initialized > > Linux in QEMU logs: > > > # dmesg | grep -e Bluetooth -e hci0 > [ 4.385414] Bluetooth: Core ver 2.22 > [ 4.385453] Bluetooth: HCI device and connection manager initialized > [ 4.385741] Bluetooth: HCI socket layer initialized > [ 4.385744] Bluetooth: L2CAP socket layer initialized > [ 4.385751] Bluetooth: SCO socket layer initialized > [ 4.593802] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 > [ 4.593806] Bluetooth: BNEP filters: protocol multicast > [ 4.593809] Bluetooth: BNEP socket layer initialized > [ 6.544261] Bluetooth: hci0: Reading Intel version command failed (-110) > [ 6.544310] Bluetooth: hci0: command tx timeout > > The firmware is installed: > > # ls /lib/firmware/intel/ibt-hw-37.8.10-fw-1.10.3.11.e.bseq > /lib/firmware/intel/ibt-hw-37.8.10-fw-1.10.3.11.e.bseq > > Do you have an idea, how to get it working? actually I never bothered with passing through USB directly. I let the host keep the hci0 and then use something like btproxy or alike to forward the HCI device into the guest as virtio_bt. Qemu is missing support for virtio_bt device and most of the code I am using is not public, but something someone can work on inside Qemu. Regards Marcel