Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on download file and UI freeze #54

Closed
einhander opened this issue May 18, 2015 · 10 comments
Closed

Error on download file and UI freeze #54

einhander opened this issue May 18, 2015 · 10 comments

Comments

@einhander
Copy link

Then I try to download file in qt UI it freeze and have error in console:

downloading  55393 to "/home/einhander/1/SOCC15-413_v1_NAODEN-SOC_contrat_fda-1.pdf" 
downloading file  "/home/einhander/1/SOCC15-413_v1_NAODEN-SOC_contrat_fda-1.pdf"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
finishing queue 
finished 
10009 ms since the last poll call
10000 ms since the last poll call
....

Output of ./aft-mtp-cli

drop message 0003 201e, transaction 00000000, expected: 00000001
microsoft.com: 1.0; android.com: 1.0;
HTC HTC One S 3.16.401.10 
supported op codes: 1001 1002 1003 1004 1005 1006 1007 1008 1009 100a 100b 100c 100d 1014 1015 1016 1017 101b 9801 9802 9803 9804 9805 95c1 95c2 95c3 95c4 95c5 
supported properties: d401 d402 5003
@whoozle
Copy link
Owner

whoozle commented May 18, 2015

weird, could you watch the output of adb logcat command the same time you get this error? Usually mtpserver outputs its error to android logs.

@whoozle
Copy link
Owner

whoozle commented May 22, 2015

is afs-mtp-mount working fine for you?

@whoozle
Copy link
Owner

whoozle commented May 22, 2015

might be related to #49 somehow

@whoozle
Copy link
Owner

whoozle commented May 22, 2015

well this is the code from the android's mtp server, so adb output will definitely help

MtpResponseCode MtpServer::doGetObject() {
    if (!hasStorage())
        return MTP_RESPONSE_INVALID_OBJECT_HANDLE;
    MtpObjectHandle handle = mRequest.getParameter(1);
    MtpString pathBuf;
    int64_t fileLength;
    MtpObjectFormat format;
    int result = mDatabase->getObjectFilePath(handle, pathBuf, fileLength, format);
    if (result != MTP_RESPONSE_OK)
        return result;
    const char* filePath = (const char *)pathBuf;
    mtp_file_range  mfr;
    mfr.fd = open(filePath, O_RDONLY);
    if (mfr.fd < 0) {
        return MTP_RESPONSE_GENERAL_ERROR;
    }
    mfr.offset = 0;
    mfr.length = fileLength;
    mfr.command = mRequest.getOperationCode();
    mfr.transaction_id = mRequest.getTransactionID();
    // then transfer the file
    int ret = ioctl(mFD, MTP_SEND_FILE_WITH_HEADER, (unsigned long)&mfr);
    ALOGV("MTP_SEND_FILE_WITH_HEADER returned %d\n", ret);
    close(mfr.fd);
    if (ret < 0) {
        if (errno == ECANCELED)
            return MTP_RESPONSE_TRANSACTION_CANCELLED;
        else
            return MTP_RESPONSE_GENERAL_ERROR;
    }
    return MTP_RESPONSE_OK;
}

@einhander
Copy link
Author

is afs-mtp-mount working fine for you?

mostly yes.

It's hard to reproduce.
This time UI not freeze, but downloaded files has zero length.
output in console:

downloading to  "/home/einhander/Downloads/1" 
downloading  1  file(s),  637484  bytes 
downloading  87542 to "/home/einhander/Downloads/1/150113-225605.wav" 
downloading file  "/home/einhander/Downloads/1/150113-225605.wav"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
finishing queue 
finished 

log

@whoozle
Copy link
Owner

whoozle commented Nov 7, 2015

can you check it with the latest sources? many usb-related bugs were fixed recently.

@whoozle whoozle added this to the v2.5 milestone Nov 7, 2015
@einhander
Copy link
Author

Again, download produce files of zero size.

./android-file-transfer
upload worker started 
device found, opening session... 
drop message 0003, response: 201e, transaction: 00000000, transaction: 00000001
device info "HTC"   "HTC One S" 
switching to storage id  65537 
session opened, starting 
downloading to  "/home/einhander/Downloads/1" 
found  16  objects in  "/home/einhander/Downloads/1/Disc1" 
downloading  16  file(s),  157890494  bytes 
downloading  72959 to "/home/einhander/Downloads/1/Disc1/08 Blutengel-Dein Gott.mp3" 
downloading file  "/home/einhander/Downloads/1/Disc1/08 Blutengel-Dein Gott.mp3"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
downloading  72960 to "/home/einhander/Downloads/1/Disc1/16 Blutengel-Elegy.mp3" 
downloading file  "/home/einhander/Downloads/1/Disc1/16 Blutengel-Elegy.mp3"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
downloading  72961 to "/home/einhander/Downloads/1/Disc1/01 Blutengel-Prologue_ Omen.mp3" 
downloading file  "/home/einhander/Downloads/1/Disc1/01 Blutengel-Prologue_ Omen.mp3"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
downloading  72962 to "/home/einhander/Downloads/1/Disc1/14 Blutengel-Asche zu Asche.mp3" 
downloading file  "/home/einhander/Downloads/1/Disc1/14 Blutengel-Asche zu Asche.mp3"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
downloading  72963 to "/home/einhander/Downloads/1/Disc1/07 Blutengel-Fire in the Distance.mp3" 
downloading file  "/home/einhander/Downloads/1/Disc1/07 Blutengel-Fire in the Distance.mp3"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
downloading  72964 to "/home/einhander/Downloads/1/Disc1/03 Blutengel-The Siren.mp3" 
downloading file  "/home/einhander/Downloads/1/Disc1/03 Blutengel-The Siren.mp3"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
downloading  72965 to "/home/einhander/Downloads/1/Disc1/02 Blutengel-Sing.mp3" 
downloading file  "/home/einhander/Downloads/1/Disc1/02 Blutengel-Sing.mp3"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
downloading  72966 to "/home/einhander/Downloads/1/Disc1/10 Blutengel-Save Us.mp3" 
downloading file  "/home/einhander/Downloads/1/Disc1/10 Blutengel-Save Us.mp3"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
downloading  72967 to "/home/einhander/Downloads/1/Disc1/09 Blutengel-Guilty.mp3" 
downloading file  "/home/einhander/Downloads/1/Disc1/09 Blutengel-Guilty.mp3"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
downloading  72968 to "/home/einhander/Downloads/1/Disc1/12 Blutengel-Ich bin das Feuer.mp3" 
downloading file  "/home/einhander/Downloads/1/Disc1/12 Blutengel-Ich bin das Feuer.mp3"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
downloading  72969 to "/home/einhander/Downloads/1/Disc1/15 Blutengel-Bow Down.mp3" 
downloading file  "/home/einhander/Downloads/1/Disc1/15 Blutengel-Bow Down.mp3"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
downloading  72970 to "/home/einhander/Downloads/1/Disc1/04 Blutengel-Wir Sind Was Wir Sind.mp3" 
downloading  72971 to "/home/einhander/Downloads/1/Disc1/06 Blutengel-The War Between Us.mp3" 
downloading file  "/home/einhander/Downloads/1/Disc1/06 Blutengel-The War Between Us.mp3"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
downloading  72972 to "/home/einhander/Downloads/1/Disc1/13 Blutengel-Holy Blood.mp3" 
downloading file  "/home/einhander/Downloads/1/Disc1/13 Blutengel-Holy Blood.mp3"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
downloading  72973 to "/home/einhander/Downloads/1/Disc1/11 Blutengel-Der Regen fällt.mp3" 
downloading file  "/home/einhander/Downloads/1/Disc1/11 Blutengel-Der Regen fällt.mp3"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
downloading  72974 to "/home/einhander/Downloads/1/Disc1/05 Blutengel-Give Me.mp3" 
downloading file  "/home/einhander/Downloads/1/Disc1/05 Blutengel-Give Me.mp3"  failed:  "GetObject: invalid response code GeneralError (0x2002)" 
finishing queue 
finished 

Crash on upload:

./android-file-transfer
upload worker started 
device found, opening session... 
device info "HTC"   "HTC One S" 
switching to storage id  65537 
session opened, starting 
switching to storage id  65537 
adding directory  "Harms & Kapelle" 
10010 ms since the last poll call
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.

terminate called after throwing an instance of 'mtp::usb::TimeoutException'
  what():  timeout reaping usb urb

@whoozle
Copy link
Owner

whoozle commented Nov 15, 2015

can you execute adb logcat right after you tried to download files? General error usually means that mtp threw an exception inside its code. :(
does aft-mtp-mount work for you?

@whoozle
Copy link
Owner

whoozle commented May 5, 2016

can you check the latest master?

@whoozle
Copy link
Owner

whoozle commented Dec 29, 2020

please reopen it if you can reproduce it with the latest master

@whoozle whoozle closed this as completed Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants