From 9ef8bf5b34bcc9dafa42ecc3171a4c71e1934b2e Mon Sep 17 00:00:00 2001 From: Evgeni Raikhel Date: Wed, 26 Jun 2019 14:26:30 +0300 Subject: [PATCH 1/4] Hotfix for a merge artefact Change-Id: I081e2a8581eee07d6d538ebf85a8a9fe9abce261 --- src/ds5/ds5-device.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/ds5/ds5-device.cpp b/src/ds5/ds5-device.cpp index 2ac8227b2f..6fb4bbbe11 100644 --- a/src/ds5/ds5-device.cpp +++ b/src/ds5/ds5-device.cpp @@ -666,10 +666,6 @@ namespace librealsense std::string curr_version= _fw_version; - if (dynamic_cast(&(ctx->get_backend())) == nullptr) - _tf_keeper->start(); - else - LOG_WARNING("playback_backend - global time_keeper unavailable."); } notification ds5_notification_decoder::decode(int value) From 77bf13ab9d00704db77bc495831fad52f0cbe79e Mon Sep 17 00:00:00 2001 From: Evgeni Raikhel Date: Wed, 26 Jun 2019 16:26:11 +0300 Subject: [PATCH 2/4] Realsense-viewer to alert in case of multiple udev-rules installed Change-Id: I6e0168b93e6077b3c33e02033d38752bbcc3a575 --- common/fw-update-helper.cpp | 2 +- common/viewer.cpp | 48 ++++++++++++++++++++++++++++--------- 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/common/fw-update-helper.cpp b/common/fw-update-helper.cpp index 72b1ca88a9..3963678d16 100644 --- a/common/fw-update-helper.cpp +++ b/common/fw-update-helper.cpp @@ -315,4 +315,4 @@ namespace rs2 _started = true; } -} \ No newline at end of file +} diff --git a/common/viewer.cpp b/common/viewer.cpp index 3c06bd0d30..25a9446177 100644 --- a/common/viewer.cpp +++ b/common/viewer.cpp @@ -437,19 +437,25 @@ namespace rs2 void viewer_model::check_permissions() { -#ifdef __linux__ +#ifdef __linux__ - if (directory_exists("/etc/udev/rules.d")) + if (directory_exists("/etc/udev/rules.d") || directory_exists("/lib/udev/rules.d/")) { - std::ifstream f("/etc/udev/rules.d/99-realsense-libusb.rules"); - std::string message = "UDEV-Rules configure correct permissions\nfor RealSense devices.`\n" - "Missing UDEV-Rules will cause 'Permissions Denied' errors\nunless the application is running under 'sudo' (not recommended)\n" - "To install UDEV-Rules run in terminal:\n" + const std::string udev_rules_man("/etc/udev/rules.d/99-realsense-libusb.rules"); + const std::string udev_rules_deb("/lib/udev/rules.d/60-librealsense2-udev-rules.rules"); + std::ifstream f_man(udev_rules_man); + std::ifstream f_deb(udev_rules_deb); + + std::string message = "UDEV-Rules permissions configuration \n for RealSense devices.`\n" + "Missing/outdated UDEV-Rules will cause 'Permissions Denied' errors\nunless the application is running under 'sudo' (not recommended)\n" + "In case of Debians use: \n" + "sudo apt-get upgrade/install librealsense2-udev-rules\n" + "To manually install UDEV-Rules in terminal run:\n" "$ sudo cp ~/.99-realsense-libusb.rules /etc/udev/rules.d/99-realsense-libusb.rules && sudo udevadm control --reload-rules && udevadm trigger\n"; bool create_file = false; - if(!f.good()) + if(!(f_man.good() || f_deb.good())) { message = "RealSense UDEV-Rules are missing!\n" + message; not_model.add_notification({ message, @@ -459,19 +465,40 @@ namespace rs2 } else { + std::ifstream f; + std::string udev_fname; + if(f_man.good()) + { + if (f_deb.good()) + { + std::string duplicates = "Multiple realsense udev-rules were found! :\n1:" + udev_rules_man + + "\n2: " + udev_rules_deb+ "\nMake sure to remove redundancies!"; + not_model.add_notification({ duplicates, + RS2_LOG_SEVERITY_WARN, + RS2_NOTIFICATION_CATEGORY_COUNT }); + } + f.swap(f_man); + udev_fname = udev_rules_man; + create_file = true; + } + else + { + f.swap(f_deb); + udev_fname = udev_rules_deb; + } + std::string str((std::istreambuf_iterator(f)), std::istreambuf_iterator()); - + std::string udev = realsense_udev_rules; if (udev != str) { - message = "RealSense UDEV-Rules are outdated!\n" + message; + message = "RealSense UDEV-Rules file:\n " + udev_fname +"\n is not up-to date!\n" + message; not_model.add_notification({ message, RS2_LOG_SEVERITY_WARN, RS2_NOTIFICATION_CATEGORY_COUNT }); - create_file = true; } } @@ -485,7 +512,6 @@ namespace rs2 } } - #endif } From e09ef84b9894bf17b6fc33e30f4a78207c962450 Mon Sep 17 00:00:00 2001 From: Evgeni Raikhel Date: Wed, 26 Jun 2019 17:27:55 +0300 Subject: [PATCH 3/4] Remove recommended firmware alert Change-Id: I5e906e31acacb55637e61addc8d38a1735462019 --- common/model-views.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/common/model-views.cpp b/common/model-views.cpp index faa968361d..63b029c473 100644 --- a/common/model-views.cpp +++ b/common/model-views.cpp @@ -4856,29 +4856,6 @@ namespace rs2 } ImGui::SetCursorPos({ rc.x + 225, rc.y - 107 }); - - if (fw_version_less_than(fw_version, min_fw_version)) - { - std::string label1 = to_string() << textual_icons::exclamation_triangle << "##" << id; - ImGui::PushStyleColor(ImGuiCol_Button, sensor_bg); - ImGui::PushStyleColor(ImGuiCol_ButtonHovered, sensor_bg); - ImGui::PushStyleColor(ImGuiCol_ButtonActive, sensor_bg); - ImGui::PushStyleColor(ImGuiCol_Text, yellow); - ImGui::PushStyleColor(ImGuiCol_TextSelectedBg, yellow + 0.1f); - - if (ImGui::SmallButton(label1.c_str())) - { - open_url(recommended_fw_url); - } - - if (ImGui::IsItemHovered()) - { - ImGui::SetTooltip("Click here to update firmware\n(internet connection required)"); - } - - ImGui::PopStyleColor(5); - } - ImGui::PopFont(); } From 1be6cf5d1ca0d54e335503347320f9b52267963c Mon Sep 17 00:00:00 2001 From: "Katz, Matan" Date: Wed, 26 Jun 2019 18:32:55 +0300 Subject: [PATCH 4/4] fw-update-tool - fix find device after update --- tools/fw-update/rs-fw-update.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/fw-update/rs-fw-update.cpp b/tools/fw-update/rs-fw-update.cpp index d9f429a1f8..17d9e9405b 100644 --- a/tools/fw-update/rs-fw-update.cpp +++ b/tools/fw-update/rs-fw-update.cpp @@ -242,9 +242,6 @@ int main(int argc, char** argv) try break; } - std::unique_lock lk(mutex); - cv.wait_for(lk, std::chrono::seconds(WAIT_FOR_DEVICE_TIMEOUT), [&] { return !done || new_device; }); - if (!device_found) { if(serial_number_arg.isSet()) @@ -253,15 +250,19 @@ int main(int argc, char** argv) try { std::cout << std::endl << "nothing to do, run again with -h for help" << std::endl; } + return EXIT_FAILURE; } + std::unique_lock lk(mutex); + cv.wait_for(lk, std::chrono::seconds(WAIT_FOR_DEVICE_TIMEOUT), [&] { return !done || new_device; }); + if (done) { auto devs = ctx.query_devices(); for (auto&& d : devs) { auto sn = d.supports(RS2_CAMERA_INFO_SERIAL_NUMBER) ? d.get_info(RS2_CAMERA_INFO_SERIAL_NUMBER) : "unknown"; - if (sn != selected_serial_number) + if (serial_number_arg.isSet() && sn != selected_serial_number) continue; auto fw = d.supports(RS2_CAMERA_INFO_FIRMWARE_VERSION) ? d.get_info(RS2_CAMERA_INFO_FIRMWARE_VERSION) : "unknown";