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

Realsense cannot be instantiated more than once with multiprocessing #116

Open
m-decoster opened this issue Jan 26, 2024 · 3 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@m-decoster
Copy link
Contributor

Describe the bug

RuntimeError: Frame didn't arrive within 5000

This is the same issue as #109 which was fixed in #115 for single process code.

The fix does not work when used with the multiprocessing package

To Reproduce

Below script:

# Set up multiprocessing camera.
namespace = "camera"

# Creating and starting the publisher
p = MultiprocessRGBPublisher(
    Realsense,
    camera_kwargs={
        "resolution": Realsense.RESOLUTION_720,
        "fps": 30,
        "enable_hole_filling": True,
    },
    shared_memory_namespace=namespace,
)
p.start()

self._camera = MultiprocessRGBReceiver(namespace)
self._rerun_logger = MultiprocessRGBRerunLogger(namespace)
self._rerun_logger.start()

Realsense will fail to send frames

Expected behavior

This should start and log images to rerun, but it only does so after replugging the USB cable (as was the case in the original issue)

@m-decoster m-decoster added the bug Something isn't working label Jan 26, 2024
@tlpss
Copy link
Contributor

tlpss commented Feb 2, 2024

hm weird that it no longer works for the multiprocessing case. Could it be due to faulty resource management somehow? (i.e. closing the receivers without properly closing the camera?) @Victorlouisdg any thoughts?

@tlpss
Copy link
Contributor

tlpss commented Feb 2, 2024

maybe related to #98

@Victorlouisdg
Copy link
Contributor

There's a few things we can investigate:

  • are you sure the publisher process has terminated and thus released the handle on the camera hardware?
  • if it was terminated: was the __exit__ method of the RealSense object called and thus pipeline.stop()?
  • if that was called, is the devices listed in the call to devices = ctx.query_devices() used by the fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants