Jump to content

Android Sync "issues"


meddaugh

Recommended Posts

meddaugh

I'll try to describe it.  I was using the sync directory in /storage/sdcard1/Emby (Lollipop OS), latest Play version.  It worked fine, I didn't notice it changed to the  newer storage access framework. The sync jobs stopped working altogether.  I then had to re-pick the directory.   It works again now.  However..... I've noticed the newer storage access framework is much slower. (I've seen this in many apps, not just Emby).  This seems to be causing some sort of network timeout, or timeout syncing close to 1g files.  This causes a new files to be created and named with a suffix of "(1)".  Is there anyway to just have the app resume the sync, rather than start over again.  It also does not clean up the non "(1)" file and without the "(1)" causing 2 files to be in the sync folder taking up double the space.  It'd be nice to just have it overwrite it or have an option to.

 

Attached are Android logs.  Server side just shows something like this when it occurs (I can upload full log if needed):

 

2016-07-19 20:21:06.2145 Error HttpResultFactory: Error streaming data
*** Error Report ***
Version: 3.0.5986.0
Command line: C:\Users\meddaugh\AppData\Roaming\MediaBrowser-Server\System\MediaBrowser.ServerApplication.exe
Operating system: Microsoft Windows NT 6.2.9200.0
Processor count: 8
64-Bit OS: True
64-Bit Process: True
Program data path: C:\Users\meddaugh\AppData\Roaming\MediaBrowser-Server
Application Path: C:\Users\meddaugh\AppData\Roaming\MediaBrowser-Server\System\MediaBrowser.ServerApplication.exe
Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.
System.IO.IOException
  at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
  at SocketHttpListener.Net.ResponseStream.InternalWrite(Byte[] buffer, Int32 offset, Int32 count)
  at SocketHttpListener.Net.ResponseStream.Write(Byte[] buffer, Int32 offset, Int32 count)
  at System.IO.Stream.InternalCopyTo(Stream destination, Int32 bufferSize)
  at MediaBrowser.Server.Implementations.HttpServer.StreamWriter.WriteToInternal(Stream responseStream)
InnerException: System.Net.Sockets.SocketException
An existing connection was forcibly closed by the remote host
  at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
  at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
 

cd954088-932b-439f-ad0a-1e558773d889.log

81851593-f6eb-4ccf-9522-e987812a5cea.log

  • Like 1
Link to comment
Share on other sites

Thanks, I have also read that the storage access framework is a bit slower but it was a move that had to be made. I'm sure it will improve over time. As far as resuming or cleaning those files, I'll look into that. Thanks.

Link to comment
Share on other sites

meddaugh

Is there anything I can do to figure out which file is synced is the one it needs so I can clean it up?  There are 2, each the same size, just one has the "(1)" suffix.  I'd prefer to delete the one it won't really use.  I understand the need for the storage access framework, is there an "advanced" or hidden option that can be done to allow those with root or understanding to allow it?

 

Thanks for a nice product.

 

---Eric

Link to comment
Share on other sites

meddaugh

Well...I was incorrect.  It does sync, however the android app is not able to play the file.  It gives an error (log attached).  It sees the file, and I am able to play it using a file browser with a different player, just not through the Emby App anymore.  How can I get it to work please?

 

Thanks.

 

d195f9e5-4d46-4080-8ec4-fcd9e33831b9.log

Link to comment
Share on other sites

anderbytes

Well...I was incorrect.  It does sync, however the android app is not able to play the file.  It gives an error (log attached).  It sees the file, and I am able to play it using a file browser with a different player, just not through the Emby App anymore.  How can I get it to work please?

 

Thanks.

 

Here I noticed that the sync finishes but... the original filename (no (1)) has reduced filesize... which probably means corrupted file, unplayable.

When you try to play from inside Emby, he probably tries to play the file that is corrupted, without (1)

Link to comment
Share on other sites

meddaugh

When it errors out inside the app, there is only a single synced file.  I am able to play it correctly in other external apps, just not inside Emby.  This worked last week up until I had to re-define the storage location and re-sync everything (and not having slow sync issues and the "(1)" file.)  So, something appears incorrect with the app as external player can play the file without issues.

Link to comment
Share on other sites

anderbytes

When it errors out inside the app, there is only a single synced file.  I am able to play it correctly in other external apps, just not inside Emby.  This worked last week up until I had to re-define the storage location and re-sync everything (and not having slow sync issues and the "(1)" file.)  So, something appears incorrect with the app as external player can play the file without issues.

 

Really odd. Something has to be done... even internal storage has issues with the new way they are using to save synced files.

Link to comment
Share on other sites

as far as the app is concerned, the file is not synced so that's why it's not playable. but the file is just left dangling there meaning other software can see it. so that's what will need to be improved.

Link to comment
Share on other sites

anderbytes

