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

librealsense on Android: "bulk_transfer on read endpoint returned error, ERROR: Out of memory" #4215

Closed
rafaelspring opened this issue Jun 14, 2019 · 9 comments
Labels

Comments

@rafaelspring
Copy link

rafaelspring commented Jun 14, 2019

Required Info
Camera Model D435, D415
Firmware Version 5.11.1.100
Operating System & Version Android 8.0
Platform Samsung Galaxy S8 (SM-G950F), Samsung Galaxy Tab S3 (SM-T820)
SDK Version 2.22.0
Language C++

Issue Description

Configuring a pipeline with RGB 1280x720 and Depth 1280x720, then

rsPipeline->start(rsConfig);
rs2::frameset frames = rsPipeline->wait_for_frames(4000);
rs2::frame colorFrame = frames.first(RS2_STREAM_COLOR);

causes lots of

W librs   : bulk_transfer on read endpoint returned error, ERROR: Out of memory

on the Android log and no frames are captured.

@rafaelspring
Copy link
Author

This seems to happen more with higher resolutions and less with lower resolutions.

@rafaelspring
Copy link
Author

Update:

  • Samsung Galaxy Phone S8 (SM-G950F): Happens all the time regardless of resolution. No successful frame transfer.
  • Samsung Galaxy Tab S3 (SM-T820): Happens intermittently. Seems to happen more for higher resolutions. Usually frames are transmitted with some hickups when it happens.
  • Samsung Galaxy Tab S4: Happens all the time regardless of resolution. No successful frame transfer.

@Mad-Thanos
Copy link

Duplicate of #4091

@rafaelspring
Copy link
Author

@dorodnic @matkatz
Update: Upgraded affected devices to Android 9.0, but the error still happens.

@matkatz
Copy link
Contributor

matkatz commented Jul 4, 2019

Hi @xtrawurst,
The Out of memory issue is not yet solved.
librealsense 2.24.0 improves some aspects of this issue but it seems that the phone can enter a state which only reboot can solve.
I will update once we have a progress with this issue.

@rafaelspring
Copy link
Author

@matkatz Thanks for the update.

If it helps, a while back we made a modified version of libRS 2.16.0 with a "hacked" libUSB that worked on non-rooted Android devices as a proof of concept internally in our company. That one had plenty of issues, but out-of-memory wasn't one. I.e. we were able to get an RGBD stream on devices that now show the out-of-memory error. I'd be happy to share the code if you're interested.

I understand that libRS's Android solution today is to do direct ioctl()s and not go through libUSB. If that's the case then there might be something that libUSB does differently that avoids the out-of-memory issue.

@matkatz
Copy link
Contributor

matkatz commented Jul 9, 2019

@xtrawurst sorry for the late response.
You are more than welcome to share your code or any suggestions.
I think that this issue appeared when I changed the backend from USB requests to USB bulk transfer.
The reason that I'm trying to avoid from going back is that on the devices that doesn't show this issue the performance is much better. i.e. I can stream HD depth + HD IR + 960x540 RGB all @ 30 FPS.
I'm currently trying to allow bulk transfer with smaller buffers in case I of OOM error.
It requires to assemble the frames from few packets and it still not stable enough.
In case that won't work I will check again the USB requests option.

@rafaelspring
Copy link
Author

@matkatz
Ok, thanks for the explanation. Let's continue on #4091 then

@matkatz
Copy link
Contributor

matkatz commented Aug 21, 2019

duplication of #4091

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants