viveris / uMTP-Responder

Lightweight USB Media Transfer Protocol (MTP) responder daemon for GNU/Linux
GNU General Public License v3.0
192 stars 52 forks source link

Windows notify of new files #68

Open IanCassTwo opened 2 years ago

IanCassTwo commented 2 years ago

I'm just testing this and find that when I add new files on the Linux side, they don't show up on the Windows side.

I've enabled debug & found that the inotify does fire and uMTPrd tries to send the push even but it seems to get stuck writing the event...

non-blocking writes... [uMTPrd - 19:49:05 - Debug] add_entry : File not present - add entry (xxxxxxxxxx.jpg) [uMTPrd - 19:49:05 - Debug] mtp_push_event : Event packet buffer - 16 Bytes : [uMTPrd - 19:49:05 - Debug] 10 00 00 00 04 00 02 40 01 00 00 00 1A 00 00 00 .......@........ [uMTPrd - 19:49:05 - Debug] write_usb: channel 2 [uMTPrd - 19:49:05 - Debug] write_usb: non blocking write [uMTPrd - 19:49:05 - Debug] write_usb: polling [uMTPrd - 19:49:05 - Debug] write_usb: writing

or for blocking writes... [uMTPrd - 20:03:18 - Debug] add_entry : File not present - add entry (xxxxxxxxxxx.jpg) [uMTPrd - 20:03:18 - Debug] mtp_push_event : Event packet buffer - 16 Bytes : [uMTPrd - 20:03:18 - Debug] 10 00 00 00 04 00 02 40 01 00 00 00 1B 00 00 00 .......@........ [uMTPrd - 20:03:18 - Debug] write_usb: channel 2 [uMTPrd - 20:03:18 - Debug] write_usb: blocking write

Excuse more debugging that I added. :)

This is on Raspberry Pi. I've tested with both FunctionFS and GadgetFS with same result.

I've got a usb capture running on Windows side & am currently trying to debug to see what actually comes through

jfdelnero commented 2 years ago

Some years ago i made some tests with an android smartphone and i remember the issue was the same with the Android MTP Responder (Android 6) ... If someone have a Microsoft device with an MTP Responder (Windows Phone ?) i am quite interested by this test, and if possible by a wireshark usb dump too. The issue may be related to the profile/properties sent at the connection.

IanCassTwo commented 2 years ago

I have the ability to make Wireshark USB dumps and I have some other MTP devices (but not Windows phone). I'll do some more debugging to see what I can come up with. Once I have this working reliably, I'd be quite interested in adding some camera features like shutter speed & iso & InitiateCapture