as far as the app is concerned, the file is not synced so that's why it's not playable. but the file is just left dangling there meaning other software can see it. so that's what will need to be improved.

 

But...

 

// What I thought it had to be

function play() {

   if ( ! synced ) then

      play from streaming

   end if

}

 

My question:

Not synced so not playable?

Edited by anderbytes
Link to comment
Share on other sites

That's exactly what it does. But in this case, it's not synced because the transfer failed part way through.

Link to comment
Share on other sites

meddaugh

as far as the app is concerned, the file is not synced so that's why it's not playable. but the file is just left dangling there meaning other software can see it. so that's what will need to be improved.

 

As far as I can tell in the App it "thinks" it's synced as it has a sync icon next to it, and the server sync job says it is fully synced.  The one in the log had no errors and works fine with an external player (only 1 file, no 2nd "(1)" file).  The app just gives an error playing it.  Once I mark it "watched" (after watching it via the external player), the sync job correctly deleted it off the device, so it did know it was there.  Do the logs I attached in the 2nd show anything else as to why it couldn't play it?  I guess I'm confused why the android app and server both think it is synced (and it's not corrupted), but the app cannot play it.   Is there a way in the app to see what synced file it thinks is on the local storage?

 

Should I start fresh, wipe all data in the app, remove sync jobs and start over?

 

 

---Eric

Link to comment
Share on other sites

anderbytes

No, I know what it is, thanks.

 

Care to tell us? I'm curious

 

And expected E.T.A?

Edited by anderbytes
Link to comment
Share on other sites

Care to tell us? I'm curious

 

And expected E.T.A?

 

Should be resolved in 2.7.27.

  • Like 1
Link to comment
Share on other sites

anderbytes

Should be resolved in 2.7.27.

Sync still broken here in that version.

Edited by anderbytes
Link to comment
Share on other sites

anderbytes

Tests fine here.

 

Will test more later.

 

Could it be possible to include the % transferred for each file during sync? It would be a better way to follow it.

Link to comment
Share on other sites

meddaugh

Tests fine here.

 

Do I need to remove the synced files on the android device to have them synced again? Or will it figure it out and play it?  (I'll test later tonight to see if my issues are fixed).

Link to comment
Share on other sites

anderbytes

Do I need to remove the synced files on the android device to have them synced again? Or will it figure it out and play it?  (I'll test later tonight to see if my issues are fixed).

 

Would be a better test if you delete every old sync. That's what I do, to make sure old configs won't screw things up

Link to comment
Share on other sites

meddaugh

Got version 2.7.28.  Re-synced the files, tried to play and nothing.  No error this time, but black screen.  The log file (attached) seems to have same info about itemId cannot be empty... still nothing.  Synced seemed to work better though, just still not playable.

6a383e6f-1e8c-4973-b274-0c0ff7c8bf23.log

Link to comment
Share on other sites

meddaugh

Still on .28... sync issues.  One only went 800mg into it, the next time it tried it created a "(1)" file and fully synced it. (1.3g).  

 

I upgraded to 2.7.30, still black screen playing it.  Also not sure, but external play is broke now.  It asks me for what player, but synced shows it gives a "has stopped" message. (I was trying external play so I can mark it watched quicker than going back into the show).   I can use a file browser to play the file correctly still, so the sync is working, but if it gets interrupted it won't recover or delete the not fully synced file

 

So far nothing seems fixed.

 

Thanks for the continued support looking into it.

 

---Eric

Link to comment
Share on other sites

anderbytes

Still on .28... sync issues. One only went 800mg into it, the next time it tried it created a "(1)" file and fully synced it. (1.3g).

 

I upgraded to 2.7.30, still black screen playing it. Also not sure, but external play is broke now. It asks me for what player, but synced shows it gives a "has stopped" message. (I was trying external play so I can mark it watched quicker than going back into the show). I can use a file browser to play the file correctly still, so the sync is working, but if it gets interrupted it won't recover or delete the not fully synced file

 

So far nothing seems fixed.

 

Thanks for the continued support looking into it.

 

---Eric

Latest beta was intended to fix subtitle naming, which it succeeded.

Link to comment
Share on other sites

meddaugh

Still having same issues, this time the sync did 1/2 the file, started over with a "(1)".  It will finish.  Unable to play the synced files, even external app crashes trying to play it.  I've attached other logs showing this, any other scenarios I can attached more logs again if you'd like.

 

Thanks.

 

---Eric

Link to comment
Share on other sites

anderbytes

Hey @@Luke, how does the file copy works in new Android external storage API? Is it possible to pass parameters to it?

 

If so... are there parameters like "always overwrite" ?

 

Because it seems that Android is trying to avoid writing to the same file, if some corruption happens in a previous copy. This also happens in Windows if you CTRL + C a file and then lots of CTRL + V right after.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...