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

Daemon not working with emulate Surface Dial #10

Open
2ndBillGates opened this issue Dec 26, 2022 · 5 comments
Open

Daemon not working with emulate Surface Dial #10

2ndBillGates opened this issue Dec 26, 2022 · 5 comments

Comments

@2ndBillGates
Copy link

2ndBillGates commented Dec 26, 2022

Describe the bug

Hello Sir,

I'm trying to combine your project with this, it's a android app to emulate Surface Dial bluetooth HID device. It works great on Windows. (Meaning I don't own a Surface Dial)
https://github.com/tumuyan/Kontroller
I know it's a old project of yours but I want to make it available to more users.
Thank you for making it possible.

1. Surface Dial is not recognise
When I was running the daemon first time, it stuck at "haptics worker is waiting..."
I guess the daemon does not recognise the Dial (Phone) is paired and connected
because your project rely on reading the bluetooth device name "Surface Dial"
While my phone bluetooth hostname is something else.
then I change it to "Surface Dial"
Now it recognise

haptics worker is ready
Dial Connected

2. Error when the Dial sending commands
but then, whenever I try to use the Dial
the daemon gave me

Started
haptics worker is waiting...
haptics worker is ready
Dial Connected
Unexpected haptics worker error! HID API Error: Failed opening hid device
the haptics worker died!

I think it's because of "hidraw4" "uinput" is not given permission.
Despite the udev rules was set.

then, I run

sudo chmod 666 hidraw4 & uinput

this time it gives me another error.

3. Error at .upwarp()

haptics worker is waiting...
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }', src/dial_device/mod.rs:64:30
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at 'Could not recv event', src/dial_device/mod.rs:135:24
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/dial_device/haptics.rs:52:39
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/controller/controls/media_with_volume.rs:17:22
^Creceived signal 2
Error: Received termination signal (either SIGTERM or SIGINT)

Desktop (please complete the following information):

Service Logs

export  RUST_BACKTRACE=full
cargo run -p surface-dial-daemon

    Finished dev [unoptimized + debuginfo] target(s) in 0.19s
     Running `target/debug/surface-dial-daemon RUST_BACKTRACE=1`
Started
haptics worker is waiting...
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }', src/dial_device/mod.rs:64:30
stack backtrace:
   0:     0x5564dfa36c50 - std::backtrace_rs::backtrace::libunwind::trace::he615646ea344481f
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x5564dfa36c50 - std::backtrace_rs::backtrace::trace_unsynchronized::h6ea8eaac68705b9c
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x5564dfa36c50 - std::sys_common::backtrace::_print_fmt::h7ac486a935ce0bf7
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x5564dfa36c50 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1b5a095d3db2e28f
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x5564dfa52b8e - core::fmt::write::h445545b92224a1cd
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/fmt/mod.rs:1209:17
   5:     0x5564dfa34425 - std::io::Write::write_fmt::h55a43474c6520b00
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/io/mod.rs:1682:15
   6:     0x5564dfa36a15 - std::sys_common::backtrace::_print::h65d20526fdb736b0
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x5564dfa36a15 - std::sys_common::backtrace::print::h6555fbe12a1cc41b
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x5564dfa3829f - std::panicking::default_hook::{{closure}}::hbdf58083140e7ac6
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:267:22
   9:     0x5564dfa37fda - std::panicking::default_hook::haef8271c56b74d85
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:286:9
  10:     0x5564dfa38998 - std::panicking::rust_panic_with_hook::hfd45b6b6c12d9fa5
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:688:13
  11:     0x5564dfa38737 - std::panicking::begin_panic_handler::{{closure}}::hf591e8609a75bd4b
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:579:13
  12:     0x5564dfa370fc - std::sys_common::backtrace::__rust_end_short_backtrace::h81899558795e4ff7
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x5564dfa38452 - rust_begin_unwind
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:575:5
  14:     0x5564df9052b3 - core::panicking::panic_fmt::h4235fa9b4675b332
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:65:14
  15:     0x5564df905513 - core::result::unwrap_failed::ha17dbf463031a5e1
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/result.rs:1791:5
  16:     0x5564df952db9 - core::result::Result<T,E>::unwrap::hfb94075d9d271512
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/result.rs:1113:23
  17:     0x5564df912722 - surface_dial_daemon::dial_device::DialDevice::new::{{closure}}::h2d3d262d0f7e2eb1
                               at /tmp/surface-dial-linux/src/dial_device/mod.rs:64:17
  18:     0x5564df92bf2c - std::sys_common::backtrace::__rust_begin_short_backtrace::hebf40aaede804c60
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:121:18
  19:     0x5564df95d02c - std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}::h673253040d95dc17
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/thread/mod.rs:551:17
  20:     0x5564df960e60 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h5f7ceb3cdee05b7d
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panic/unwind_safe.rs:271:9
  21:     0x5564df91d710 - std::panicking::try::do_call::hdda24ffff1bb9419
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:483:40
  22:     0x5564df91dc4b - __rust_try
  23:     0x5564df91d190 - std::panicking::try::he6c8dd588aa1fcff
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:447:19
  24:     0x5564df917e50 - std::panic::catch_unwind::hc641b1f4a44c4888
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panic.rs:137:14
  25:     0x5564df95b5fb - std::thread::Builder::spawn_unchecked_::{{closure}}::h25bca003f40011c7
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/thread/mod.rs:550:30
  26:     0x5564df94637e - core::ops::function::FnOnce::call_once{{vtable.shim}}::hcd36c77245276302
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:251:5
  27:     0x5564dfa3b103 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4273f95ec44459b3
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/alloc/src/boxed.rs:1987:9
  28:     0x5564dfa3b103 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h70f28fa4ddc269e5
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/alloc/src/boxed.rs:1987:9
  29:     0x5564dfa3b103 - std::sys::unix::thread::Thread::new::thread_start::h85a9c16b988e2bd0
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys/unix/thread.rs:108:17
  30:     0x7f7b90bf014d - start_thread
  31:     0x7f7b90c71a00 - __GI___clone3
  32:                0x0 - <unknown>
