Jump to content

Emby web/app does not like it when I remove a USB input device on Android!


fullmental

Recommended Posts

fullmental

So I'm having this weird issue. I use my phone (Note 9) as a desktop with a Samsung Dex Pad to one of my computer monitors. I have a USB keyboard and mouse hooked up, but occasionally I need to use a second device to do work that can't be done on my phone. I have a small Pi that I use to remote into a different server when needed on my second monitor.

 

I was tired of having two keyboards and mice and the entire reason for downsizing was to reduce my office space footprint in a shared room, so I started removing the USB device from the phone after I set up discord and emby on my screen, and ordered a USB KVM switch so I can do seamless switching. This is where it all goes wrong for Emby.

 

Whether I am on the android app or the web player, Emby on android does *not* like it when I disconnect the USB input devices! What happens is that every time I disconnect the input devices, android seems to refresh all the windows/active apps. Most apps handle this gracefully, but web browsers refresh the web pages they have loaded, and Emby returns with a white screen on chrome. The Emby app refreshes and just shows a grey screen.

 

On the web interface, I have to hit the back button, refresh, and hit play on the episode I was watching to bring it back, which of course means re-connecting my keyboard and mouse.

 

On the app, the screen just stays grey no matter what I do. I can try using the media buttons on the navigation bar and the audio will resume from whatever video I was watching, but the screen stays grey. Closing and re-opening the app does nothing to help, and neither does closing it via the task switcher. The only way I found to get the app to work again is to force close the app. Curious, I tried the same thing using just my phone screen and an OTG cable - and I got the same result. It seems that removing the physical input devices causes this screen refresh/soft UI crash regardless of how my phone is being used, and the Dex software is not causing it - rather it appears to occur with the base version of Android itself.

 

This of course means I can't set up a video and go to my other device, because I can't disconnect my keyobard/mouse receiver without breaking Emby. I've noticed it *doesn't* happen when I use a bluetooth keyboard and mouse, but unfortunately I have 2.4GHz interference everywhere here, so this is not a viable solution for me - the bluetooth devices constantly hang and/or disconnect and reconnect.

 

My phone is running Android 9.0 with the April 1, 2019 security patch on Verizon. Emby server is 4.1.1.0 running on Ubuntu 18.04 LTS, though the issue was present with 4.0.2.0 as well. I can't speak for other server versions. I do have a lifetime Emby Premiere license, but I don't know if any of those features make a difference? I am streaming locally when I watch from home.

 

I checked the android directory for logs but none were there. Emby's server log doesn't appear to show anything useful either, it just reports a quit command was received on the ffmpeg log.

 

The HTTP server log is below for a quick sample I did (opened media file, removed input device after it started playing):

 

 

2019-05-16 13:05:55.714 Info HttpResultFactory: Setting range response values for /media/plex-1/Plex/Anime/TV Shows/Gintama/Season 03/Gintama - S03E27 - Some Things Can Only Be Conveyed Through the Written Word.mkv. RangeRequest: bytes=26647255- Content-Length: 130606236, Content-Range: bytes 26647255-157253490/1572534912019-05-16 13:05:55.727 Info HttpServer: HTTP POST http://192.168.1.20:8096/emby/Sessions/Playing/Progress. UserAgent: Mozilla/5.0 (Linux; Android 9; SM-N960U Build/PPR1.180610.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Safari/537.362019-05-16 13:05:55.730 Info HttpServer: HTTP Response 204 to 192.168.1.16. Time: 3ms. http://192.168.1.20:8096/emby/Sessions/Playing/Progress2019-05-16 13:05:55.731 Info HttpServer: SocketException: http://192.168.1.20:8096/emby/Videos/1574/stream.mkv?Static=true&mediaSourceId=3682750438b95a671556f16617cdf914&deviceId=7465dcf0e37ac83c&api_key=ba517d7b1e8b4037b15755c068c0326b2019-05-16 13:05:55.731 Info HttpServer: HTTP Response 206 to 192.168.1.16. Time: 4601ms. http://192.168.1.20:8096/emby/Videos/1574/stream.mkv?Static=true&mediaSourceId=3682750438b95a671556f16617cdf914&deviceId=7465dcf0e37ac83c2019-05-16 13:05:56.200 Info HttpServer: HTTP GET http://192.168.1.20:8096/emby/Videos/1574/stream.mkv?Static=true&mediaSourceId=3682750438b95a671556f16617cdf914&deviceId=7465dcf0e37ac83c. User-Agent=mpv 0.29.0-UNKNOWN, Accept=*/*, Range=bytes=65385043-, Connection=close, Host=192.168.1.20:8096, Icy-MetaData=12019-05-16 13:05:56.205 Info HttpResultFactory: Setting range response values for /media/plex-1/Plex/Anime/TV Shows/Gintama/Season 03/Gintama - S03E27 - Some Things Can Only Be Conveyed Through the Written Word.mkv. RangeRequest: bytes=65385043- Content-Length: 91868448, Content-Range: bytes 65385043-157253490/1572534912019-05-16 13:05:56.212 Info HttpServer: SocketException: http://192.168.1.20:8096/emby/Videos/1574/stream.mkv?Static=true&mediaSourceId=3682750438b95a671556f16617cdf914&deviceId=7465dcf0e37ac83c&api_key=ba517d7b1e8b4037b15755c068c0326b2019-05-16 13:05:56.212 Info HttpServer: HTTP Response 206 to 192.168.1.16. Time: 503ms. http://192.168.1.20:8096/emby/Videos/1574/stream.mkv?Static=true&mediaSourceId=3682750438b95a671556f16617cdf914&deviceId=7465dcf0e37ac83c2019-05-16 13:06:14.125 Info HttpServer: HTTP GET http://192.168.1.20:8096/emby/System/Logs/Log?name=embyserver.txt. UserAgent: Mozilla/5.0 (Linux; Android 9; SM-N960U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.136 Safari/537.36 

 

 

Any ideas/workarounds besides going back to two sets of keyboards/mice?

Edited by fullmental
Link to comment
Share on other sites

Hi, when this happens in the browser, what url is in the browser address bar?

Link to comment
Share on other sites

fullmental

Hi Luke,

 

When I play a video, the URL in the address bar is:

 

"<SERVERURL:PORT>/web/index.html#!/videoosd.html"

 

For the record I tried both a direct IP address/port and via app.emby.media. The problem is exhibited in both cases.

Edited by fullmental
Link to comment
Share on other sites

So it's only during video playback? It sounds to me like this event is causing a browser page refresh and the video OSD screen is not currently able to handle that.

 

The android app could probably catch this and stop this from happening though.

Link to comment
Share on other sites

fullmental

So it's only during video playback? It sounds to me like this event is causing a browser page refresh and the video OSD screen is not currently able to handle that.

 

The android app could probably catch this and stop this from happening though.

The refresh is what appears to be happening, yes. Are you saying the app should be correcting for this already, or that it can perhaps be fixed in the future?

Link to comment
Share on other sites

The web app is not built to handle it, not. Most screens can be refreshed but the video player currently cannot handle that.

 

But in the android app we should be able to intercept this and stop it from happening altogether.

Link to comment
Share on other sites

  • 1 month later...
fullmental

Hi Luke, I just gave it a try with the beta you linked and no luck. Still see the same behavior.

Link to comment
Share on other sites

fullmental

No problem. If there are any more betas for me to try later, please let me know!

 

EDIT: I'm on emby server 4.1.1.0. Is there a beta of that I might need as well, perhaps? I saw references to server 4.2 in your beta notes. My Emby server is on a linux box, if it matters.

Edited by fullmental
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...