[Bug] Pixel 11 Pro Fold fails to connect: "OpenSession after reset: LIBUSB_ERROR_NOT_FOUND (PID: 2321, 1376, 1365, 2334, 19316, 603)"

未关闭
#17 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
1-2 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
macos, swift
领域
backend, desktop

调研方向

Start at the USB device setup and OpenSession reset path that produces LIBUSB_ERROR_NOT_FOUND, then inspect how SwiftMTP handles macOS ptpcamerad probing; the issue identifies a suspected race but does not name source files or tests. Reproduce with the Pixel 11 Pro Fold in File Transfer mode and compare with OpenMTP on the same setup. Done means SwiftMTP maintains the MTP session and transfers files without Android dropping back to charging only.

由索引模型根据 Issue 内容生成。

描述

Describe the bug

When connecting a Google Pixel 11 Pro Fold via USB-C in "File Transfer" mode, SwiftMTP detects the device and briefly starts loading files for 1-2 seconds before immediately failing with the error:

Device setup failed, please reconnect or restart device: OpenSession after reset: LIBUSB_ERROR_NOT_FOUND (PID: 2321, 1376, 1365, 2334, 19316, 603)

Immediately after this error occurs, Android detects the USB reset/interruption and automatically drops the MTP session, reverting back to "No data transfer" (Charging only).

Additionally, clicking "Check for Updates..." in the Info & Update tab fails with Check failed.

Steps to Reproduce
  1. Connect Google Pixel 11 Pro Fold to Mac via USB-C.
  2. Select "File Transfer / Android Auto" mode on Android.
  3. Open SwiftMTP (tested on both v1.2.3 and v1.2.4).
  4. The device begins loading files for 1-2 seconds, then drops with LIBUSB_ERROR_NOT_FOUND.
Environment
  • SwiftMTP Version: v1.2.4 (also reproducible on v1.2.3)
  • Device: Google Pixel 11 Pro Fold (Android 15)
  • macOS Version: macOS (Apple Silicon)
  • Connection: Direct USB-C to USB-C cable
PIDs & Technical Details
  • Error reported PIDs: (PID: 2321, 1376, 1365, 2334, 19316, 603)
  • Inspecting the processes on macOS shows that PID 19316 (and in previous attempts 35204) corresponds to macOS /usr/libexec/ptpcamerad (which launchd automatically spawns whenever a USB camera/MTP device is plugged in), while other PIDs are standard background apps holding unrelated IOHID/USB descriptors.
  • Because libusb_reset_device / OpenSession is invoked while macOS ptpcamerad probes the device, a race condition occurs, causing the session to fail and Android to disconnect.
  • Comparison: OpenMTP on the same machine and cable connects and transfers files without dropping the session.
主要语言
Swift
星标
481
派生
11
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Neighbor-Z/SwiftMTP 的其他 Issue

查看 Neighbor-Z/SwiftMTP 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。