thread '<unnamed>' panicked at 'Could not recv event', src/dial_device/mod.rs:135:24
stack backtrace:
   0:     0x5564dfa36c50 - std::backtrace_rs::backtrace::libunwind::trace::he615646ea344481f
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x5564dfa36c50 - std::backtrace_rs::backtrace::trace_unsynchronized::h6ea8eaac68705b9c
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x5564dfa36c50 - std::sys_common::backtrace::_print_fmt::h7ac486a935ce0bf7
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x5564dfa36c50 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1b5a095d3db2e28f
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x5564dfa52b8e - core::fmt::write::h445545b92224a1cd
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/fmt/mod.rs:1209:17
   5:     0x5564dfa34425 - std::io::Write::write_fmt::h55a43474c6520b00
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/io/mod.rs:1682:15
   6:     0x5564dfa36a15 - std::sys_common::backtrace::_print::h65d20526fdb736b0
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x5564dfa36a15 - std::sys_common::backtrace::print::h6555fbe12a1cc41b
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x5564dfa3829f - std::panicking::default_hook::{{closure}}::hbdf58083140e7ac6
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:267:22
   9:     0x5564dfa37fda - std::panicking::default_hook::haef8271c56b74d85
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:286:9
  10:     0x5564dfa38998 - std::panicking::rust_panic_with_hook::hfd45b6b6c12d9fa5
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:688:13
  11:     0x5564df97bde8 - std::panicking::begin_panic::{{closure}}::heac0095e5161d4fa
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:608:9
  12:     0x5564df980886 - std::sys_common::backtrace::__rust_end_short_backtrace::h9fb1a5b340e7c34a
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x5564df97bd20 - std::panicking::begin_panic::h0e085971c3597d10
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:607:12
  14:     0x5564df925eae - surface_dial_daemon::dial_device::DialDevice::next_event::h1fd5b92dcb389595
                               at /tmp/surface-dial-linux/src/dial_device/mod.rs:135:24
  15:     0x5564df926870 - surface_dial_daemon::controller::DialController::run::h6ed7a03ca4f5ce84
                               at /tmp/surface-dial-linux/src/controller/mod.rs:75:23
  16:     0x5564df9192ae - surface_dial_daemon::controller_main::h4818504b738edb2d
                               at /tmp/surface-dial-linux/src/main.rs:95:5
  17:     0x5564df91e1eb - surface_dial_daemon::main::{{closure}}::h6bc4b241b67f62d4
                               at /tmp/surface-dial-linux/src/main.rs:37:39
  18:     0x5564df92bed3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h9797c619c9de90ff
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:121:18
  19:     0x5564df95cfe3 - std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}::h56ab2dbcb423e9f7
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/thread/mod.rs:551:17
  20:     0x5564df960e83 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h7e1d7ea3870781ed
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panic/unwind_safe.rs:271:9
  21:     0x5564df91d585 - std::panicking::try::do_call::hbf5691b84c232f56
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:483:40
  22:     0x5564df91dc4b - __rust_try
  23:     0x5564df91d00b - std::panicking::try::h78bf8defb17b073d
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:447:19
  24:     0x5564df917cd3 - std::panic::catch_unwind::h0c7d73b52b43a058
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panic.rs:137:14
  25:     0x5564df95c155 - std::thread::Builder::spawn_unchecked_::{{closure}}::h96fce1ffd142cddb
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/thread/mod.rs:550:30
  26:     0x5564df9462fe - core::ops::function::FnOnce::call_once{{vtable.shim}}::h4b1a79abb6bd427f
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:251:5
  27:     0x5564dfa3b103 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4273f95ec44459b3
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/alloc/src/boxed.rs:1987:9
  28:     0x5564dfa3b103 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h70f28fa4ddc269e5
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/alloc/src/boxed.rs:1987:9
  29:     0x5564dfa3b103 - std::sys::unix::thread::Thread::new::thread_start::h85a9c16b988e2bd0
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys/unix/thread.rs:108:17
  30:     0x7f7b90bf014d - start_thread
  31:     0x7f7b90c71a00 - __GI___clone3
  32:                0x0 - <unknown>
thread 'thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/controller/controls/media_with_volume.rs:17:22
stack backtrace:
   <unnamed>0:  ' panicked at ' called `Result::unwrap()` on an `Err` value: RecvError ',  src/dial_device/haptics.rs0x:5564dfa36c5052 - :std39::
backtrace_rs::backtrace::libunwind::trace::he615646ea344481f
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x5564dfa36c50 - std::backtrace_rs::backtrace::trace_unsynchronized::h6ea8eaac68705b9c
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x5564dfa36c50 - std::sys_common::backtrace::_print_fmt::h7ac486a935ce0bf7
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x5564dfa36c50 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1b5a095d3db2e28f
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x5564dfa52b8e - core::fmt::write::h445545b92224a1cd
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/fmt/mod.rs:1209:17
   5:     0x5564dfa34425 - std::io::Write::write_fmt::h55a43474c6520b00
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/io/mod.rs:1682:15
   6:     0x5564dfa36a15 - std::sys_common::backtrace::_print::h65d20526fdb736b0
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x5564dfa36a15 - std::sys_common::backtrace::print::h6555fbe12a1cc41b
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x5564dfa3829f - std::panicking::default_hook::{{closure}}::hbdf58083140e7ac6
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:267:22
   9:     0x5564dfa37fda - std::panicking::default_hook::haef8271c56b74d85
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:286:9
  10:     0x5564dfa38998 - std::panicking::rust_panic_with_hook::hfd45b6b6c12d9fa5
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:688:13
  11:     0x5564dfa38737 - std::panicking::begin_panic_handler::{{closure}}::hf591e8609a75bd4b
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:579:13
  12:     0x5564dfa370fc - std::sys_common::backtrace::__rust_end_short_backtrace::h81899558795e4ff7
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x5564dfa38452 - rust_begin_unwind
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:575:5
  14:     0x5564df9052b3 - core::panicking::panic_fmt::h4235fa9b4675b332
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:65:14
  15:     0x5564df905513 - core::result::unwrap_failed::ha17dbf463031a5e1
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/result.rs:1791:5
  16:     0x5564df95295c - core::result::Result<T,E>::unwrap::h45ff46d0ca4f054b
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/result.rs:1113:23
  17:     0x5564df916e1e - surface_dial_daemon::controller::controls::media_with_volume::double_click_worker::h5fc1a9670a2fca94
                               at /tmp/surface-dial-linux/src/controller/controls/media_with_volume.rs:17:9
  18:     0x5564df95de5f - surface_dial_daemon::controller::controls::media_with_volume::MediaWithVolume::new::{{closure}}::h058fb1019075986c
                               at /tmp/surface-dial-linux/src/controller/controls/media_with_volume.rs:53:56
  19:     0x5564df92be69 - std::sys_common::backtrace::__rust_begin_short_backtrace::h2390238e24158c83
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:121:18
  20:     0x5564df95d078 - std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}::h9b4d3753bd5ad5d8
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/thread/mod.rs:551:17
  21:     0x5564df960ec9 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::hd8b4227a9e593f5f
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panic/unwind_safe.rs:271:9
  22:     0x5564df91d3bc - std::panicking::try::do_call::h2751d62d181f53f3
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:483:40
  23:     0x5564df91dc4b - __rust_try
  24:     0x5564df91cd2e - std::panicking::try::h28d9dd08a45646ca
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:447:19
  25:     0x5564df917de8 - std::panic::catch_unwind::h5e988a92e1312e95
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panic.rs:137:14
  26:     0x5564df95cc91 - std::thread::Builder::spawn_unchecked_::{{closure}}::hb760bee070b0c292
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/thread/mod.rs:550:30
  27:     0x5564df94635e - core::ops::function::FnOnce::call_once{{vtable.shim}}::h97442dfe744266c3
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:251:5
  28:     0x5564dfa3b103 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4273f95ec44459b3
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/alloc/src/boxed.rs:1987:9
  29:     0x5564dfa3b103 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h70f28fa4ddc269e5
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/alloc/src/boxed.rs:1987:9
  30:     0x5564dfa3b103 - std::sys::unix::thread::Thread::new::thread_start::h85a9c16b988e2bd0
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys/unix/thread.rs:108:17
  31:     0x7f7b90bf014d - start_thread
  32:     0x7f7b90c71a00 - __GI___clone3
  33:                0x0 - <unknown>
stack backtrace:
   0:     0x5564dfa36c50 - std::backtrace_rs::backtrace::libunwind::trace::he615646ea344481f
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x5564dfa36c50 - std::backtrace_rs::backtrace::trace_unsynchronized::h6ea8eaac68705b9c
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x5564dfa36c50 - std::sys_common::backtrace::_print_fmt::h7ac486a935ce0bf7
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x5564dfa36c50 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1b5a095d3db2e28f
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x5564dfa52b8e - core::fmt::write::h445545b92224a1cd
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/fmt/mod.rs:1209:17
   5:     0x5564dfa34425 - std::io::Write::write_fmt::h55a43474c6520b00
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/io/mod.rs:1682:15
   6:     0x5564dfa36a15 - std::sys_common::backtrace::_print::h65d20526fdb736b0
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x5564dfa36a15 - std::sys_common::backtrace::print::h6555fbe12a1cc41b
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x5564dfa3829f - std::panicking::default_hook::{{closure}}::hbdf58083140e7ac6
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:267:22
   9:     0x5564dfa37fda - std::panicking::default_hook::haef8271c56b74d85
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:286:9
  10:     0x5564dfa38998 - std::panicking::rust_panic_with_hook::hfd45b6b6c12d9fa5
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:688:13
  11:     0x5564dfa38737 - std::panicking::begin_panic_handler::{{closure}}::hf591e8609a75bd4b
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:579:13
  12:     0x5564dfa370fc - std::sys_common::backtrace::__rust_end_short_backtrace::h81899558795e4ff7
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x5564dfa38452 - rust_begin_unwind
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:575:5
  14:     0x5564df9052b3 - core::panicking::panic_fmt::h4235fa9b4675b332
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:65:14
  15:     0x5564df905513 - core::result::unwrap_failed::ha17dbf463031a5e1
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/result.rs:1791:5
  16:     0x5564df9529e0 - core::result::Result<T,E>::unwrap::h48d5b1be395ae7f8
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/result.rs:1113:23
  17:     0x5564df91e42f - surface_dial_daemon::dial_device::haptics::DialHapticsWorker::run::h66f53f765aff3b54
                               at /tmp/surface-dial-linux/src/dial_device/haptics.rs:52:23
  18:     0x5564df9127a8 - surface_dial_daemon::dial_device::DialDevice::new::{{closure}}::h3cfa8bb3368b9480
                               at /tmp/surface-dial-linux/src/dial_device/mod.rs:72:35
  19:     0x5564df92be93 - std::sys_common::backtrace::__rust_begin_short_backtrace::h44be14c91cf1792d
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:121:18
  20:     0x5564df95d0a3 - std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}::hd10f8b37ce452168
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/thread/mod.rs:551:17
  21:     0x5564df960dc3 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h051e876aa40c1b41
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panic/unwind_safe.rs:271:9
  22:     0x5564df91d615 - std::panicking::try::do_call::hd125507138e1f514
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:483:40
  23:     0x5564df91dc4b - __rust_try
  24:     0x5564df91d0bb - std::panicking::try::he56fcb486c7738b1
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:447:19
  25:     0x5564df917d63 - std::panic::catch_unwind::h25baa8e586b9268d
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panic.rs:137:14
  26:     0x5564df95bdb5 - std::thread::Builder::spawn_unchecked_::{{closure}}::h7ca7a7195dfda8fb
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/thread/mod.rs:550:30
  27:     0x5564df94639e - core::ops::function::FnOnce::call_once{{vtable.shim}}::hdf14518623855f60
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:251:5
  28:     0x5564dfa3b103 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4273f95ec44459b3
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/alloc/src/boxed.rs:1987:9
  29:     0x5564dfa3b103 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h70f28fa4ddc269e5
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/alloc/src/boxed.rs:1987:9
  30:     0x5564dfa3b103 - std::sys::unix::thread::Thread::new::thread_start::h85a9c16b988e2bd0
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys/unix/thread.rs:108:17
  31:     0x7f7b90bf014d - start_thread
  32:     0x7f7b90c71a00 - __GI___clone3
  33:                0x0 - <unknown>
