From owner-freebsd-usb@freebsd.org Sun Jun 21 03:22:19 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CF3833F7D9 for ; Sun, 21 Jun 2020 03:22:19 +0000 (UTC) (envelope-from tomek@cedro.info) Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49qHsP6RN5z4Jmk for ; Sun, 21 Jun 2020 03:22:17 +0000 (UTC) (envelope-from tomek@cedro.info) Received: by mail-wr1-x434.google.com with SMTP id o11so5678889wrv.9 for ; Sat, 20 Jun 2020 20:22:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cedro.info; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NojLASt5wemuPVtwIu0DhaWM6oQuATjLTjvnG6AlbmI=; b=Q/IS+0s5CRW6qy8OW5PzdwfPOzP4FO4xyXXi0ZkWtL4qGXb5YBKVzdUkeF+AhDTH98 SZHMYr2MGzh4mBOtnq5/BzvYi4F8oAqd58WCI3fMhHM58C6tSnwYgSXAlelbrCqlykw6 uFGf/vg0c2+1sdrmPVQa3CTi0Ux0rAv3uHncUJB7YE3nTJqfa0HU23gkNZjxEjF2ajLv VqLyv9fEe8w+31rWg1WzwNJ62OVz7lmVrv/2Hm+LfIbiJP6q4dYbrIZv0bQ3fVXpkRTW 4je6J5EUwFzeEdocJ1YRmTA+4oKDLMPMXWURLRrBAgGcIdmzHCYL2Em/z5Ag3aQ/tD00 NgTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NojLASt5wemuPVtwIu0DhaWM6oQuATjLTjvnG6AlbmI=; b=DdjjNeHfCOJXhvOBX02mELn3nBzkSNpBO9VEZCk+Jkfv+dxpxd6Efbx93RRR5Sywh5 inkrqYmHrGMJE31DrKkH/Z1j4cViaU53LQ1Tnf6MaB4d4yJ6hOwI0ZfJ9b9H1lux3pfM V0Dq9/jhsGc5rB5U6Wblbdczf70UDVr6qXTJ89z7Z9dp7FvR23WxNnJlhOOPS2N/BBZe rrGcuorkqmtUaCdQ0zlcAJeBdl61mGqXR4V0wKFxbci/ZqX8Dw5NF1ezj7uXg6gFNLmw dvBxem83B9KhJC+WtKlzqGjTAm0mAhhHMOHwk316cpS0PE2zvx5s/0RyWNEbdTyfCh3v BKiw== X-Gm-Message-State: AOAM533TRJteosD0pQioywLPUVZAyFWIXECCMggcsC1WrRW4KEq9oJtR mMJyKBcu9tKU6sOd1Vbuz8S2XM0topMbV+qg0Bi1FA== X-Google-Smtp-Source: ABdhPJyjA4RNRi8iZSsONJQ3691YjiOfUkILwtdILTk4nNr0rTAuz7QGc7bZkmrkRQXPxt7WOTzu22hOlgoblPjkRFc= X-Received: by 2002:a5d:5647:: with SMTP id j7mr3826600wrw.242.1592709736475; Sat, 20 Jun 2020 20:22:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Tomasz CEDRO Date: Sun, 21 Jun 2020 05:20:58 +0200 Message-ID: Subject: Re: USB System hangs after removing Yubikey To: Hans Petter Selasky Cc: Joseph Ward , "freebsd-usb@FreeBSD.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49qHsP6RN5z4Jmk X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cedro.info header.s=google header.b=Q/IS+0s5; dmarc=none; spf=none (mx1.freebsd.org: domain of tomek@cedro.info has no SPF policy when checking 2a00:1450:4864:20::434) smtp.mailfrom=tomek@cedro.info X-Spamd-Result: default: False [-2.73 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[cedro.info:s=google]; NEURAL_HAM_MEDIUM(-0.98)[-0.979]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.01)[-1.006]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; DMARC_NA(0.00)[cedro.info]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[cedro.info:+]; NEURAL_HAM_SHORT(-0.44)[-0.441]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::434:from]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2020 03:22:19 -0000 On Sat, Jun 20, 2020 at 7:22 PM Hans Petter Selasky wrote: > On 2020-06-20 19:03, Joseph Ward wrote: > > Can anyone propose any other troubleshooting steps I should take? > Try doing "procstat -akk", maybe some process is simply not exiting > properly freeing the handle it has got for the USB device. > --HPS I am using Yubikey with gpg-agent and sometimes I have to kill -9 that guy because it hangs but not the whole system :-) -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info From owner-freebsd-usb@freebsd.org Sun Jun 21 21:00:26 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81F82333098 for ; Sun, 21 Jun 2020 21:00:26 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 49qlLK10DBz4cCB for ; Sun, 21 Jun 2020 21:00:24 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: by mailman.nyi.freebsd.org (Postfix) id BCB05333120; Sun, 21 Jun 2020 21:00:24 +0000 (UTC) Delivered-To: usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96B6F33311F for ; Sun, 21 Jun 2020 21:00:24 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49qlLH6j88z4c8k for ; Sun, 21 Jun 2020 21:00:23 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90AB323421 for ; Sun, 21 Jun 2020 21:00:23 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 05LL0NIf085956 for ; Sun, 21 Jun 2020 21:00:23 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 05LL0NeE085955 for usb@FreeBSD.org; Sun, 21 Jun 2020 21:00:23 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Message-Id: <202006212100.05LL0NeE085955@kenobi.freebsd.org> X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@FreeBSD.org using -f From: bugzilla-noreply@FreeBSD.org To: usb@FreeBSD.org Subject: Problem reports for usb@FreeBSD.org that need special attention Date: Sun, 21 Jun 2020 21:00:23 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2020 21:00:31 -0000 To view an individual PR, use: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id). The following is a listing of current problems submitted by FreeBSD users, which need special attention. These represent problem reports covering all versions including experimental development code and obsolete releases. Status | Bug Id | Description ------------+-----------+--------------------------------------------------- Open | 213877 | xhci reset causes panic on SuperMicro A1SRi-2758F Open | 234578 | Support for Sierra Wireless EM7455 modem 2 problems total for which you should take action. From owner-freebsd-usb@freebsd.org Thu Jun 25 01:59:56 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3687B349A01 for ; Thu, 25 Jun 2020 01:59:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 49sjrX0kV1z4MWD for ; Thu, 25 Jun 2020 01:59:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 19055349663; Thu, 25 Jun 2020 01:59:56 +0000 (UTC) Delivered-To: usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18D00349662 for ; Thu, 25 Jun 2020 01:59:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49sjrW70BRz4MJQ for ; Thu, 25 Jun 2020 01:59:55 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB98A1B5CD for ; Thu, 25 Jun 2020 01:59:55 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 05P1xtGO012207 for ; Thu, 25 Jun 2020 01:59:55 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 05P1xtRt012206 for usb@FreeBSD.org; Thu, 25 Jun 2020 01:59:55 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: usb@FreeBSD.org Subject: [Bug 247528] RTL8192EU usb wifi dongle can't connect to AP Date: Thu, 25 Jun 2020 01:59:55 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 12.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: linimon@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: component assigned_to cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 01:59:56 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D247528 Mark Linimon changed: What |Removed |Added ---------------------------------------------------------------------------- Component|kern |usb Assignee|bugs@FreeBSD.org |usb@FreeBSD.org CC| |wireless@FreeBSD.org --- Comment #1 from Mark Linimon --- ^Triage: assign to usb@ but Cc: wireless@ in case someone there has a quick insight. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-usb@freebsd.org Thu Jun 25 10:11:04 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5A94356E46 for ; Thu, 25 Jun 2020 10:11:04 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from sapphire.magnetkern.de (sapphire.magnetkern.de [185.228.139.199]) by mx1.freebsd.org (Postfix) with ESMTP id 49swlD0DHQz3c6H for ; Thu, 25 Jun 2020 10:11:00 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from titanium (p5dd45c70.dip0.t-ipconnect.de [93.212.92.112]) by sapphire.magnetkern.de (Postfix) with ESMTPSA id 3F32912A3 for ; Thu, 25 Jun 2020 10:10:53 +0000 (UTC) Date: Thu, 25 Jun 2020 12:10:52 +0200 From: Jan Behrens To: freebsd-usb@FreeBSD.org Subject: USB reset fails when using a LimeSDR Mini on FreeBSD Message-Id: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49swlD0DHQz3c6H X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jbe-mlist@magnetkern.de designates 185.228.139.199 as permitted sender) smtp.mailfrom=jbe-mlist@magnetkern.de X-Spamd-Result: default: False [-0.62 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.42)[-0.418]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.66)[-0.665]; DMARC_NA(0.00)[magnetkern.de]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_SPAM_SHORT(0.17)[0.165]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:197540, ipnet:185.228.136.0/22, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[93.212.92.112:received] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 10:11:04 -0000 Dear all, I'd like to use a software defined radio "LimeSDR Mini" on FreeBSD utilizing the "SoapySDR library" with a driver from "Lime Suite", but I encounter errors, supposedly in libusb. As I didn't find a FreeBSD package for a LimeSDR Mini driver for SoapySDR, I compiled it from source, downloading the latest Lime Suite release from: https://github.com/myriadrf/LimeSuite/releases/tag/v20.01.0 There are several compilation errors on FreeBSD if you compile everything from the Suite, but it's possible to only build and install the SoapySDR module by typing: mkdir builddir && cd builddir cmake ../ make LMS7Support cp SoapyLMS7/libLMS7Support.so /usr/local/lib/SoapySDR/modules0.7/ The SoapySDRUtil command finds the device: % SoapySDRUtil --find [...] Found device 0 addr = 24607:1027 driver = lime label = LimeSDR Mini [USB 2.0] 1D3AC7FE409032 media = USB 2.0 module = FT601 name = LimeSDR Mini serial = 1D3AC7FE409032 However, trying to initialize the device with the corresponding SoapySDR driver fails. I tracked the error down to the C++ function ConnectionFT601::Open, which is defined in file: LimeSuite-20.01.0/src/ConnectionFTDI/ConnectionFT601.cpp https://github.com/myriadrf/LimeSuite/blob/1c1c202f9a6ae4bb34068b6f3f576f7f8e74c7f1/src/ConnectionFTDI/ConnectionFT601.cpp#L213 if (libusb_reset_device(dev_handle)!=0) return ReportError(-1, "USB reset failed", libusb_strerror(libusb_error(r))); I tried to get help on the myriadrf.org Forum here, where I also posted more detailed error output: https://discourse.myriadrf.org/t/limesdr-mini-with-freebsd/6230 I used FreeBSD 12.1-RELEASE-p6. Any help on this would be appreciated. Is there any way to increase verbosity of libusb or figure out why the USB initialization fails? Kind regards, Jan Behrens From owner-freebsd-usb@freebsd.org Thu Jun 25 10:24:06 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ADB20357618 for ; Thu, 25 Jun 2020 10:24:06 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49sx2F6vLqz3cbm for ; Thu, 25 Jun 2020 10:24:05 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 2A336260306; Thu, 25 Jun 2020 12:23:58 +0200 (CEST) Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD To: Jan Behrens , freebsd-usb@FreeBSD.org References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> From: Hans Petter Selasky Message-ID: Date: Thu, 25 Jun 2020 12:23:37 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49sx2F6vLqz3cbm X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.10 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-0.96)[-0.956]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_MEDIUM(-0.82)[-0.818]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.02)[-0.024]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 10:24:06 -0000 On 2020-06-25 12:10, Jan Behrens wrote: > Any help on this would be appreciated. Is there any way to increase > verbosity of libusb or figure out why the USB initialization fails? What is printed in dmesg? --HPS From owner-freebsd-usb@freebsd.org Thu Jun 25 12:31:44 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA511359E55 for ; Thu, 25 Jun 2020 12:31:44 +0000 (UTC) (envelope-from CeDeROM@tlen.pl) Received: from mx-out.tlen.pl (mx-out.tlen.pl [193.222.135.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49szsW2htMz41yV for ; Thu, 25 Jun 2020 12:31:43 +0000 (UTC) (envelope-from CeDeROM@tlen.pl) Received: (wp-smtpd smtp.tlen.pl 2267 invoked from network); 25 Jun 2020 14:31:34 +0200 Received: from mail-wr1-f54.google.com (cederom@tlen.pl@[209.85.221.54]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 25 Jun 2020 14:31:34 +0200 Received: by mail-wr1-f54.google.com with SMTP id o11so5640891wrv.9 for ; Thu, 25 Jun 2020 05:31:34 -0700 (PDT) X-Gm-Message-State: AOAM5300e15pofurl9YxPoMRK5YK9I8aZN9raSJiqkF1/Kccw72maHqI 3r2fYyJg1LWZchS+aFqog4Y0U3h47VjJBDO2/ToPEQ== X-Google-Smtp-Source: ABdhPJxG69+wUZrHNLzN7w9k7wEkTjgJnFn4mkz+lcaUkwzUV5n+iWS/D5cqc+bH/7oQoyEJXqGNoikFiAQk0oQzoNg= X-Received: by 2002:a5d:4ec7:: with SMTP id s7mr33861806wrv.400.1593088293645; Thu, 25 Jun 2020 05:31:33 -0700 (PDT) MIME-Version: 1.0 References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> In-Reply-To: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> From: CeDeROM Date: Thu, 25 Jun 2020 14:31:21 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD To: Jan Behrens Cc: "freebsd-usb@FreeBSD.org" Content-Type: text/plain; charset="UTF-8" X-WP-MailID: ce139a5b3c2e7eee37dcc7209962a603 X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0W0000A [0UP0] X-Rspamd-Queue-Id: 49szsW2htMz41yV X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of CeDeROM@tlen.pl designates 193.222.135.158 as permitted sender) smtp.mailfrom=CeDeROM@tlen.pl X-Spamd-Result: default: False [-2.56 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.96)[-0.964]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:193.222.135.0/24]; NEURAL_HAM_LONG(-0.97)[-0.966]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; DMARC_NA(0.00)[tlen.pl]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.33)[-0.331]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:31080, ipnet:193.222.135.0/24, country:PL]; RCVD_TLS_LAST(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[193.222.135.158:from] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 12:31:44 -0000 Hello Jan :-) Are you sure you have the correct permissions to read/write /dev/usb* devices? Assuming you are already in the operator group: ***/etc/devfs.rules: [localrules=10] add path 'ugen*' mode 0660 group operator add path 'usb/*' mode 0660 group operator add path 'usb' mode 0770 group operator ***/etc/rc.conf: devfs_system_ruleset="localrules" Best regards :-) Tomek -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info From owner-freebsd-usb@freebsd.org Thu Jun 25 17:59:46 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27B7D340A26 for ; Thu, 25 Jun 2020 17:59:46 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from sapphire.magnetkern.de (sapphire.magnetkern.de [185.228.139.199]) by mx1.freebsd.org (Postfix) with ESMTP id 49t7810FfNz4NTW for ; Thu, 25 Jun 2020 17:59:44 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from titanium (p5dd45c70.dip0.t-ipconnect.de [93.212.92.112]) by sapphire.magnetkern.de (Postfix) with ESMTPSA id 70B9F1319 for ; Thu, 25 Jun 2020 17:59:43 +0000 (UTC) Date: Thu, 25 Jun 2020 19:59:43 +0200 From: Jan Behrens To: freebsd-usb@freebsd.org Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD Message-Id: <20200625195943.a6b32addb3c66c3294ed78ef@magnetkern.de> In-Reply-To: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49t7810FfNz4NTW X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jbe-mlist@magnetkern.de designates 185.228.139.199 as permitted sender) smtp.mailfrom=jbe-mlist@magnetkern.de X-Spamd-Result: default: False [-0.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.42)[-0.415]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.67)[-0.674]; DMARC_NA(0.00)[magnetkern.de]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_SPAM_SHORT(0.09)[0.088]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:197540, ipnet:185.228.136.0/22, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[93.212.92.112:received] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 17:59:46 -0000 On Thu, 25 Jun 2020 12:10:52 +0200 Jan Behrens wrote: > I'd like to use a software defined radio "LimeSDR Mini" on FreeBSD > utilizing the "SoapySDR library" with a driver from "Lime Suite", but I > encounter errors, supposedly in libusb. Maybe the same problem occured in MacOS's libusb. Compare the following posts: https://github.com/myriadrf/LimeSuite/issues/253 https://discourse.myriadrf.org/t/limesdr-mini-with-freebsd/6230/7 In both cases there is an issue when calling the libusb_reset_device() function. The problem on MacOS seems to have been fixed according to this post: https://github.com/myriadrf/LimeSuite/issues/253#issuecomment-480263517 Look at the following patch: https://github.com/libusb/libusb/commit/a0b5d27fa7f2bba11965e2b70533f925a5772808 The patch seems to be darwin-specific. Is the same bug affecting FreeBSD or is this a different issue? Can the problem be solved for FreeBSD as well? Kind Regards, Jan Behrens From owner-freebsd-usb@freebsd.org Thu Jun 25 18:05:46 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E26F340D82 for ; Thu, 25 Jun 2020 18:05:46 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from sapphire.magnetkern.de (sapphire.magnetkern.de [185.228.139.199]) by mx1.freebsd.org (Postfix) with ESMTP id 49t7Gx3c1fz4P7n for ; Thu, 25 Jun 2020 18:05:45 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from titanium (p5dd45c70.dip0.t-ipconnect.de [93.212.92.112]) by sapphire.magnetkern.de (Postfix) with ESMTPSA id C0965134F for ; Thu, 25 Jun 2020 18:05:44 +0000 (UTC) Date: Thu, 25 Jun 2020 20:04:46 +0200 From: Jan Behrens To: Hans Petter Selasky Message-Id: <20200625200446.6c7c412b1baffa40212e116f@magnetkern.de> In-Reply-To: References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Date: Thu, 25 Jun 2020 20:05:44 +0200 Resent-From: Jan Behrens Resent-To: freebsd-usb@FreeBSD.org Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD Resent-Message-Id: <20200625200544.009ae51937f038a7210941e5@magnetkern.de> X-Rspamd-Queue-Id: 49t7Gx3c1fz4P7n X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jbe-mlist@magnetkern.de designates 185.228.139.199 as permitted sender) smtp.mailfrom=jbe-mlist@magnetkern.de X-Spamd-Result: default: False [3.86 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[93.212.92.112:received]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx:c]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[magnetkern.de]; NEURAL_SPAM_MEDIUM(0.68)[0.680]; RCPT_COUNT_ONE(0.00)[1]; TO_DN_ALL(0.00)[]; NEURAL_SPAM_LONG(0.41)[0.409]; NEURAL_SPAM_SHORT(0.47)[0.467]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:197540, ipnet:185.228.136.0/22, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; FORGED_RECIPIENTS(2.00)[hps@selasky.org,freebsd-usb@FreeBSD.org] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 18:05:46 -0000 On Thu, 25 Jun 2020 12:23:37 +0200 Hans Petter Selasky wrote: > On 2020-06-25 12:10, Jan Behrens wrote: > > Any help on this would be appreciated. Is there any way to increase > > verbosity of libusb or figure out why the USB initialization fails? > > What is printed in dmesg? > > --HPS > % dmesg [...] ugen2.2: at usbus2 I also made sure I got proper access rights (like Tomek mentioned). Meanwhile I have tracked down the problem further. See my other e-mail. I got the LimeSDR Mini running on FreeBSD (successfully received a radio transmission), but I had to comment out the libusb_reset_device() call, see: https://discourse.myriadrf.org/t/limesdr-mini-with-freebsd/6230/7 This is just a quick-and-dirty hack, and no idea if there are any side-effects. It would be better to figure out what's causing the bug in the first place. Regards, Jan From owner-freebsd-usb@freebsd.org Thu Jun 25 18:08:51 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B28C340DD3 for ; Thu, 25 Jun 2020 18:08:51 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from sapphire.magnetkern.de (sapphire.magnetkern.de [185.228.139.199]) by mx1.freebsd.org (Postfix) with ESMTP id 49t7LV74hXz4P61 for ; Thu, 25 Jun 2020 18:08:50 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from titanium (p5dd45c70.dip0.t-ipconnect.de [93.212.92.112]) by sapphire.magnetkern.de (Postfix) with ESMTPSA id 39764135F; Thu, 25 Jun 2020 18:08:50 +0000 (UTC) Date: Thu, 25 Jun 2020 20:08:49 +0200 From: Jan Behrens To: CeDeROM Cc: "freebsd-usb@FreeBSD.org" Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD Message-Id: <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> In-Reply-To: References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49t7LV74hXz4P61 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jbe-mlist@magnetkern.de designates 185.228.139.199 as permitted sender) smtp.mailfrom=jbe-mlist@magnetkern.de X-Spamd-Result: default: False [-1.81 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx:c]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[magnetkern.de]; NEURAL_HAM_LONG(-0.96)[-0.963]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.24)[-0.236]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-0.91)[-0.907]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:197540, ipnet:185.228.136.0/22, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[93.212.92.112:received] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 18:08:51 -0000 On Thu, 25 Jun 2020 14:31:21 +0200 CeDeROM wrote: > Hello Jan :-) > > Are you sure you have the correct permissions to read/write /dev/usb* devices? Yes, I manually gave me access by using chown after plugging the device in. > > Assuming you are already in the operator group: > > ***/etc/devfs.rules: > [localrules=10] > add path 'ugen*' mode 0660 group operator > add path 'usb/*' mode 0660 group operator > add path 'usb' mode 0770 group operator > > ***/etc/rc.conf: > devfs_system_ruleset="localrules" Thank you for these explanations, that will be better than always calling chown manually :-) The problem with resetting the device via libusb still persists, see my other mails. > > > Best regards :-) > Tomek > > -- > CeDeROM, SQ7MHZ, http://www.tomek.cedro.info > Regards, Jan From owner-freebsd-usb@freebsd.org Thu Jun 25 18:16:40 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5979E340F45 for ; Thu, 25 Jun 2020 18:16:40 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49t7WW2Frfz4Pms for ; Thu, 25 Jun 2020 18:16:38 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 1FC092601C5; Thu, 25 Jun 2020 20:16:35 +0200 (CEST) Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD To: Jan Behrens , freebsd-usb@freebsd.org References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625195943.a6b32addb3c66c3294ed78ef@magnetkern.de> From: Hans Petter Selasky Message-ID: Date: Thu, 25 Jun 2020 20:16:14 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200625195943.a6b32addb3c66c3294ed78ef@magnetkern.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49t7WW2Frfz4Pms X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.42 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; NEURAL_HAM_LONG(-0.96)[-0.956]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_MEDIUM(-0.82)[-0.822]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.34)[-0.340]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 18:16:40 -0000 Hi, On 2020-06-25 19:59, Jan Behrens wrote: > In both cases there is an issue when calling the libusb_reset_device() > function. Unless the device requires it, libusb_reset_device(), will only re-enumerate the device. Beware that this only is allowed if you are running the application as root. Else libusb_reset_device() will be a no-operation. --HPS From owner-freebsd-usb@freebsd.org Thu Jun 25 18:17:57 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D51E6341140 for ; Thu, 25 Jun 2020 18:17:57 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49t7Y11KVlz4PqD for ; Thu, 25 Jun 2020 18:17:57 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E93902601C5; Thu, 25 Jun 2020 20:17:55 +0200 (CEST) Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD To: Jan Behrens , CeDeROM Cc: "freebsd-usb@FreeBSD.org" References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> From: Hans Petter Selasky Message-ID: Date: Thu, 25 Jun 2020 20:17:34 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49t7Y11KVlz4PqD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.59 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-0.96)[-0.965]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.46)[-0.461]; NEURAL_HAM_MEDIUM(-0.87)[-0.867]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 18:17:57 -0000 On 2020-06-25 20:08, Jan Behrens wrote: > Yes, I manually gave me access by using chown after plugging the device > in. libusb_reset may reset-these permissions ! --HPS From owner-freebsd-usb@freebsd.org Thu Jun 25 18:20:11 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D757E341153 for ; Thu, 25 Jun 2020 18:20:11 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from sapphire.magnetkern.de (sapphire.magnetkern.de [185.228.139.199]) by mx1.freebsd.org (Postfix) with ESMTP id 49t7bb25znz4PqS for ; Thu, 25 Jun 2020 18:20:11 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from titanium (p5dd45c70.dip0.t-ipconnect.de [93.212.92.112]) by sapphire.magnetkern.de (Postfix) with ESMTPSA id 6F0B013EA; Thu, 25 Jun 2020 18:20:10 +0000 (UTC) Date: Thu, 25 Jun 2020 20:20:09 +0200 From: Jan Behrens To: Hans Petter Selasky Cc: freebsd-usb@freebsd.org Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD Message-Id: <20200625202009.aca700334d5b1bbaa3422b3f@magnetkern.de> In-Reply-To: References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625195943.a6b32addb3c66c3294ed78ef@magnetkern.de> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49t7bb25znz4PqS X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jbe-mlist@magnetkern.de designates 185.228.139.199 as permitted sender) smtp.mailfrom=jbe-mlist@magnetkern.de X-Spamd-Result: default: False [-1.75 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.88)[-0.876]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[magnetkern.de]; NEURAL_HAM_LONG(-0.96)[-0.956]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.22)[-0.222]; RCPT_COUNT_TWO(0.00)[2]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:197540, ipnet:185.228.136.0/22, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[93.212.92.112:received] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 18:20:11 -0000 On Thu, 25 Jun 2020 20:16:14 +0200 Hans Petter Selasky wrote: > Hi, > > > On 2020-06-25 19:59, Jan Behrens wrote: > > In both cases there is an issue when calling the libusb_reset_device() > > function. > > Unless the device requires it, libusb_reset_device(), will only > re-enumerate the device. Beware that this only is allowed if you are > running the application as root. Else libusb_reset_device() will be a > no-operation. But in my case, the call causes the program to abort (due to returning an error status, I assume). This is the context where the SoapySDR driver calls libusb_reset_device(): https://github.com/myriadrf/LimeSuite/blob/1c1c202f9a6ae4bb34068b6f3f576f7f8e74c7f1/src/ConnectionFTDI/ConnectionFT601.cpp#L212 > > --HPS > Regards, Jan From owner-freebsd-usb@freebsd.org Thu Jun 25 20:25:51 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD779344C85 for ; Thu, 25 Jun 2020 20:25:51 +0000 (UTC) (envelope-from CeDeROM@tlen.pl) Received: from mx-out.tlen.pl (mx-out.tlen.pl [193.222.135.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49tBNZ31rHz4Yx7 for ; Thu, 25 Jun 2020 20:25:49 +0000 (UTC) (envelope-from CeDeROM@tlen.pl) Received: (wp-smtpd smtp.tlen.pl 2697 invoked from network); 25 Jun 2020 22:25:41 +0200 Received: from mail-wr1-f44.google.com (cederom@tlen.pl@[209.85.221.44]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 25 Jun 2020 22:25:41 +0200 Received: by mail-wr1-f44.google.com with SMTP id z13so7216562wrw.5 for ; Thu, 25 Jun 2020 13:25:41 -0700 (PDT) X-Gm-Message-State: AOAM532FdtdGl8WrzXvfklf3xhXwy6JU+FGBaZbJHJdQdAiTnWd6qas6 IV3oD9A3qbezQqErkUbnDL4dz9swvwa3opMx66j3Hg== X-Google-Smtp-Source: ABdhPJyB0p8gJE27BbJ/X5YWlqAYWW85DzrIR4TK+wOYBA0GoNuW/FcAJLdFTZK0rjoo4puke5ybHmVkKW9jFRFavII= X-Received: by 2002:a5d:4591:: with SMTP id p17mr30403334wrq.343.1593116740916; Thu, 25 Jun 2020 13:25:40 -0700 (PDT) MIME-Version: 1.0 References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> In-Reply-To: <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> From: CeDeROM Date: Thu, 25 Jun 2020 22:25:30 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD To: Jan Behrens Cc: "freebsd-usb@FreeBSD.org" , Hans Petter Selasky X-WP-MailID: 27bd994a7fe7f4c89469cb1e94f04afb X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0W0000A [oXMU] X-Rspamd-Queue-Id: 49tBNZ31rHz4Yx7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of CeDeROM@tlen.pl designates 193.222.135.140 as permitted sender) smtp.mailfrom=CeDeROM@tlen.pl X-Spamd-Result: default: False [-2.52 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.02)[-1.020]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:193.222.135.0/24]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; DMARC_NA(0.00)[tlen.pl]; NEURAL_HAM_LONG(-0.97)[-0.969]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.23)[-0.229]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:31080, ipnet:193.222.135.0/24, country:PL]; RCVD_TLS_LAST(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[193.222.135.140:from] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 20:25:51 -0000 How about usbconfig and power off then power on.. or reset via usbconfig? -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info From owner-freebsd-usb@freebsd.org Thu Jun 25 20:45:25 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC289344EC5 for ; Thu, 25 Jun 2020 20:45:25 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from sapphire.magnetkern.de (sapphire.magnetkern.de [185.228.139.199]) by mx1.freebsd.org (Postfix) with ESMTP id 49tBq85fPRz4Zs4 for ; Thu, 25 Jun 2020 20:45:24 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from titanium (p5dd45c70.dip0.t-ipconnect.de [93.212.92.112]) by sapphire.magnetkern.de (Postfix) with ESMTPSA id 3C1041430; Thu, 25 Jun 2020 20:45:23 +0000 (UTC) Date: Thu, 25 Jun 2020 22:45:22 +0200 From: Jan Behrens To: CeDeROM Cc: "freebsd-usb@FreeBSD.org" , Hans Petter Selasky Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD Message-Id: <20200625224522.44d6584465cb6e20d17be320@magnetkern.de> In-Reply-To: References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49tBq85fPRz4Zs4 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jbe-mlist@magnetkern.de designates 185.228.139.199 as permitted sender) smtp.mailfrom=jbe-mlist@magnetkern.de X-Spamd-Result: default: False [-1.53 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+mx]; DMARC_NA(0.00)[magnetkern.de]; NEURAL_SPAM_SHORT(0.12)[0.120]; NEURAL_HAM_LONG(-0.96)[-0.963]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.983]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:197540, ipnet:185.228.136.0/22, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[93.212.92.112:received] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 20:45:25 -0000 On Thu, 25 Jun 2020 22:25:30 +0200 CeDeROM wrote: > How about usbconfig and power off then power on.. or reset via usbconfig? > > -- > CeDeROM, SQ7MHZ, http://www.tomek.cedro.info Do you mean I should test how the device behaves? Reset via usbconfig (as root) doesn't seem to have any effect, at least nothing shows up in dmesg. If I do usbconfig power_off, then the device stops blinking. When I executed usbconfig power_on, I got this: usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_IOERROR, ignored) usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_IOERROR, ignored) usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR It didn't seem to be always reproducible though. Regards, Jan From owner-freebsd-usb@freebsd.org Fri Jun 26 07:37:09 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64F5A350456 for ; Fri, 26 Jun 2020 07:37:09 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from sapphire.magnetkern.de (sapphire.magnetkern.de [185.228.139.199]) by mx1.freebsd.org (Postfix) with ESMTP id 49tTH80ltBz49WM for ; Fri, 26 Jun 2020 07:37:07 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from titanium (p5dd45c70.dip0.t-ipconnect.de [93.212.92.112]) by sapphire.magnetkern.de (Postfix) with ESMTPSA id E26C714A4 for ; Fri, 26 Jun 2020 07:37:05 +0000 (UTC) Date: Fri, 26 Jun 2020 09:37:05 +0200 From: Jan Behrens To: freebsd-usb@freebsd.org Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD Message-Id: <20200626093705.12d3ac4bfa8d82f0b2ae1dd6@magnetkern.de> In-Reply-To: <20200625195943.a6b32addb3c66c3294ed78ef@magnetkern.de> References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625195943.a6b32addb3c66c3294ed78ef@magnetkern.de> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49tTH80ltBz49WM X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jbe-mlist@magnetkern.de designates 185.228.139.199 as permitted sender) smtp.mailfrom=jbe-mlist@magnetkern.de X-Spamd-Result: default: False [-0.88 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.82)[-0.822]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.59)[-0.593]; DMARC_NA(0.00)[magnetkern.de]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_SPAM_SHORT(0.24)[0.238]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:197540, ipnet:185.228.136.0/22, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[93.212.92.112:received] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2020 07:37:09 -0000 Dear all, I doubt that it is a coincidence that the LimeSDR Mini had the same problem with macOS's libusb, but I may be wrong. For macOS the problem has been solved, for FreeBSD it hasn't. I am confused what libusb_reset_device() does, but whether I'm having root privileges or not, I doubt it should return an error for a device which runs well under Linux and/or macOS. On the discussion forum on myriadrf.org, the question was rised if there are any special considerations to take when using FreeBSD's libusb. I would like to repeat that question here: 1. Are there (intended or accidental/unwanted) API and/or behaviour differences between Linux/macOS's libusb. Are there certain considerations when building apps that use libusb? Is it wrong to call libusb_reset_device() in a driver? If yes, why? If no, what is the function used for? See also: https://discourse.myriadrf.org/t/limesdr-mini-with-freebsd/6230/2 I also would like to ask: 2. Does the bugfix below, which seemed to fix issues with LimeSDR on macOS, relate to a bug that is existent in FreeBSD's libusb as well? Is it just a coincidence and two unrelated issues? Or is there a problem with libusb that has been fixed for macOS but not for FreeBSD? https://github.com/libusb/libusb/commit/a0b5d27fa7f2bba11965e2b70533f925a5772808 See quoted message below for more links regarding this issue. Any help would appreciated. I understand far too little about libusb to solve the problem on my own. It would be really nice if either the Lime Suite or the libusb could be modified such that the LimeSDR Mini, which is an awesome radio device, works properly on FreeBSD (and I'm not forced to use Linux or Windows for it). Regards, Jan Behrens On Thu, 25 Jun 2020 19:59:43 +0200 Jan Behrens wrote: > On Thu, 25 Jun 2020 12:10:52 +0200 > Jan Behrens wrote: > > > I'd like to use a software defined radio "LimeSDR Mini" on FreeBSD > > utilizing the "SoapySDR library" with a driver from "Lime Suite", but I > > encounter errors, supposedly in libusb. > > Maybe the same problem occured in MacOS's libusb. Compare the following > posts: > > https://github.com/myriadrf/LimeSuite/issues/253 > > https://discourse.myriadrf.org/t/limesdr-mini-with-freebsd/6230/7 > > In both cases there is an issue when calling the libusb_reset_device() > function. > > The problem on MacOS seems to have been fixed according to this post: > > https://github.com/myriadrf/LimeSuite/issues/253#issuecomment-480263517 > > Look at the following patch: > > https://github.com/libusb/libusb/commit/a0b5d27fa7f2bba11965e2b70533f925a5772808 > > The patch seems to be darwin-specific. Is the same bug affecting > FreeBSD or is this a different issue? Can the problem be solved for > FreeBSD as well? > > > Kind Regards, > Jan Behrens From owner-freebsd-usb@freebsd.org Fri Jun 26 08:51:05 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAB7B352512 for ; Fri, 26 Jun 2020 08:51:05 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49tVwS733tz4KvL for ; Fri, 26 Jun 2020 08:51:04 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 90E42260344; Fri, 26 Jun 2020 10:51:03 +0200 (CEST) Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD To: Jan Behrens , freebsd-usb@freebsd.org References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625195943.a6b32addb3c66c3294ed78ef@magnetkern.de> <20200626093705.12d3ac4bfa8d82f0b2ae1dd6@magnetkern.de> From: Hans Petter Selasky Message-ID: <1572c881-3c38-4fd4-744b-aa26b9b9343c@selasky.org> Date: Fri, 26 Jun 2020 10:50:43 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200626093705.12d3ac4bfa8d82f0b2ae1dd6@magnetkern.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49tVwS733tz4KvL X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.08 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; NEURAL_HAM_LONG(-1.00)[-0.995]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_MEDIUM(-0.94)[-0.940]; NEURAL_SPAM_SHORT(0.16)[0.157]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2020 08:51:05 -0000 On 2020-06-26 09:37, Jan Behrens wrote: > I am confused what libusb_reset_device() does, but whether I'm having > root privileges or not, I doubt it should return an error for a device which runs well under Linux and/or macOS. Try using usbconfig, before loading the driver: usbconfig -d X.Y reset Also try using a 12-stable kernel. This issue might already be fixed! --HPS From owner-freebsd-usb@freebsd.org Fri Jun 26 08:54:57 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D20EB3522FA for ; Fri, 26 Jun 2020 08:54:57 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49tW0w51hbz4LCs for ; Fri, 26 Jun 2020 08:54:56 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A54DC26007D; Fri, 26 Jun 2020 10:54:54 +0200 (CEST) Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD To: Jan Behrens , freebsd-usb@freebsd.org References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625195943.a6b32addb3c66c3294ed78ef@magnetkern.de> <20200626093705.12d3ac4bfa8d82f0b2ae1dd6@magnetkern.de> From: Hans Petter Selasky Message-ID: Date: Fri, 26 Jun 2020 10:54:34 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200626093705.12d3ac4bfa8d82f0b2ae1dd6@magnetkern.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49tW0w51hbz4LCs X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.08 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; NEURAL_HAM_LONG(-0.99)[-0.995]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_MEDIUM(-0.94)[-0.941]; NEURAL_SPAM_SHORT(0.15)[0.153]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2020 08:54:57 -0000 Hi, On 2020-06-26 09:37, Jan Behrens wrote: > 1. Are there (intended or accidental/unwanted) API and/or behaviour > differences between Linux/macOS's libusb. Are there certain > considerations when building apps that use libusb? Is it wrong to call > libusb_reset_device() in a driver? If yes, why? If no, what is the > function used for? Some devices are only tested using Windows, and I know that timing may affect how libusb_reset_device() works. My guess is that libusb_reset_device() should only be used in the case you've uploaded new firmware to the device, and that USB stack on the device has been rebooted. In FreeBSD there are a bunch of sysctl's which affect the libusb reset device behaviour: hw.usb.timings.extra_power_up_time: 20 hw.usb.timings.resume_recovery: 50 hw.usb.timings.resume_wait: 50 hw.usb.timings.resume_delay: 250 hw.usb.timings.set_address_settle: 10 hw.usb.timings.port_resume_delay: 40 hw.usb.timings.port_powerup_delay: 300 hw.usb.timings.port_reset_recovery: 250 hw.usb.timings.port_root_reset_delay: 200 hw.usb.timings.port_reset_delay: 50 In order to figure out exactly what is wrong, you need to have a USB analyzer, capturing all USB communications on the USB cable. --HPS From owner-freebsd-usb@freebsd.org Fri Jun 26 08:56:29 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62A4C3526C3 for ; Fri, 26 Jun 2020 08:56:29 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49tW2h5n1Sz4LLk for ; Fri, 26 Jun 2020 08:56:28 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 068C326007D; Fri, 26 Jun 2020 10:56:26 +0200 (CEST) Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD To: Jan Behrens , freebsd-usb@freebsd.org References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625195943.a6b32addb3c66c3294ed78ef@magnetkern.de> <20200626093705.12d3ac4bfa8d82f0b2ae1dd6@magnetkern.de> From: Hans Petter Selasky Message-ID: Date: Fri, 26 Jun 2020 10:56:07 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200626093705.12d3ac4bfa8d82f0b2ae1dd6@magnetkern.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49tW2h5n1Sz4LLk X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.08 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; NEURAL_HAM_LONG(-0.99)[-0.995]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_MEDIUM(-0.94)[-0.940]; NEURAL_SPAM_SHORT(0.16)[0.159]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2020 08:56:29 -0000 On 2020-06-26 09:37, Jan Behrens wrote: > 2. Does the bugfix below, which seemed to fix issues with LimeSDR on > macOS, relate to a bug that is existent in FreeBSD's libusb as well? Is > it just a coincidence and two unrelated issues? Or is there a problem > with libusb that has been fixed for macOS but not for FreeBSD? From what I can see, the FreeBSD kernel already does set configuration (index 0) by default after a USB device reset, which the MacOS patch seems to be about. --HPS From owner-freebsd-usb@freebsd.org Fri Jun 26 08:58:42 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7B0835298B for ; Fri, 26 Jun 2020 08:58:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49tW5G00XHz4LM0 for ; Fri, 26 Jun 2020 08:58:41 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 695D126007D; Fri, 26 Jun 2020 10:58:40 +0200 (CEST) Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD To: Jan Behrens , CeDeROM Cc: "freebsd-usb@FreeBSD.org" References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> <20200625224522.44d6584465cb6e20d17be320@magnetkern.de> From: Hans Petter Selasky Message-ID: <0ec3e5a3-7f31-d1cd-6862-6066c431aa80@selasky.org> Date: Fri, 26 Jun 2020 10:58:20 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200625224522.44d6584465cb6e20d17be320@magnetkern.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49tW5G00XHz4LM0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.26 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-1.01)[-1.013]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.00)[0.001]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.951]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2020 08:58:42 -0000 USB_ERR_IOERROR: This error code is carefully chosen to indicate that the USB device did not respond at all to the USB set address command, which is mandatory to implement. Likely the USB firmware on the device is not up and running, or there is a timing issue or bug in the firmware. --HPS From owner-freebsd-usb@freebsd.org Fri Jun 26 09:26:10 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00DD2353084 for ; Fri, 26 Jun 2020 09:26:09 +0000 (UTC) (envelope-from CeDeROM@tlen.pl) Received: from mx-out.tlen.pl (mx-out.tlen.pl [193.222.135.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49tWhv59vpz4McL for ; Fri, 26 Jun 2020 09:26:07 +0000 (UTC) (envelope-from CeDeROM@tlen.pl) Received: (wp-smtpd smtp.tlen.pl 13739 invoked from network); 26 Jun 2020 11:26:03 +0200 Received: from mail-wm1-f53.google.com (cederom@tlen.pl@[209.85.128.53]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 26 Jun 2020 11:26:03 +0200 Received: by mail-wm1-f53.google.com with SMTP id o8so8164906wmh.4 for ; Fri, 26 Jun 2020 02:26:03 -0700 (PDT) X-Gm-Message-State: AOAM531FYTTQWP+movMGpPGqKkb6EOosVSWvFsU1uMYaqGxdmH8S2hjT NadUJnuGKlbDWzQXnjLV+wBDPD8Tw/88/tmaHtpdrw== X-Google-Smtp-Source: ABdhPJyaIt4oLnioIdga1H/H/mOi4Dk1yZuiPxBRtJyoXCkDwa0FWFK6XMIvJRJOhU7QBe75sR6ktcYvrnMM5Lpmlac= X-Received: by 2002:a1c:4c16:: with SMTP id z22mr2380651wmf.103.1593163563255; Fri, 26 Jun 2020 02:26:03 -0700 (PDT) MIME-Version: 1.0 References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625195943.a6b32addb3c66c3294ed78ef@magnetkern.de> <20200626093705.12d3ac4bfa8d82f0b2ae1dd6@magnetkern.de> In-Reply-To: From: CeDeROM Date: Fri, 26 Jun 2020 11:25:52 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD To: Hans Petter Selasky Cc: Jan Behrens , "freebsd-usb@FreeBSD.org" X-WP-MailID: 3d555858f01eb3f0f49b1f3961abd87f X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0W0000A [YRMk] X-Rspamd-Queue-Id: 49tWhv59vpz4McL X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of CeDeROM@tlen.pl designates 193.222.135.140 as permitted sender) smtp.mailfrom=CeDeROM@tlen.pl X-Spamd-Result: default: False [-3.25 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.96)[-0.958]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:193.222.135.0/24]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; DMARC_NA(0.00)[tlen.pl]; NEURAL_HAM_LONG(-1.01)[-1.010]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.983]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:31080, ipnet:193.222.135.0/24, country:PL]; RCVD_TLS_LAST(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[193.222.135.140:from] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2020 09:26:10 -0000 I have the USB sniffer hardware. If problem persists I can buy this LimeSDR and take some dumps from the wire. USB can also get sniffed in software on FreeBSD but this would not help here I guess. Just let me know when all other ways fail :-) -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info From owner-freebsd-usb@freebsd.org Fri Jun 26 11:51:59 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EFA093554E2 for ; Fri, 26 Jun 2020 11:51:59 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from sapphire.magnetkern.de (sapphire.magnetkern.de [185.228.139.199]) by mx1.freebsd.org (Postfix) with ESMTP id 49tZxB6RwYz4VSr for ; Fri, 26 Jun 2020 11:51:58 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from titanium (p5dd45c70.dip0.t-ipconnect.de [93.212.92.112]) by sapphire.magnetkern.de (Postfix) with ESMTPSA id 224F21516; Fri, 26 Jun 2020 11:51:52 +0000 (UTC) Date: Fri, 26 Jun 2020 13:51:51 +0200 From: Jan Behrens To: Hans Petter Selasky , CeDeROM Cc: "freebsd-usb@FreeBSD.org" Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD Message-Id: <20200626135151.e5542cf97fad213c4ad661f2@magnetkern.de> In-Reply-To: <0ec3e5a3-7f31-d1cd-6862-6066c431aa80@selasky.org> References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> <20200625224522.44d6584465cb6e20d17be320@magnetkern.de> <0ec3e5a3-7f31-d1cd-6862-6066c431aa80@selasky.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49tZxB6RwYz4VSr X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jbe-mlist@magnetkern.de designates 185.228.139.199 as permitted sender) smtp.mailfrom=jbe-mlist@magnetkern.de X-Spamd-Result: default: False [-1.93 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+mx]; DMARC_NA(0.00)[magnetkern.de]; NEURAL_HAM_LONG(-0.99)[-0.994]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.29)[-0.289]; NEURAL_HAM_MEDIUM(-0.95)[-0.947]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:197540, ipnet:185.228.136.0/22, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[93.212.92.112:received] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2020 11:52:00 -0000 On Fri, 26 Jun 2020 10:58:20 +0200 Hans Petter Selasky wrote: > USB_ERR_IOERROR: Where did you get this error code from? I checked the error code returned in my case by modifying the source of the Lime Suite: { int status = libusb_reset_device(dev_handle); fprintf(stderr, "DEBUG status: %i\n", status); if (libusb_reset_device(dev_handle)!=0) return ReportError(-1, "USB reset failed", libusb_strerror(libusb_error(r))); } I got: DEBUG status: -99 Checking with libusb source, this seems to be LIBUSB_ERROR_OTHER: https://github.com/libusb/libusb/blob/e782eeb2514266f6738e242cdcb18e3ae1ed06fa/libusb/libusb.h#L1098 I figured out this error might (amongst other reasons) also be raised when there is an EACCES system error. As my /dev/usb/2.2.* devices were all owned by my user (using chown) and their ownership was not reset during testing, I tested what happens if I run the library calls with root privileges. I made the discovery that running the library as root works just fine! So maybe the problem is that calling libusb_reset_device attempts to recreate the /dev entries and has insufficient privileges? (Even though access rights for the individual files are granted.) Adding the entries Tomek (CeDeROM) proposed for granting privileges to the operator group (and being member of the group) didn't help either. > > This error code is carefully chosen to indicate that the USB device did > not respond at all to the USB set address command, which is mandatory to > implement. Likely the USB firmware on the device is not up and running, > or there is a timing issue or bug in the firmware. > > --HPS Nonetheless, there might be timing issues. In addition to the error returned by libusb_reset_device, I get a lot of: LIBUSB_FUNCTION: libusb_handle_events_timeout_completed enter LIBUSB_FUNCTION: libusb10_handle_events_sub enter LIBUSB_FUNCTION: libusb_handle_events_timeout_completed enter LIBUSB_FUNCTION: libusb10_handle_events_sub enter [...] See also my original post on the myriadrf.org Forum, with a full error output: https://discourse.myriadrf.org/t/limesdr-mini-with-freebsd/6230 Regards, Jan Behrens From owner-freebsd-usb@freebsd.org Fri Jun 26 12:47:43 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 747C4357C32 for ; Fri, 26 Jun 2020 12:47:43 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49tc9V3jl3z4bKZ for ; Fri, 26 Jun 2020 12:47:41 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 3BAA1260184; Fri, 26 Jun 2020 14:47:34 +0200 (CEST) Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD To: Jan Behrens , CeDeROM Cc: "freebsd-usb@FreeBSD.org" References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> <20200625224522.44d6584465cb6e20d17be320@magnetkern.de> <0ec3e5a3-7f31-d1cd-6862-6066c431aa80@selasky.org> <20200626135151.e5542cf97fad213c4ad661f2@magnetkern.de> From: Hans Petter Selasky Message-ID: <5c0729f9-9e98-52f7-a5cb-6c5dfd2287a3@selasky.org> Date: Fri, 26 Jun 2020 14:47:13 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200626135151.e5542cf97fad213c4ad661f2@magnetkern.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49tc9V3jl3z4bKZ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.14 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; ARC_NA(0.00)[]; NEURAL_SPAM_SHORT(0.12)[0.122]; NEURAL_HAM_LONG(-1.01)[-1.014]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.949]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2020 12:47:43 -0000 Hi, On 2020-06-26 13:51, Jan Behrens wrote: > I made the discovery that running the library as root works just fine! The libusb_reset_device() function needs root permissions! This is expected. There are specific checks in the kernel for this. Can you run this app as root, and then change to non-root after libusb_reset_device() has been executed? --HPS From owner-freebsd-usb@freebsd.org Fri Jun 26 15:28:55 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C6F235A473 for ; Fri, 26 Jun 2020 15:28:55 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from sapphire.magnetkern.de (sapphire.magnetkern.de [185.228.139.199]) by mx1.freebsd.org (Postfix) with ESMTP id 49tglV0vv4z4lB8 for ; Fri, 26 Jun 2020 15:28:53 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from titanium (p5dd45c70.dip0.t-ipconnect.de [93.212.92.112]) by sapphire.magnetkern.de (Postfix) with ESMTPSA id E1F04154D; Fri, 26 Jun 2020 15:28:51 +0000 (UTC) Date: Fri, 26 Jun 2020 17:28:51 +0200 From: Jan Behrens To: Hans Petter Selasky Cc: CeDeROM , "freebsd-usb@FreeBSD.org" Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD Message-Id: <20200626172851.872f3a08fa6e632666683230@magnetkern.de> In-Reply-To: <5c0729f9-9e98-52f7-a5cb-6c5dfd2287a3@selasky.org> References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> <20200625224522.44d6584465cb6e20d17be320@magnetkern.de> <0ec3e5a3-7f31-d1cd-6862-6066c431aa80@selasky.org> <20200626135151.e5542cf97fad213c4ad661f2@magnetkern.de> <5c0729f9-9e98-52f7-a5cb-6c5dfd2287a3@selasky.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49tglV0vv4z4lB8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jbe-mlist@magnetkern.de designates 185.228.139.199 as permitted sender) smtp.mailfrom=jbe-mlist@magnetkern.de X-Spamd-Result: default: False [-2.23 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[magnetkern.de]; NEURAL_HAM_LONG(-0.99)[-0.993]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.60)[-0.600]; NEURAL_HAM_MEDIUM(-0.94)[-0.939]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:197540, ipnet:185.228.136.0/22, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[93.212.92.112:received] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2020 15:28:55 -0000 On Fri, 26 Jun 2020 14:47:13 +0200 Hans Petter Selasky wrote: > Hi, > > On 2020-06-26 13:51, Jan Behrens wrote: > > I made the discovery that running the library as root works just fine! > > The libusb_reset_device() function needs root permissions! This is > expected. There are specific checks in the kernel for this. I might have misunderstood your earlier post: On Thu, 25 Jun 2020 20:16:14 +0200 Hans Petter Selasky wrote: > Unless the device requires it, libusb_reset_device(), will only > re-enumerate the device. Beware that this only is allowed if you are > running the application as root. Else libusb_reset_device() will be a > no-operation. > > --HPS Does this mean that depending on the device, it will either be a no-operation or a re-enumeration, and in the latter case, root privileges are required, otherwise not? Or did you mean that if you are non-root, it will/should always be a no-operation? What I don't understand is that the Lime Suite SoapySDR module seems to work fine on Linux and other operating systems but makes trouble with FreeBSD. Is it a FreeBSD specific thing that libusb_reset_device() fails if called as non-root? > Can you run this app as root, and then change to non-root after > libusb_reset_device() has been executed? > > --HPS It's not really practical. I'd have to patch every program using the module. But maybe libusb_reset_device() isn't necessary to call? I could give recommendation to the Lime Suite developers to remove the libusb_reset_device() call on FreeBSD systems if it is not neccessary. However, I would like to understand why it is called and what's its usual purpose, and if there are side effects when removing the call, or whether the call should/could be replaced by a different call that "only" requires device privileges. Also: Why does this work on Linux but fails on FreeBSD? Is the API differently defined? Sorry for my confusion, I'm really not experienced with USB programming. Regards, Jan Behrens From owner-freebsd-usb@freebsd.org Fri Jun 26 15:56:27 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F57B35B188 for ; Fri, 26 Jun 2020 15:56:27 +0000 (UTC) (envelope-from tomek@cedro.info) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49thMG2GRmz4mp6 for ; Fri, 26 Jun 2020 15:56:26 +0000 (UTC) (envelope-from tomek@cedro.info) Received: by mail-wr1-x442.google.com with SMTP id g18so10027603wrm.2 for ; Fri, 26 Jun 2020 08:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cedro.info; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XgwSaUuuvMWrw2dxzjGB83KWlvnvPtGaK2UkK6Pgw3A=; b=DCQv89TJCllxzfzRHu7Np9KYeRx11BVm3OOjE/dwDEQeTj4BYrY66B+DXpHAPFGMuS tI+QNcBt7P4WdU96exBLHop+TddTSfuwfuf/b4HNjOxOz/DY4zkFLuM8f6yGrWaH8VwK LfJbyxLRfFh1O14PlIGcupfyZ5Z9Ymgy9u9Vr2SesAQQxLrRxsiSg9JJrclCQsON4Yu1 UQzxPiIX9upeebb0HPnaZNM0w9xxTQtXn10kX0hHXy2yMPSWrlyzY47+6j3RyDkPSLDL I0Lysnes5j7L/qN31XMo7XsRKla/kJv7+W/AtF/LjrGMtwG/KSodL/9eELRXgEjaPrlR 8gyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XgwSaUuuvMWrw2dxzjGB83KWlvnvPtGaK2UkK6Pgw3A=; b=Jq+bNGz/hZ24P6BLCmhNJP16AUIiXOE+nrptqh2prU6bUqoAHIbfDf0LJN6XNENTYs R+gAfINTy7RQtQqmow4uMvQ/fKYW78dPek3PGEAaSQ+KsMZS3kNmwyjs0d9NTm40NNp7 v+nUs9T0Sn29g0co53OzpY+SwbDglE4tYl8+5rHKjCP03V9ZLvdUKT8iHDjhvV55Ueac f0pfnJVNMv3zjlhwvCVwfybX330NZtfeeTexUU2lpfchTnUI7gJF5YTgLC0/eT1gv3I5 bMWX6KYEoJqqI7T8wbyegchuN3G0yw6n9vwTo5DaqaXyf70tFeKpJjwuoUsufV25o1jO nolw== X-Gm-Message-State: AOAM530dVqYIFg6hXIXl57z4tta3saSAkT7ZjzsUYxs2a6/WxZvyVBvy L/SV5kVI0inUv3/MmbbYCg3T8g2FB69ltGIKLreiDw== X-Google-Smtp-Source: ABdhPJx3DdSob33M+xH1zxNJwuIs1iqBqSGUKNu7cWNGWMt55Y11wVLbJTHkoqcO54rQ83ywjzAdprBXgOG1TZB3zEw= X-Received: by 2002:a5d:6907:: with SMTP id t7mr4421669wru.329.1593186985024; Fri, 26 Jun 2020 08:56:25 -0700 (PDT) MIME-Version: 1.0 References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> <20200625224522.44d6584465cb6e20d17be320@magnetkern.de> <0ec3e5a3-7f31-d1cd-6862-6066c431aa80@selasky.org> <20200626135151.e5542cf97fad213c4ad661f2@magnetkern.de> <5c0729f9-9e98-52f7-a5cb-6c5dfd2287a3@selasky.org> <20200626172851.872f3a08fa6e632666683230@magnetkern.de> In-Reply-To: <20200626172851.872f3a08fa6e632666683230@magnetkern.de> From: Tomasz CEDRO Date: Fri, 26 Jun 2020 17:56:14 +0200 Message-ID: Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD To: Jan Behrens Cc: Hans Petter Selasky , CeDeROM , "freebsd-usb@FreeBSD.org" X-Rspamd-Queue-Id: 49thMG2GRmz4mp6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cedro.info header.s=google header.b=DCQv89TJ; dmarc=none; spf=none (mx1.freebsd.org: domain of tomek@cedro.info has no SPF policy when checking 2a00:1450:4864:20::442) smtp.mailfrom=tomek@cedro.info X-Spamd-Result: default: False [-2.40 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[cedro.info:s=google]; NEURAL_HAM_MEDIUM(-0.98)[-0.982]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.03)[-1.029]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; DMARC_NA(0.00)[cedro.info]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[cedro.info:+]; NEURAL_HAM_SHORT(-0.09)[-0.089]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::442:from]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2020 15:56:27 -0000 pt., 26 cze 2020, 17:28 u=C5=BCytkownik Jan Behrens napisa=C5=82: > Does this mean that depending on the device, it will either be a > no-operation or a re-enumeration, and in the latter case, root > privileges are required, otherwise not? > > Or did you mean that if you are non-root, it will/should always be a > no-operation? > I guess that root is required for some administrative operations like port reset etc that are not really possible to achieve even through /dev/usb* permissions. When in trouble always try to test at root especially when working with hardware. That may pinpoint the permissions issuses (not only /dev/usb* permissions). What I don't understand is that the Lime Suite SoapySDR module seems to > work fine on Linux and other operating systems but makes trouble with > FreeBSD. Is it a FreeBSD specific thing that libusb_reset_device() > fails if called as non-root? > Linux as well as other operating systems usually uses dirty and quick hacks. FreeBSD treats standards seriously and usually does not have these kind of dirty hacks. This is the first difference. Second difference is that FreeBSD has its own implementation of LibUSB. There may be a problem here bu that would require detailed investigation and proofs. Very nice exercise to perform :- I could give recommendation to the Lime Suite developers to remove the > libusb_reset_device() call on FreeBSD systems if it is not neccessary. > However, I would like to understand why it is called and what's its > usual purpose, and if there are side effects when removing the call, or > whether the call should/could be replaced by a different call that > "only" requires device privileges. Also: Why does this work on Linux > but fails on FreeBSD? Is the API differently defined? Very good approach to understand what is the problem and fix it rarher than using dirty hacks just to make things work :-) What particular LimeSDR device do you have? Is it expensive? Can you share a spare one for testing? Can you acquire access to hardware USB sniffer? Best regards :-) Tomek -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info From owner-freebsd-usb@freebsd.org Sat Jun 27 12:44:28 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BFA634F5AA for ; Sat, 27 Jun 2020 12:44:28 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from sapphire.magnetkern.de (sapphire.magnetkern.de [185.228.139.199]) by mx1.freebsd.org (Postfix) with ESMTP id 49vD3H1LpRz3YdH for ; Sat, 27 Jun 2020 12:44:26 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from titanium (p5dd45c70.dip0.t-ipconnect.de [93.212.92.112]) by sapphire.magnetkern.de (Postfix) with ESMTPSA id B2FF6161F; Sat, 27 Jun 2020 12:44:19 +0000 (UTC) Date: Sat, 27 Jun 2020 14:44:19 +0200 From: Jan Behrens To: Tomasz CEDRO Cc: Hans Petter Selasky , CeDeROM , "freebsd-usb@FreeBSD.org" Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD Message-Id: <20200627144419.f14371695d9b62ea99106c4a@magnetkern.de> In-Reply-To: References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> <20200625224522.44d6584465cb6e20d17be320@magnetkern.de> <0ec3e5a3-7f31-d1cd-6862-6066c431aa80@selasky.org> <20200626135151.e5542cf97fad213c4ad661f2@magnetkern.de> <5c0729f9-9e98-52f7-a5cb-6c5dfd2287a3@selasky.org> <20200626172851.872f3a08fa6e632666683230@magnetkern.de> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49vD3H1LpRz3YdH X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jbe-mlist@magnetkern.de designates 185.228.139.199 as permitted sender) smtp.mailfrom=jbe-mlist@magnetkern.de X-Spamd-Result: default: False [-1.75 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[magnetkern.de]; NEURAL_HAM_LONG(-0.98)[-0.978]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.18)[-0.178]; NEURAL_HAM_MEDIUM(-0.90)[-0.898]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:197540, ipnet:185.228.136.0/22, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[93.212.92.112:received] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jun 2020 12:44:28 -0000 On Fri, 26 Jun 2020 17:56:14 +0200 Tomasz CEDRO wrote: > pt., 26 cze 2020, 17:28 użytkownik Jan Behrens > napisał: > > > Does this mean that depending on the device, it will either be a > > no-operation or a re-enumeration, and in the latter case, root > > privileges are required, otherwise not? > > > > Or did you mean that if you are non-root, it will/should always be a > > no-operation? > > > > I guess that root is required for some administrative operations like port > reset etc that are not really possible to achieve even through /dev/usb* > permissions. The question is: Is it correct or wise to return an error status of -99 (LIBUSB_ERROR_OTHER) when the function is called as non-root? Maybe it's possible to return a more fitting error code? Also note that the debug level was set to 3, and there was still no hint written to stderr about any privilege problem: #if LIBUSBX_API_VERSION < 0x01000106 libusb_set_debug(ctx, 3); //set verbosity level to 3, as suggested in the documentation #else libusb_set_option(ctx, LIBUSB_OPTION_LOG_LEVEL, 3); //set verbosity level to 3, as suggested in the documentation #endif Source: https://github.com/myriadrf/LimeSuite/blob/1c1c202f9a6ae4bb34068b6f3f576f7f8e74c7f1/src/ConnectionFTDI/ConnectionFT601Entry.cpp#L40 > > When in trouble always try to test at root especially when working with > hardware. That may pinpoint the permissions issuses (not only /dev/usb* > permissions). You are right, of course. As "chown user /dev/usb/2.2.*" made a difference (and there wasn't any hint about a privilege problem), I wrongly assumed that it was not a privilege problem. I'll know better next time. Another question that I still have no clear answer to is: Is it semantically correct to use libusb_reset_device() in the Lime Suite driver for SoapySDR. The driver runs in the context of user applications which likely have no root privileges (for a good reason). I also don't know yet why this library call is made in the driver, and which purpose it has. See also my most recent post on the myriadrf.org discussion forum: https://discourse.myriadrf.org/t/limesdr-mini-with-freebsd/6230/8 I wrote: "I wonder if FreeBSD’s libusb should (and/or could) be fixed to ensure libusb_reset_device() can be run as non-root user, or if the Lime Suite should be fixed to not call libusb_reset_device() at all because it might be an administrative call that should never be used by a user of a USB device. I’m not sure what’s right to do. Particularly, I don’t know why the Lime Suite developers included that call, and I don’t even fully understand (yet) what it does." > > > What I don't understand is that the Lime Suite SoapySDR module seems to > > work fine on Linux and other operating systems but makes trouble with > > FreeBSD. Is it a FreeBSD specific thing that libusb_reset_device() > > fails if called as non-root? > > > > Linux as well as other operating systems usually uses dirty and quick > hacks. FreeBSD treats standards seriously and usually does not have these > kind of dirty hacks. This is the first difference. Second difference is > that FreeBSD has its own implementation of LibUSB. There may be a problem > here bu that would require detailed investigation and proofs. Very nice > exercise to perform :- I also prefer to have things implemented cleanly instead of fixing problems in the wrong place with dirty methods. That is why I would like to understand if calling libusb_reset_device() is semantically correct or a wrong thing to do in the LimeSDR (Mini) driver. > > > I could give recommendation to the Lime Suite developers to remove the > > libusb_reset_device() call on FreeBSD systems if it is not neccessary. > > However, I would like to understand why it is called and what's its > > usual purpose, and if there are side effects when removing the call, or > > whether the call should/could be replaced by a different call that > > "only" requires device privileges. Also: Why does this work on Linux > > but fails on FreeBSD? Is the API differently defined? > > > Very good approach to understand what is the problem and fix it rarher than > using dirty hacks just to make things work :-) > > What particular LimeSDR device do you have? Is it expensive? Can you share > a spare one for testing? Can you acquire access to hardware USB sniffer? The device I have here for testing isn't mine, so it would be difficult to mail it. It is the "LimeSDR Mini". I asked on the myriadrf.org Forum if the manufacturer could provide a free sample for testing. If that doesn't work, I could also ask friends, but eventually I want to get one (or two) for myself anyway. The LimeSDR and LimeSDR Mini seem to have better electrical/radio characteristics than other available devices. Compared to the Pluto SDR, the LimeSDR (Mini) comes with better frequency stability out of the box, i.e. doesn't need to be modded. The LimeSDR also works on lower frequency bands while the Pluto SDR does not. For my purposes (general experimenting, trying to do ham radio satellite operation, operation on different ham radio bands, etc.), the LimeSDR (Mini) seems to be an awesome device, which is why I would really like if it was supported by FreeBSD. > > Best regards :-) > Tomek > > -- > CeDeROM, SQ7MHZ, http://www.tomek.cedro.info Regards, Jan From owner-freebsd-usb@freebsd.org Sat Jun 27 14:13:00 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 037663516A3 for ; Sat, 27 Jun 2020 14:13:00 +0000 (UTC) (envelope-from tomek@cedro.info) Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49vG1R1mDlz3gFc for ; Sat, 27 Jun 2020 14:12:58 +0000 (UTC) (envelope-from tomek@cedro.info) Received: by mail-wm1-x329.google.com with SMTP id a6so10707256wmm.0 for ; Sat, 27 Jun 2020 07:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cedro.info; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=KGgvWRxQhi+7AFa186ggtVNPndepe4HhfbW3lL88YT4=; b=iYIQ/NQvTim3/ao2lHlnDsqOmoKey2uKQGJYPvUHwZqxkzK6s5QjqGH98LLccIURZs R8p0tx0rUzqbQtW7fPhQIn8P3Bt42VF+tUSEgFfaJ9JkSC/POGYfqW1ruqBBtfQvAh1f uhFeRjOhhv0k1uTw127Ir79mUl95bfgFIE0bLrISHQBPvRJGYKfTZBCinxAVnVQJOLFN vIE1vlE9EgE8L55onWXHD0qr2lc7Mzck2jgPPmTVHeitDzXFXi2nRiJYVAx1/qWcTdX5 dTjfbJSNQuttiHbuGTVG3YeJ1yRiUCdAb7EcyuYgHcDrGaBb3F+2brNh6HbK1D+0IF4B AMIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=KGgvWRxQhi+7AFa186ggtVNPndepe4HhfbW3lL88YT4=; b=lyfN9qKH86he5gQqWCVZuQEM+vsaj1hzfyQD3cE2FTha0oyT94t0L0ioDLVWhHyaP+ G+WB/nZiCswU5cstWvjD3CnYvb2dlF6060ErhEpA4Zp6i5jSs/zrh9kjNt34GnRy0f5d vPCy/lCMxbhojUgiMOb07u3HW4dcS/Wpqx3sasCt0h6uZJzy//IlCMR+DgdrSPVJ9jTR IcGNn446lfvsKTUKVa2KNMPzkrqkAv9wkXjKBMFDztLm80Qj4Xij4VP9Wg+yxkUAY9Ub UO/dSD6coaYUUkgMvVlCL8NawdahrHiJWn+XfAmtoSDB7+g2Y+MN56KDm2JyheK4xLIk OESw== X-Gm-Message-State: AOAM533IzUNzfskgglNJY9Ss21IIfhCHg5UzSggT47jQSRhB7gZ1YBKb TQhXhoN2LtZ6pZhrT6czglaYNKiPIoP1oHG4RxLBFOZ4kt3jRA== X-Google-Smtp-Source: ABdhPJzb6Yg8C7QIXnavAmk5GEcfe9LfqNzEqMSkO070Sp+jLM0glls/Ydlor96UTur8JeN2inldgz2lTZKu32F/nCA= X-Received: by 2002:a1c:a986:: with SMTP id s128mr8905852wme.121.1593267177339; Sat, 27 Jun 2020 07:12:57 -0700 (PDT) MIME-Version: 1.0 References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> <20200625224522.44d6584465cb6e20d17be320@magnetkern.de> <0ec3e5a3-7f31-d1cd-6862-6066c431aa80@selasky.org> <20200626135151.e5542cf97fad213c4ad661f2@magnetkern.de> <5c0729f9-9e98-52f7-a5cb-6c5dfd2287a3@selasky.org> <20200626172851.872f3a08fa6e632666683230@magnetkern.de> <20200627144419.f14371695d9b62ea99106c4a@magnetkern.de> In-Reply-To: <20200627144419.f14371695d9b62ea99106c4a@magnetkern.de> From: Tomasz CEDRO Date: Sat, 27 Jun 2020 16:12:45 +0200 Message-ID: Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD To: Jan Behrens Cc: Hans Petter Selasky , "freebsd-usb@FreeBSD.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 49vG1R1mDlz3gFc X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cedro.info header.s=google header.b=iYIQ/NQv; dmarc=none; spf=none (mx1.freebsd.org: domain of tomek@cedro.info has no SPF policy when checking 2a00:1450:4864:20::329) smtp.mailfrom=tomek@cedro.info X-Spamd-Result: default: False [-2.23 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[cedro.info:s=google]; NEURAL_HAM_MEDIUM(-0.96)[-0.956]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.97)[-0.968]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; DMARC_NA(0.00)[cedro.info]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[cedro.info:+]; NEURAL_HAM_SHORT(-0.00)[-0.001]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::329:from]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jun 2020 14:13:00 -0000 On Sat, Jun 27, 2020 at 2:44 PM Jan Behrens wrote: > The question is: Is it correct or wise to return an error status of -99 > (LIBUSB_ERROR_OTHER) when the function is called as non-root? Maybe > it's possible to return a more fitting error code? Also note that the > debug level was set to 3, and there was still no hint written to stderr > about any privilege problem: > > #if LIBUSBX_API_VERSION < 0x01000106 > libusb_set_debug(ctx, 3); //set verbosity level to 3, as suggested in= the documentation > #else > libusb_set_option(ctx, LIBUSB_OPTION_LOG_LEVEL, 3); //set verbosity l= evel to 3, as suggested in the documentation > #endif > > Source: https://github.com/myriadrf/LimeSuite/blob/1c1c202f9a6ae4bb34068b= 6f3f576f7f8e74c7f1/src/ConnectionFTDI/ConnectionFT601Entry.cpp#L40 I guess the FreeBSD's LibUSB implementation should be one-to-one compatible with the GNU LibUSB. I would try to test and compare it with Linux and MacOS implementation and see the difference: 1. If the problem exists on FreeBSD, Linux, MacOS. If so/no then if there are different error messages / codes. If there are more verbose codes / messages on systems other than BSD then FreeBSD's implementation may need an update. However, the difference here seems to be the USB stack itself. 2. If that function blocks normal operations on FreeBSD while without it everything works fine, then it may be wrapped around ifdef and simply removed for FreeBSD. 3. Make sure this is not a bug in the LimeSDR firmware that makes this non-standard behaviour. 4. According to `man usbconfig` reset will perform "Reset the device. This forces the USB stack to reenumerate the bus.". If LimeSDR uses some dynamic USB interfaces configuration and re-organizes itself at runtime then I would observe how the FreeBSD USB stack reacts to that changes. Such reset may not be even necessary by hand (or from libusb) if the OS re-enumerates the bus for you. Maybe on other OS it is important to call that libusb reset to make sure the bus is re-enumerated. @HPS is the author of the USB stack so he could provide some hints.. but without actually seeing the device it can be hard to achieve :-) > > When in trouble always try to test at root especially when working with > > hardware. That may pinpoint the permissions issuses (not only /dev/usb* > > permissions). > > You are right, of course. As "chown user /dev/usb/2.2.*" made a > difference (and there wasn't any hint about a privilege problem), I > wrongly assumed that it was not a privilege problem. I'll know better > next time. > > Another question that I still have no clear answer to is: Is it > semantically correct to use libusb_reset_device() in the Lime Suite > driver for SoapySDR. The driver runs in the context of user > applications which likely have no root privileges (for a good reason). > I also don't know yet why this library call is made in the driver, and > which purpose it has. See also my most recent post on the myriadrf.org > discussion forum: > > https://discourse.myriadrf.org/t/limesdr-mini-with-freebsd/6230/8 > > I wrote: > > "I wonder if FreeBSD=E2=80=99s libusb should (and/or could) be fixed to e= nsure > libusb_reset_device() can be run as non-root user, or if the Lime Suite > should be fixed to not call libusb_reset_device() at all because it > might be an administrative call that should never be used by a user of > a USB device. I=E2=80=99m not sure what=E2=80=99s right to do. Particular= ly, I don=E2=80=99t > know why the Lime Suite developers included that call, and I don=E2=80=99= t even > fully understand (yet) what it does." /dev/usb* are userland "access points" to the USB devices. They may be accessed by the user according to the filesystem permissions. Some stack level operations on the USB bus/port/hub may only be accessible to the root user. Are you sure this is the problem? When run as root does the program works fine? If so, there may be a systctl setting for the stack that may allow user to reset / power-on-off the port (@HPS?)? You may want to take a look at `sysctl -a | grep usb` to search for such sysctl option. Maybe also `man usbconfig` and `man usb`. > > > What I don't understand is that the Lime Suite SoapySDR module seems = to > > > work fine on Linux and other operating systems but makes trouble with > > > FreeBSD. Is it a FreeBSD specific thing that libusb_reset_device() > > > fails if called as non-root? Again, if you are sure that this is the problem, there may be a sysctl that could set USB stack to allow non-root users to reset / power-off-on the ports - @HPS can you give a hint please? :-) > > Linux as well as other operating systems usually uses dirty and quick > > hacks. FreeBSD treats standards seriously and usually does not have the= se > > kind of dirty hacks. This is the first difference. Second difference is > > that FreeBSD has its own implementation of LibUSB. There may be a probl= em > > here bu that would require detailed investigation and proofs. Very nice > > exercise to perform :- > > I also prefer to have things implemented cleanly instead of fixing > problems in the wrong place with dirty methods. That is why I would > like to understand if calling libusb_reset_device() is semantically > correct or a wrong thing to do in the LimeSDR (Mini) driver. Cool.. seems very interesting exercise :-) > > What particular LimeSDR device do you have? Is it expensive? Can you sh= are > > a spare one for testing? Can you acquire access to hardware USB sniffer= ? > > The device I have here for testing isn't mine, so it would be difficult > to mail it. It is the "LimeSDR Mini". I asked on the myriadrf.org Forum > if the manufacturer could provide a free sample for testing. If that > doesn't work, I could also ask friends, but eventually I want to get > one (or two) for myself anyway. > > The LimeSDR and LimeSDR Mini seem to have better electrical/radio > characteristics than other available devices. Compared to the Pluto > SDR, the LimeSDR (Mini) comes with better frequency stability out of > the box, i.e. doesn't need to be modded. The LimeSDR also works on > lower frequency bands while the Pluto SDR does not. For my purposes > (general experimenting, trying to do ham radio satellite operation, > operation on different ham radio bands, etc.), the LimeSDR (Mini) seems > to be an awesome device, which is why I would really like if it was > supported by FreeBSD. I have HackRF-ONE SDR and did not observe such problems.. but also I did not use it for quite time. If LimeSDR vendor could provide three sample devices for HPS, you, and me, then we may offer a FreeBSD compatibility and testing in return.. or at least know what the problem is.. cannot tell anything for HPS though if he will have a free moment for such play :-) Can you please elaborate why this LimeSDR is better than HackRF-One? I may buy this one for testing if its worth the price :-) Mouser seems to have a good price for the bare metal version: https://pl.mouser.com/ProductDetail/Lime-Microsystems/cs-lime-05?qs=3DTiOZk= KH1s2RNd%252B0xy7toNQ%3D%3D Best regards :-) Tomek --=20 CeDeROM, SQ7MHZ, http://www.tomek.cedro.info From owner-freebsd-usb@freebsd.org Sat Jun 27 15:36:07 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C35AB354B10 for ; Sat, 27 Jun 2020 15:36:07 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from sapphire.magnetkern.de (sapphire.magnetkern.de [185.228.139.199]) by mx1.freebsd.org (Postfix) with ESMTP id 49vHsL5WWSz45sT for ; Sat, 27 Jun 2020 15:36:06 +0000 (UTC) (envelope-from jbe-mlist@magnetkern.de) Received: from titanium (p5dd45c70.dip0.t-ipconnect.de [93.212.92.112]) by sapphire.magnetkern.de (Postfix) with ESMTPSA id A6916168E; Sat, 27 Jun 2020 15:36:04 +0000 (UTC) Date: Sat, 27 Jun 2020 17:36:04 +0200 From: Jan Behrens To: Tomasz CEDRO Cc: Hans Petter Selasky , "freebsd-usb@FreeBSD.org" Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD Message-Id: <20200627173604.7f7b7777140e66dbad812fc7@magnetkern.de> In-Reply-To: References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> <20200625224522.44d6584465cb6e20d17be320@magnetkern.de> <0ec3e5a3-7f31-d1cd-6862-6066c431aa80@selasky.org> <20200626135151.e5542cf97fad213c4ad661f2@magnetkern.de> <5c0729f9-9e98-52f7-a5cb-6c5dfd2287a3@selasky.org> <20200626172851.872f3a08fa6e632666683230@magnetkern.de> <20200627144419.f14371695d9b62ea99106c4a@magnetkern.de> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49vHsL5WWSz45sT X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jbe-mlist@magnetkern.de designates 185.228.139.199 as permitted sender) smtp.mailfrom=jbe-mlist@magnetkern.de X-Spamd-Result: default: False [-2.47 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[magnetkern.de]; NEURAL_HAM_LONG(-0.98)[-0.978]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.85)[-0.848]; NEURAL_HAM_MEDIUM(-0.94)[-0.943]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:197540, ipnet:185.228.136.0/22, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[93.212.92.112:received] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jun 2020 15:36:07 -0000 On Sat, 27 Jun 2020 16:12:45 +0200 Tomasz CEDRO wrote: > I guess the FreeBSD's LibUSB implementation should be one-to-one > compatible with the GNU LibUSB. I would try to test and compare it > with Linux and MacOS implementation and see the difference: > > 1. If the problem exists on FreeBSD, Linux, MacOS. If so/no then if > there are different error messages / codes. If there are more verbose > codes / messages on systems other than BSD then FreeBSD's > implementation may need an update. However, the difference here seems > to be the USB stack itself. > > 2. If that function blocks normal operations on FreeBSD while without > it everything works fine, then it may be wrapped around ifdef and > simply removed for FreeBSD. > > 3. Make sure this is not a bug in the LimeSDR firmware that makes this > non-standard behaviour. > > 4. According to `man usbconfig` reset will perform "Reset the device. > This forces the USB stack to reenumerate the bus.". If LimeSDR uses > some dynamic USB interfaces configuration and re-organizes itself at > runtime then I would observe how the FreeBSD USB stack reacts to that > changes. Such reset may not be even necessary by hand (or from libusb) > if the OS re-enumerates the bus for you. Maybe on other OS it is > important to call that libusb reset to make sure the bus is > re-enumerated. > > @HPS is the author of the USB stack so he could provide some hints.. > but without actually seeing the device it can be hard to achieve :-) > > > > > When in trouble always try to test at root especially when working with > > > hardware. That may pinpoint the permissions issuses (not only /dev/usb* > > > permissions). > > > > You are right, of course. As "chown user /dev/usb/2.2.*" made a > > difference (and there wasn't any hint about a privilege problem), I > > wrongly assumed that it was not a privilege problem. I'll know better > > next time. > > > > Another question that I still have no clear answer to is: Is it > > semantically correct to use libusb_reset_device() in the Lime Suite > > driver for SoapySDR. The driver runs in the context of user > > applications which likely have no root privileges (for a good reason). > > I also don't know yet why this library call is made in the driver, and > > which purpose it has. See also my most recent post on the myriadrf.org > > discussion forum: > > > > https://discourse.myriadrf.org/t/limesdr-mini-with-freebsd/6230/8 > > > > I wrote: > > > > "I wonder if FreeBSD’s libusb should (and/or could) be fixed to ensure > > libusb_reset_device() can be run as non-root user, or if the Lime Suite > > should be fixed to not call libusb_reset_device() at all because it > > might be an administrative call that should never be used by a user of > > a USB device. I’m not sure what’s right to do. Particularly, I don’t > > know why the Lime Suite developers included that call, and I don’t even > > fully understand (yet) what it does." > > /dev/usb* are userland "access points" to the USB devices. They may be > accessed by the user according to the filesystem permissions. Some > stack level operations on the USB bus/port/hub may only be accessible > to the root user. > > Are you sure this is the problem? When run as root does the program > works fine? If so, there may be a systctl setting for the stack that > may allow user to reset / power-on-off the port (@HPS?)? You may want > to take a look at `sysctl -a | grep usb` to search for such sysctl > option. Maybe also `man usbconfig` and `man usb`. I haven't done a full analysis of the behavior with root privileges (or with a commented out libusb_reset_device call) yet. What I did is the following: 1. Comment out the libusb_reset_device(dev_handle) call in LimeSuite-20.01.0/src/ConnectionFTDI/ConnectionFT601.cpp 2. Compile and install the SoapyLMS7 module of Lime Suite (other parts of Lime Suite will fail to compile, which is a different issue but not required to fix to get the SoapySDR library to work) 3. Use a small C program to setup the LimeSDR Mini and record an I/Q stream to a file. (For those who are not familiar with the term "I/Q-Stream", it's raw sample data recording a radio band around a given center frequency, e.g. 145 MHz plus/minus 1 MHz using complex-valued samples representing in-phase and quadrature components.) I used a walkie talkie to do a test transmission in FM and I could later decode that FM transmission from the I/Q stream (using gqrx with that I/Q file as input). Unfortunately, the gqrx package in FreeBSD doesn't come with Soapy support, so I cannot use gqrx on FreeBSD to access the LimeSDR Mini directly (even with the SoapySDR driver working). Instead, I had to record the I/Q-Stream with my C program and later feed it into gqrx. Improving FreeBSD's packages to support SoapySDR and the Lime Suite is a different issue though, which I'd like to see solved and where I'd also be happy to help. However, I have no experiences in creating packages for FreeBSD yet and the last time I tried, I got pretty confused and failed. Anyway, I can confirm that it was possible to use the LimeSDR Mini with FreeBSD (with my self written C program) as long as that libusb_reset_device() call in the driver is commented out. However, I don't know if this works stable and if there are any other unwanted side effects. Also transmitting an I/Q stream did work (again, using a C program that directly interfaces the SoapySDR library). There are still a lot of error messages regarding "libusb_handle_events_timeout_completed". Not sure what that means. About the reset: No idea if it's even needed or why it's done. I assume only someone with deeper knowledge can answer it (either with knowledge about the LimeSDR driver or about libusb). > > > > > What I don't understand is that the Lime Suite SoapySDR module seems to > > > > work fine on Linux and other operating systems but makes trouble with > > > > FreeBSD. Is it a FreeBSD specific thing that libusb_reset_device() > > > > fails if called as non-root? > > Again, if you are sure that this is the problem, there may be a sysctl > that could set USB stack to allow non-root users to reset / > power-off-on the ports - @HPS can you give a hint please? :-) > > [...] > > > > What particular LimeSDR device do you have? Is it expensive? Can you share > > > a spare one for testing? Can you acquire access to hardware USB sniffer? > > > > The device I have here for testing isn't mine, so it would be difficult > > to mail it. It is the "LimeSDR Mini". I asked on the myriadrf.org Forum > > if the manufacturer could provide a free sample for testing. If that > > doesn't work, I could also ask friends, but eventually I want to get > > one (or two) for myself anyway. > > > > The LimeSDR and LimeSDR Mini seem to have better electrical/radio > > characteristics than other available devices. Compared to the Pluto > > SDR, the LimeSDR (Mini) comes with better frequency stability out of > > the box, i.e. doesn't need to be modded. The LimeSDR also works on > > lower frequency bands while the Pluto SDR does not. For my purposes > > (general experimenting, trying to do ham radio satellite operation, > > operation on different ham radio bands, etc.), the LimeSDR (Mini) seems > > to be an awesome device, which is why I would really like if it was > > supported by FreeBSD. > > I have HackRF-ONE SDR and did not observe such problems.. but also I > did not use it for quite time. > > If LimeSDR vendor could provide three sample devices for HPS, you, and > me, then we may offer a FreeBSD compatibility and testing in return.. > or at least know what the problem is.. cannot tell anything for HPS > though if he will have a free moment for such play :-) Well, I wouldn't say no to a free sample, but at the moment I have a LimeSDR Mini available here for me to use (but it's not mine, so I can't mail it around, and not sure how long I can keep it). So right now I don't really need one for testing things here on my end. But it would be nice if they could provide a free sample for one of you. I do not have access to a hardware USB sniffer (and not sure if I would be capable to operate it properly). In due time, I might be able to get access on a second device or likely buy one myself. They are not that expensive, but certainly more expensive than an RTLSDR. Price is between €150 and €200, like you discovered on Mouser's website linked below. > > Can you please elaborate why this LimeSDR is better than HackRF-One? I > may buy this one for testing if its worth the price :-) I don't know all technical specs for each of them, but when I experimented with the HackRF-One, I had a less clean signal (noise and/or mirror effects). I am not sure if this was due to the HackRF-One or because I operated the device improperly (I was new to ham radio at that stage). According to my information, the HackRF-One comes with USB2, which limits the data rate, and it only has an 8 bit ADC. It also cannot transmit and receive at the same time (half-duplex). The LimeSDR Mini has two antenna connectors and is full-duplex (though I haven't tested that yet). Its resolution is 12 Bit (instead of 8 Bit), so there should be less quantization noise and higher dynamic range. It is a USB 3.0 device, so the maximum data rate should be higher as well. There are some issues with the LimeSDR Mini when you want to transmit or receive on frequencies below 30.72 MHz. I had to set the RF frequency to a value higher than 30.72 MHz and call SoapySDRDevice_setFrequencyComponent(device, SOAPY_SDR_TX, 0, "BB", offset, NULL)) to add a further (negative) offset to reach the 11m and 10m bands. I think if you want to get even further down, you have to increase the bandwidth to reach further down from the center frequency, but I have no experiences with that (yet). > > Mouser seems to have a good price for the bare metal version: > https://pl.mouser.com/ProductDetail/Lime-Microsystems/cs-lime-05?qs=TiOZkKH1s2RNd%252B0xy7toNQ%3D%3D > > Best regards :-) > Tomek > > -- > CeDeROM, SQ7MHZ, http://www.tomek.cedro.info Regards, Jan From owner-freebsd-usb@freebsd.org Sat Jun 27 15:53:16 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 274FC3557E5 for ; Sat, 27 Jun 2020 15:53:16 +0000 (UTC) (envelope-from tomek@cedro.info) Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49vJF66430z47bg for ; Sat, 27 Jun 2020 15:53:14 +0000 (UTC) (envelope-from tomek@cedro.info) Received: by mail-wr1-x42f.google.com with SMTP id g18so12347229wrm.2 for ; Sat, 27 Jun 2020 08:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cedro.info; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aHf9Bs8ZonzGnx49GL424j1o4pXI2j6inaa2c7wtCE8=; b=IV0wkOKzVh0hr/SeCKm54gVMQ+ZcO+wegCtD5o/BHA9bG4PAijnKesZdSleTVvlQOB jzwxxY/qQ/rsBH2pdsBurumLXLEVoTapxOd0CTLQgCDXHQvx/pgEzdpsG0fBkIx27zJw ErJ6x4+unVpWO2E7MZGk93dUyiCnNl8DcwndKtrJdYi8/a3ca/CC0QbWRlyK1jJZPrm2 hKRuqWg8A7GM+LoffOk8iWChOquEE0sEuL3U2uBAC4KF26/bQWTd7/9/4WIji9YOW7iN NC1EP58KCBKSUBA6rQNnyF9KwMkge6orPt0J3qn/eVPO3OgdFCEK8pzDglcfttf01jZ8 okyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aHf9Bs8ZonzGnx49GL424j1o4pXI2j6inaa2c7wtCE8=; b=uBBqjslsOvc+fKNBtfq1+To+fZqS4VVFbCIQqrtqiCtY6WUf0ZvT38DOmxrPRfprHg 5lmHkmSHPpxCwmjg+EwUZUBjmV/6V0/KBWSvw7AJLNG5ltVf18QplYbtjFrKmd5VAHCx kR6RLvfH0ssjlpeYpmFiX7ZVZGluzfvkCvoFqtmzs2SsCqiug3t00GKN85FxAYOF8pMi oJW3IxJHmV2tWfLZTz9JVJ6ra35lqZdEN+KLmu1at+lHzeugqY07HOk4WiXBMfZyYo+n w719Yk66872ltWAwF+Q74aZ18j/r4gbbSGSN2IO+tI3miI8LdB/eWC4KKJjGR7VrG+bZ I2GA== X-Gm-Message-State: AOAM5323z6i2MYw9ZN+zoZT94GyWziCXbJNqDdi7zBsLnsJcdIb+qZ/N gfdTqZBPGVJFgY+gkzKl90AtCvCLEHnXZO2VY7Va5YHc X-Google-Smtp-Source: ABdhPJxr/ePLrIJvVxQI3PYs/k9C4g2mIwfiyAGVF3seJCcTV3onZxE/YbuSAR1JkzQqAB2Uek+FLsD9vTLmdBBcjgY= X-Received: by 2002:a5d:6907:: with SMTP id t7mr8934401wru.329.1593273193206; Sat, 27 Jun 2020 08:53:13 -0700 (PDT) MIME-Version: 1.0 References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> <20200625224522.44d6584465cb6e20d17be320@magnetkern.de> <0ec3e5a3-7f31-d1cd-6862-6066c431aa80@selasky.org> <20200626135151.e5542cf97fad213c4ad661f2@magnetkern.de> <5c0729f9-9e98-52f7-a5cb-6c5dfd2287a3@selasky.org> <20200626172851.872f3a08fa6e632666683230@magnetkern.de> <20200627144419.f14371695d9b62ea99106c4a@magnetkern.de> <20200627173604.7f7b7777140e66dbad812fc7@magnetkern.de> In-Reply-To: <20200627173604.7f7b7777140e66dbad812fc7@magnetkern.de> From: Tomasz CEDRO Date: Sat, 27 Jun 2020 17:53:01 +0200 Message-ID: Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD To: Jan Behrens Cc: Hans Petter Selasky , "freebsd-usb@FreeBSD.org" X-Rspamd-Queue-Id: 49vJF66430z47bg X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cedro.info header.s=google header.b=IV0wkOKz; dmarc=none; spf=none (mx1.freebsd.org: domain of tomek@cedro.info has no SPF policy when checking 2a00:1450:4864:20::42f) smtp.mailfrom=tomek@cedro.info X-Spamd-Result: default: False [-3.04 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[cedro.info:s=google]; NEURAL_HAM_MEDIUM(-0.95)[-0.950]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.97)[-0.966]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; DMARC_NA(0.00)[cedro.info]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[cedro.info:+]; NEURAL_HAM_SHORT(-0.82)[-0.824]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::42f:from]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jun 2020 15:53:16 -0000 Another idea: are you sure you are using valid usb cable and capable usb port? Please try with another short length certified cable and use direct usb 3.0 port with no usb hub. Cables and HUBs (even those built-in) are the most common problem :-) -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info From owner-freebsd-usb@freebsd.org Sat Jun 27 16:04:28 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B636355C9B for ; Sat, 27 Jun 2020 16:04:28 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49vJV308wbz47t1 for ; Sat, 27 Jun 2020 16:04:26 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm1-x32e.google.com with SMTP id a6so10835738wmm.0 for ; Sat, 27 Jun 2020 09:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=6Hrc+/zP4xHL4+GhefknOUR0Z39RgO4StxXAZkdC7yk=; b=oPCwOAPeKkBQuUz8q1XcDOMdDG0c3lAa85Ut2gZv7DQ597rRph5XX+foZ6d861aSkC k62I6qw9VKPqESimZ0ZtTsDlOfq86/GiZZhDnjaksJY1DcHv8LoK5ksqYO3TT8nZoAb6 hV/2Zi05LHhSNmq+X5zBYS+PgUYDsmFFcuXwoEaM36lhZPhmreWjy+hLqZ/Y4gMwiaAp /jis1qHfQAUwgJ/vfBvOlwY0RCT1H49khM1iYj3cd/4lcHihx7CulT4Z9T/2DaeU8i7D kNxupz8yLq+i53nncuFAdyXGSPdCDfEpt9mFUjQgDIttU5wMGg6h1EqYOsDSzOpdWkvi 4GjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=6Hrc+/zP4xHL4+GhefknOUR0Z39RgO4StxXAZkdC7yk=; b=p1AHc3xLkm0DU+LhjTL/eqzBKwXblTODt3TMcZWgrXckCJobFIgD+H5Bvi3+LeGnv3 jQiMdIpzpKsF1qvK8sh7CkLBlsls8HELEm+l76uN5fzGfvBHaUb7F4Qtvi2HRK7bhTMh Sv3ffcERHyMiq+YYwW9elOFqz6aBvOFue4V+/6Ax4aLkoQuNCgQ3k8zOBGrIlKHxruNm Jbs/lFPRkhISHC14+EGx/Ew5Ik7pNuG+2hhLq9dkYhSTGP5RPVXxvK10T/J0fRNVla6d Aek+vGWyv/z1Sm+wICEEIEUYKW8ltKxor3RhGBMfhZE6xsynUEAlIiHxz+zwqsD5xNMX j/Vw== X-Gm-Message-State: AOAM532inNi8Zab40hBKHSnGaE4I+OGFwUaOjPFJA9nI9WtdyPKIhGdn Ee9VjwO4tGK6AZ9DmIt512k= X-Google-Smtp-Source: ABdhPJw9Amc/dpK7AjvQqc9oz5gb89kZDOY7RtlVAb4qM5+dM/abhYCvgqv5qgcWnOewYt4fiB+33w== X-Received: by 2002:a1c:2d54:: with SMTP id t81mr9388152wmt.154.1593273864586; Sat, 27 Jun 2020 09:04:24 -0700 (PDT) Received: from ernst.home (p5b023dd0.dip0.t-ipconnect.de. [91.2.61.208]) by smtp.gmail.com with ESMTPSA id j6sm15297936wma.25.2020.06.27.09.04.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jun 2020 09:04:24 -0700 (PDT) Date: Sat, 27 Jun 2020 18:04:20 +0200 From: Gary Jennejohn To: Tomasz CEDRO Cc: Jan Behrens , "freebsd-usb@FreeBSD.org" Subject: Re: USB reset fails when using a LimeSDR Mini on FreeBSD Message-ID: <20200627180420.4b8012fb@ernst.home> In-Reply-To: References: <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> <20200625224522.44d6584465cb6e20d17be320@magnetkern.de> <0ec3e5a3-7f31-d1cd-6862-6066c431aa80@selasky.org> <20200626135151.e5542cf97fad213c4ad661f2@magnetkern.de> <5c0729f9-9e98-52f7-a5cb-6c5dfd2287a3@selasky.org> <20200626172851.872f3a08fa6e632666683230@magnetkern.de> <20200627144419.f14371695d9b62ea99106c4a@magnetkern.de> <20200627173604.7f7b7777140e66dbad812fc7@magnetkern.de> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49vJV308wbz47t1 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=oPCwOAPe; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of gljennjohn@gmail.com designates 2a00:1450:4864:20::32e as permitted sender) smtp.mailfrom=gljennjohn@gmail.com X-Spamd-Result: default: False [-4.10 / 15.00]; HAS_REPLYTO(0.00)[gljennjohn@gmail.com]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.17)[-1.170]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RECEIVED_SPAMHAUS_PBL(0.00)[91.2.61.208:received]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-0.93)[-0.935]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::32e:from]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jun 2020 16:04:28 -0000 On Sat, 27 Jun 2020 17:53:01 +0200 Tomasz CEDRO wrote: > Another idea: are you sure you are using valid usb cable and capable usb > port? Please try with another short length certified cable and use direct > usb 3.0 port with no usb hub. Cables and HUBs (even those built-in) are the > most common problem :-) > Lookig at the libusb code, libusb_reset_device() only returns an error if resetting the device fails. Resetting the device requires making ioctl() calls into the kernel. ioctl() calls pretty much always require root permissions. -- Gary Jennejohn From owner-freebsd-usb@freebsd.org Sat Jun 27 20:29:29 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53F6B35B4E2 for ; Sat, 27 Jun 2020 20:29:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 49vQMs1Zywz4Q51 for ; Sat, 27 Jun 2020 20:29:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 342E135B4E1; Sat, 27 Jun 2020 20:29:29 +0000 (UTC) Delivered-To: usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33F1B35B4E0 for ; Sat, 27 Jun 2020 20:29:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49vQMs0dJXz4PtL for ; Sat, 27 Jun 2020 20:29:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CD0DAEBD for ; Sat, 27 Jun 2020 20:29:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 05RKTSSs034258 for ; Sat, 27 Jun 2020 20:29:28 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 05RKTSti034257 for usb@FreeBSD.org; Sat, 27 Jun 2020 20:29:28 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: usb@FreeBSD.org Subject: [Bug 230038] regression USB mass storage device Date: Sat, 27 Jun 2020 20:29:28 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 11.2-RELEASE X-Bugzilla-Keywords: regression X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: bsd@volki.at X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jun 2020 20:29:29 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D230038 Friedrich Volkmann changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bsd@volki.at --- Comment #2 from Friedrich Volkmann --- Problem persists in 12.1-STABLE r358922. (My Garmin is a Dakota 20.) I get another scbus number, so I wrote a shell script that parses the output of "camcontrol devlist" as a workaround: #!/bin/bash camline=3D`camcontrol devlist|grep 'GARMIN Flash'` while test -z "$camline" ;do echo not found, waiting 5 seconds... sleep 5 camline=3D`camcontrol devlist|grep 'GARMIN Flash'` done # output: at scbus8 target 0 lun 0 (da0,pass4) camline=3D${camline#*scbus} bus=3D${camline%% *} camline=3D${camline#*target } target=3D${camline%% *} camline=3D${camline#*lun } lun=3D${camline%% *} echo -n bus:target:lun =3D $bus:$target:$lun lun=3D$(($lun + 1)) echo " -> $bus:$target:$lun" camcontrol rescan $bus:$target:$lun --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-usb@freebsd.org Sat Jun 27 20:34:29 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6DC035C085 for ; Sat, 27 Jun 2020 20:34:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 49vQTd4VMQz4QcF for ; Sat, 27 Jun 2020 20:34:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 987D235BF12; Sat, 27 Jun 2020 20:34:29 +0000 (UTC) Delivered-To: usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9841935BD71 for ; Sat, 27 Jun 2020 20:34:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49vQTd3c3xz4QcD for ; Sat, 27 Jun 2020 20:34:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 772F3B0C8 for ; Sat, 27 Jun 2020 20:34:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 05RKYT1S041098 for ; Sat, 27 Jun 2020 20:34:29 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 05RKYTUF041097 for usb@FreeBSD.org; Sat, 27 Jun 2020 20:34:29 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: usb@FreeBSD.org Subject: [Bug 230038] regression USB mass storage device Date: Sat, 27 Jun 2020 20:34:29 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 11.2-RELEASE X-Bugzilla-Keywords: regression X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: bsd@volki.at X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jun 2020 20:34:29 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D230038 --- Comment #3 from Friedrich Volkmann --- How can we set the status to "confirmed" and the importance to "affects many people"? --=20 You are receiving this mail because: You are the assignee for the bug.=