Help! No USB data connection outside of fastbootd/recovery on FP4

Hello everyone,

I could use some help debugging a USB problem I have. The symptoms are lack of any usb data connection outside of Lineage recovery and fastbootd. I did a factory reset, but even the nuclear option didn’t fix it. Curiously, I cannot gain a USB data connection after rebooting to the bootloader, either. Something appears to have changed somewhere when I was trying to help check the kernel nodes for idle mode support, but I can’t figure out what. Any insight would be very much welcome!

When I plug in, I see:

04-10 13:15:52.524   991  2345 I android.hardware.usb@1.3-service-qti: uevent received add@/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pm7250b@2:qcom,usb-pdphy@1700/typec/port0/port0-partner
04-10 13:15:52.525   991  2345 I android.hardware.usb@1.3-service-qti: partner added
04-10 13:15:52.525   991  2345 I android.hardware.usb@1.3-service-qti: uevent recieved for same device 3.0A
04-10 13:15:52.529   991  2345 I android.hardware.usb@1.3-service-qti: port0
04-10 13:15:52.533   991  2345 I android.hardware.usb@1.3-service-qti: connected:1 canChangeMode:1 canChagedata:0 canChangePower:0
04-10 13:15:52.535  1627  4083 I UsbPortManager: ClientCallback V1_2: port0
04-10 13:15:52.536  1627  1859 I UsbPortManager: USB port changed: port=UsbPort{id=port0, supportedModes=dual, audio_accsupportedContaminantProtectionModes=5supportsEnableContaminantPresenceProtection=falsesupportsEnableContaminantPresenceDetection=false, status=UsbPortStatus{connected=true, currentMode=ufp, currentPowerRole=sink, currentDataRole=device, supportedRoleCombinations=[source:host, sink:device], contaminantDetectionStatus=2, contaminantProtectionStatus=1, usbDataStatus=unknown, isPowerTransferLimited=false, powerBrickConnectionStatus=unknown}, canChangeMode=true, canChangePowerRole=false, canChangeDataRole=false, connectedAtMillis=1859397, lastConnectDurationMillis=0

I noticed usbd isn’t running, but when I execute ‘start usbd’, I get:

04-10 12:57:48.828   607   607 I hwservicemanager: getTransport: Cannot find entry android.hardware.usb.gadget@1.0::IUsbGadget/default in either framework or device VINTF manifest.
04-10 12:57:48.829  5859  5859 I usbd    : Usb HAL not found

Ouch. My USB related props looks like this:

FP4:/ # getprop | grep usb                                                                                          
[init.svc.usbd]: [stopped]
[init.svc.vendor.usb-hal-1-3]: [running]
[init.svc_debug_pid.usbd]: []
[init.svc_debug_pid.vendor.usb-hal-1-3]: [990]
[persist.sys.usb.config]: [adb,mtp]
[persist.vendor.usb.config.extra]: [none]
[ro.boot.usbcontroller]: [a600000.dwc3]
[ro.boottime.usbd]: [7124607496]
[ro.boottime.vendor.usb-hal-1-3]: [5513638018]
[sys.usb.adb.disabled]: [0]
[sys.usb.config]: [adb]
[sys.usb.configfs]: [1]
[sys.usb.controller]: [a600000.dwc3]
[sys.usb.ffs.ready]: [1]
[sys.usb.mtp.device_type]: [3]
[sys.usb.state]: [adb]
[vendor.audio.feature.usb_offload.enable]: [true]
[vendor.audio.feature.usb_offload_burst_mode.enable]: [true]
[vendor.audio.feature.usb_offload_sidetone_volume.enable]: [false]
[vendor.audio.usb.disable.sidetone]: [true]
[vendor.sys.usb.adb.disabled]: [0]
[vendor.usb.configfs]: [1]
[vendor.usb.controller]: [a600000.dwc3]
[vendor.usb.diag.func.name]: [diag]
[vendor.usb.dpl.inst.name]: [dpl]
[vendor.usb.product_string]: [Fairphone 4 5G]
[vendor.usb.qdss.inst.name]: [qdss_mdm]
[vendor.usb.rmnet.func.name]: [gsi]
[vendor.usb.rmnet.inst.name]: [rmnet]
[vendor.usb.rndis.func.name]: [gsi]
[vendor.usb.rps_mask]: [0]
[vendor.usb.use_ffs_mtp]: [0]
[vendor.usb.use_gadget_hal]: [0]

I reflashed Iode using the flash_all shell script via fastbootd, but I’d guess something, somewhere is not being overwritten. The fact the problem affects the bootloader as well after a normal boot is really worrisome.

I don’t see anything abnormal here. ADB is not concerned by USB gadget mode.
However, are you sure that your usb connection is configured for ADB, and not MTP ? You can check in the USB icon (should be No data transfert).

I’m sorry, but there is definitely a lot that is wrong in those log messages. usbd should not be dying like that and adb and mtp modes are a part of the standard Android USB gadget!

What do you mean exactly by “lack of usb data connection” ? Are you speaking of MTP ? And can you connect with adb ? It seems yes, from the samples you provide ?

To be precise, USB gadget mode is broken, which means I have no ADB over USB, no MTP or any other gadgets. Host mode still works fine – I can hook up a USB drive or output to HDMI without issue. I can also establish an ADB connection over WiFi, of course, and thus I was able to logcat the errors above, which detail the problem.

There must be a partition containing USB configuration that I need to overwrite with a clean image, but I don’t know which one. I was just hoping you’d have sufficient knowledge of Android/Linux architecture to be able to help out. The worst part of the problem is that bootloader mode is broken.