jdibenes / hl2ss

HoloLens 2 Sensor Streaming. Real-time streaming of HoloLens 2 sensor data over WiFi. Research Mode and External USB-C A/V supported.
Other
203 stars 51 forks source link

cannot send Unity messages when getting hololens video stream #127

Open lishiyu005 opened 1 month ago

lishiyu005 commented 1 month ago

Dear author,

Thank you for your great works. I got an error sending Unity message while getting Hololens video stream. If there is no video stream, message sending works for me. The main issue is that I cannot open video stream client and message client at the same time. There seems to be a conflict between these two clients.

Here is my C++ code:

std::unique_ptr client_pv = hl2ss::lnm::rx_pv(host, hl2ss::stream_port::PERSONAL_VIDEO, pv_width, pv_height, pv_fps); std::unique_ptr source_pv = std::make_unique(buffer_size*pv_fps, std::move(client_pv)); source_pv->start();

... std::unique_ptr client = hl2ss::lnm::ipc_umq(host, hl2ss::ipc_port::UNITY_MESSAGE_QUEUE); client->open();

error: Microsoft C++ exception: std::runtime_error at memory location 0x00000042C7AFFAE0. Unhandled exception at 0x00007FFFE529F6FE (ucrtbase.dll) in test_hololens.exe: Fatal program exit requested.

Can you add an C++ example of multi-threading for getting video stream and send messages at the same time? I really have no idea what to do with this error.

Than you very much.

Best regards

jdibenes commented 1 month ago

Hello, We have added an example: https://github.com/jdibenes/hl2ss/blob/004a8b0219b8c6e78452d9c380f49870f936a60b/extensions/client_cpp/main.cpp#L636 I was unable to reproduce the issue. The C++ client has been updated in recent days, please check that you're using the latest version of the client and server.