@daniel5151
Copy link
Owner

Happened to see this before I was about to head off to bed...

That's yet another permissions error, and those extra recv errors are just downstream errors (other threads dying because one thread died).

Check the source of the error in the code and try to deduce which file / perms need to be changed.

Not sure if I'll be able to be much more help, but best of luck!

@2ndBillGates
Copy link
Author

Happened to see this before I was about to head off to bed...

That's yet another permissions error, and those extra recv errors are just downstream errors (other threads dying because one thread died).

Check the source of the error in the code and try to deduce which file / perms need to be changed.

Not sure if I'll be able to be much more help, but best of luck!

Thank you for the tips, I'm debugging myself.

/dev/hidraw4 (I confirmed is Surface Dial)
I've found that /dev/hidraw4 cannot access by user except root

If I run cat /dev/hidraw4 | xxd
without sudo, it gives me permission denied

When I run it with root, and move the wheel
I received input

@2ndBillGates
Copy link
Author

ahhh. I fixed that issue by udev rules.
But now I get another error from Haptics

I'm trying to find a way to disable haptics module

surface-dial-daemon 
Started
haptics worker is waiting...
haptics worker is ready
Dial Connected
Unexpected haptics worker error! HID API Error: hidapi error: No such device
the haptics worker died!

@daniel5151
Copy link
Owner

Might have something to do with the hardcoded hwid values on this line:

let hid_device = api.open(0x045e, 0x091b).map_err(Error::HidError)?;

@2ndBillGates
Copy link
Author

Might have something to do with the hardcoded hwid values on this line:

let hid_device = api.open(0x045e, 0x091b).map_err(Error::HidError)?;

I managed to make it working, since I'm not so sure what line "64~76" codes are for from haptics.rs.
Now the daemon won't exit without error.

The scroll is a little bit too sensitive though. especially for "Zoom" & "Media"
Scroll (Fake Mutli-touch) works perfectly.

I'm not sure why you put KEY_SHIFT in volume mod, so I removed it.

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

No branches or pull requests

2 participants