We have moved to a new Sailfish OS Forum. Please start new discussions there.
1

[bug] mtp usb broken on xperia X SFOS 3.0.2

asked 2019-04-24 08:20:24 +0300

TinLethax gravatar image

updated 2019-04-24 09:57:50 +0300

Today I just update my xperia X via ssu and version --dup from 3.0.1.11 to the 3.0.2. After installation completed everything seems fine then I connect my phone to my pc (running Xubuntu). This update is very weird. sfos ask me to select the USB mode. I selected the MTP mode but nothing on my pc, I can;t find any device related to my xperia X. I use usb-devices to see if there's anything related to the xpx but nothing. But when I select the charging mode. usb-devices show up my sony device as Driver=usb-storage . I tried rebooting but not help. any suggestion ?

UPDATE : I successfully use MTP. It takes very long time (about 20s). In previous version is just a few second.

edit retag flag offensive close delete

Comments

1

Hello,

I have the same problem with my Xperia X. Everything worked good with SFOS 3.0.1.

I used USB with mode developper. Since 3.0.2 and now 3.0.3, when I connect USB, nothing happens it only charge.

In the USB settings, if I selected developper mode and connect the cable. It tells "charge only, reconnect cable to use selected mode". If I reconnect still same message. If I select MTP mode, I got the same message ... If I select always ask, I have no menu, it charges only ... If I select always ask with my Jolla 1 in SFOS 3.0.3, I have the menu to select developper, MTP or charge only. Something is wrong with Xperia X :( ...

What could be done ? Please help ...

canard ( 2019-05-17 20:19:03 +0300 )edit

Did you use external SD card and almost to full ? It can takes a while to mount to the PC.

TinLethax ( 2019-06-01 18:37:30 +0300 )edit

Hello,

Yes I use a micro SD card. 8GB is used in a 32GB card. It is not full ... I tried too without the SD card, same problem. I waited for one minute, no menu to choose developper mode.

My F5121, in 3.0.3.10 is connected to a Debian 9.9. When looking at log with "tail -f /var/log/messages", there is no output. When I connect Jolla Phone, I have some output starting with

 usb 8-1: new high-speed USB device number 2 using ehci-pci
...

On the Xperia X, when I connect the USB, dmesg output this.

SMBCHG: usbin_uv_handler: chip->usb_present = 0 rt_sts = 0x00 hvdcp_3_det_ignore_uv = 0 aicl = 550
msm_otg 78db000.usb: select port USB1
SMBCHG: power_ok_handler: triggered: 0x01
SMBCHG: src_detect_handler: chip->usb_present = 0 usb_present = 1 src_detect = 1 hvdcp_3_det_ignore_uv = 0
SMBCHG: handle_usb_insertion: inserted type = 5 (OTHER)
qpnp-smbcharger 02-qcom,qpnp-smbcharger: get_prop_proprietary_charger: voltage not in range, D+=4676943, D-=4911243
SMBCHG: power_ok_handler: triggered: 0x00
SMBCHG: power_ok_handler: triggered: 0x01
msm_otg 78db000.usb: otg_power_set_property_usb: clear retry count=0
msm_otg 78db000.usb: Avail curr from USB = 1500
FG: fg_power_set_property: psp 0, val = 1
FG: fg_power_set_property: psp 0, val = 1
SMBCHG: fastchg_handler: p2f triggered
FG: fg_power_set_property: psp 0, val = 1
SMBCHG: aicl_done_handler: triggered, aicl: 1400
SMBCHG: increment_aicl_count: aicl count c:0 dgltch:0 first:3377637

How can I know if it is a hardware trouble ? Or a software trouble ? It used to work until SFOS 3.0.1 ...

canard ( 2019-06-02 18:25:48 +0300 )edit

from this quote might help you >> here

TinLethax ( 2019-06-08 16:07:05 +0300 )edit

Thanks, unfortunately, it doesn't help, I've already checked. The USB settings works correctly and is conform with the result of the command usb_moded_util

canard ( 2019-06-13 22:51:41 +0300 )edit

3 Answers

Sort by » oldest newest most voted
3

answered 2019-04-24 15:16:37 +0300

spiiroin gravatar image

Previously mtp activation was done so that: mtp functionality was declared on usb immediately - before sfos was actually able to handle requests made from pc end. The delay between "supposedly ready to serve" and "actually ready to serve" grows in proportion to number of files present on filesystems exposed via mtp -> as the device accumulates files (photos, audiofiles, etc.), it becomes more and more likely that pc side hits timeouts and gives up .

How that has changed over last couple of releases is: All filesystem scanning and mtp storage enumeration is finalized before mtp functionality is exposed on usb -> sfos is ready to serve immediately when pc side sees mtp device -> pc side should not bump into timeouts. The caveat is that "nothing happens" during the filesystem enumeration. Note that in in SFOS >= 3.0.3 there are "busy activating mtp mode" style notifications to make this delay more visible to the users.

edit flag offensive delete publish link more

Comments

I can confirm the Preparing USB mode message in 3.0.3.

Maus ( 2019-04-24 15:48:55 +0300 )edit
0

answered 2019-11-15 14:01:01 +0300

NN9 gravatar image

updated 2019-11-15 14:06:22 +0300

Hi!

Try this : go to /lib/udev/rules.d/ , search 69-libmtp.rules. Here is the first line from original file : ACTION!="add", GOTO="libmtp_rules_end"

You need to add this to the first line : ACTION!="bind",

After, the first line will be : ACTION!="bind", ACTION!="add", GOTO="libmtp_rules_end"

Save, restart file manager and reconnect your phone. I hope, this will help for you. I found this solution online. I apologize to the owner of the original idea for not being able to name it. Have a nice day!

edit flag offensive delete publish link more

Comments

@NN9 Note: Adjusting PC side mtp udev rules should not have any effect on mtp preparation delay as the phone does not register as mtp device until the delay is over -> Even if this would help with something else, it would be a massive surprise to me if it does anything about mtp delay.

spiiroin ( 2019-11-18 10:10:57 +0300 )edit
0

answered 2019-11-19 20:16:36 +0300

NN9 gravatar image

@spiiroin I use two Linux distros ( Debian8-KDE and Manjaro-KDE ). I've made the changes mentioned above on both of them. I haven't had to wait since, almost everything's working out. I can to copy files from the phone (or SD card) and to the phone (or SD card) immediately. Please, try it... Sony Xperia X F5121 SFOs 3.1.0.11 Seitseminen Device adaptation 0.2.1.17 Best regards!

edit flag offensive delete publish link more

Comments

@NN9 I took a look around and found this: https://bugs.kde.org/show_bug.cgi?id=387454#c25

Provided that I grok that discussion: Semantics of "add" event have changed in kernel -> Need to wait for "bind" event to have all properties etc in place. But some rules still need to be processed already in the "add" stage -> Process mtp rules both on "add" and "bind" events -> The udev rule change makes pc side processing more robust, but it does not make mtp device available any earlier.

Just for fun I tried it and can't really see any difference i.e. the mtp scanning delay is still there - as expected.

Note that this delay depends on number of files that are exposed over mtp. With fresh install it is not really noticeable, but as the device accumulates photos etc situation changes gradually.

If you want to "fast forward" and check how it can look like:

  1. Create bunch of dummy files under you phone's home dir, say 200 000 or so
mkdir mtp-testing
cd mtp-testing
mkdir dir0
cd dir0
for i in $(seq 1000); do touch file$i.txt; done
cd ..
for i in $(seq 200); do cp -aL dir0 dir$i; done
cd ..
find mtp-testing -type f | wc -l
  1. Reboot the device (to flush fs caches and thus make scanning slower)

  2. Attach cable and select mtp mode

What I get with xa2 is: About 25 seconds of pc doing nothing, while phone occasionally reports "activating mtp mode". Then the phone changes usb config to "mtp device", pc sees it and reacts - about the same time as "mtp mode activated" notification shows up on the phone screen.

spiiroin ( 2019-11-21 18:05:52 +0300 )edit
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2019-04-24 08:20:24 +0300

Seen: 571 times

Last updated: Nov 19 '19