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

Unhandled exception: HardwareDisplayDriver.cs:line 163 #4

Closed
martin1ehm opened this issue Mar 24, 2021 · 12 comments · Fixed by #5
Closed

Unhandled exception: HardwareDisplayDriver.cs:line 163 #4

martin1ehm opened this issue Mar 24, 2021 · 12 comments · Fixed by #5

Comments

@martin1ehm
Copy link

Hi

I tried to run the sandbox on my rm2 device. Unfortunately I always get the following error.

Does the library work already on the rm2?
...or am I just missing something here.

I am using the latest commit 713bf39

reMarkable: ~/ dotnet/dotnet ./rm_sandbox/Sandbox.dll

Unhandled exception. ReMarkable.NET.Unix.Stream.UnixException (0x80004005): EINVAL: Invalid argument (22)
   at ReMarkable.NET.Unix.Driver.Display.HardwareDisplayDriver.Refresh(Rectangle rectangle, WaveformMode mode, DisplayTemp displayTemp, UpdateMode updateMode) in D:\ReMarkable.NET\ReMarkable.NET\Unix\Driver\Display\HardwareDisplayDriver.cs:line 163
   at ReMarkable.NET.Unix.Driver.Display.HardwareDisplayDriver.Draw(Image`1 image, Rectangle srcArea, Point destPoint, Rectangle refreshArea, WaveformMode waveformMode, DisplayTemp displayTemp, UpdateMode updateMode) in D:\ReMarkable.NET\ReMarkable.NET\Unix\Driver\Display\HardwareDisplayDriver.cs:line 102
   at Sandbox.Program.Main(String[] args) in D:\ReMarkable.NET\Sandbox\Program.cs:line 72
Aborted

Thanks in advance 😊

@i-am-shodan
Copy link
Contributor

It dies trying to trigger a refresh, i'm going to have a go fixing this

@Eeems
Copy link

Eeems commented Jul 19, 2021

@martin1ehm are you running it in context of rm2fb?

@i-am-shodan
Copy link
Contributor

I can't speak for @martin1ehm but i'm running it with:
LD_PRELOAD=/opt/lib/librm2fb_client.so.1.0.1 ~/dotnet/dotnet Sandbox.dll

I've had to made other changes like fix input device handling with:
Touchscreen = new HardwareTouchscreenDriver(deviceMap["pt_mt"], 767, 1023, 32);

@Eeems
Copy link

Eeems commented Jul 19, 2021

It might be that rm2fb doesn't handle the managed .NET code properly. I would recommend opening an issue on rm2fb and getting some help sorting out support there.

@parzivail
Copy link
Owner

parzivail commented Jul 19, 2021

Hey guys, I guess the first issue escaped my inbox, my apologies! It's possible that the device isn't named pt_mt anymore when listed via /proc/bus/input/devices. Unfortunately I don't have an rM2 to test this on, could someone verify this?

@i-am-shodan
Copy link
Contributor

cat /proc/bus/input/devices
I: Bus=0019 Vendor=0000 Product=0000 Version=0000
N: Name="30370000.snvs:snvs-powerkey"
P: Phys=snvs-pwrkey/input0
S: Sysfs=/devices/soc0/soc/30000000.aips-bus/30370000.snvs/30370000.snvs:snvs-powerkey/input/input0
U: Uniq=
H: Handlers=kbd event0
B: PROP=0
B: EV=3
B: KEY=100000 0 0 0

I: Bus=0018 Vendor=056a Product=0000 Version=0031
N: Name="Wacom I2C Digitizer"
P: Phys=
S: Sysfs=/devices/soc0/soc/30800000.aips-bus/30a20000.i2c/i2c-0/0-0009/input/input1
U: Uniq=
H: Handlers=event1
B: PROP=0
B: EV=b
B: KEY=1c03 0 0 0 0 0 0 0 0 0 0
B: ABS=f000003

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="pt_mt"
P: Phys=2-0024/input0
S: Sysfs=/devices/soc0/soc/30800000.aips-bus/30a40000.i2c/i2c-2/2-0024/input/input2
U: Uniq=
H: Handlers=event2
B: PROP=2
B: EV=f
B: KEY=7 f8000000 0
B: REL=0
B: ABS=6f38000 2000000

@martin1ehm
Copy link
Author

@martin1ehm are you running it in context of rm2fb?

No but now I do, I had probably misunderstood how the whole thing works. 😅
To be honest I am more of a C# programmer and less familiar with Linux systems...

After starting from scratch i also tried LD_PRELOAD=/opt/lib/librm2fb_client.so.1.0.1 ~/dotnet/dotnet Sandbox.dll
Now I get the following message.

reMarkable: ~/ LD_PRELOAD=/home/root/librm2fb_server.so.1.0.1 ~/dotnet/dotnet Sandbox.dll
STARTING RM2FB
BIN FILE: /home/root/dotnet/dotnet
COULDNT LOCATE SIGNATURE IN /home/root/dotnet/dotnet
PLEASE SEE https://github.com/ddvk/remarkable2-framebuffer/issues/18

Which "signature" is meant here?

@parzivail Device Information


- RM2 Version 2.8.0.98

I: Bus=0019 Vendor=0000 Product=0000 Version=0000
N: Name="30370000.snvs:snvs-powerkey"
P: Phys=snvs-pwrkey/input0
S: Sysfs=/devices/soc0/soc/30000000.aips-bus/30370000.snvs/30370000.snvs:snvs-powerkey/input/input0
U: Uniq=
H: Handlers=kbd event0
B: PROP=0
B: EV=3
B: KEY=100000 0 0 0

I: Bus=0018 Vendor=056a Product=0000 Version=0031
N: Name="Wacom I2C Digitizer"
P: Phys=
S: Sysfs=/devices/soc0/soc/30800000.aips-bus/30a20000.i2c/i2c-0/0-0009/input/input1
U: Uniq=
H: Handlers=event1
B: PROP=0
B: EV=b
B: KEY=1c03 0 0 0 0 0 0 0 0 0 0
B: ABS=f000003

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="pt_mt"
P: Phys=2-0024/input0
S: Sysfs=/devices/soc0/soc/30800000.aips-bus/30a40000.i2c/i2c-2/2-0024/input/input2
U: Uniq=
H: Handlers=event2
B: PROP=2
B: EV=f
B: KEY=7 f8000000 0
B: REL=0
B: ABS=6f38000 2000000

@Eeems
Copy link

Eeems commented Jul 20, 2021

@martin1ehm are you running it in context of rm2fb?

No but now I do, I had probably misunderstood how the whole thing works. 😅
To be honest I am more of a C# programmer and less familiar with Linux systems...

After starting from scratch i also tried LD_PRELOAD=/opt/lib/librm2fb_client.so.1.0.1 ~/dotnet/dotnet Sandbox.dll
Now I get the following message.

reMarkable: ~/ LD_PRELOAD=/home/root/librm2fb_server.so.1.0.1 ~/dotnet/dotnet Sandbox.dll
STARTING RM2FB
BIN FILE: /home/root/dotnet/dotnet
COULDNT LOCATE SIGNATURE IN /home/root/dotnet/dotnet
PLEASE SEE https://github.com/ddvk/remarkable2-framebuffer/issues/18

Which "signature" is meant here?

You are running the server.so instead of the client.so.

If you installed from toltec, you can run it with the following for simplicity: rm2fb-client ~/dotnet/dotnet Sandbox.dll. You will need to make sure that the rm2fb server is running though.

@martin1ehm
Copy link
Author

martin1ehm commented Jul 20, 2021

@Eeems OK, looks like I must have missed the server/client thing

While starting the server (without Toltec) with the command LD_PRELOAD=/home/root/librm2fb_server.so.1.0.1 /usr/bin/xochitl I get the following messages.

reMarkable: ~/ LD_PRELOAD=/home/root/librm2fb_server.so.1.0.1 /usr/bin/xochitl
STARTING RM2FB
BIN FILE: /usr/bin/xochitl
ADDR: 342bc8
REPLACING THE IMAGE with shared memory
Reading waveforms from /usr/share/remarkable/320_R325_AF0211_ED103TC2U2_VB3300-KCD_TC.wbf
Running INIT (111 phases)
SWTCON initialized \o/
1404 1872 16
WAITING FOR SEND UPDATE ON MSG Q

With the server running I tried to start the sandbox (this time with the client) and got the original error message again.

reMarkable: ~/rm_sandbox/ LD_PRELOAD=/home/root/librm2fb_client.so.1.0.1 ~/dotnet/dotnet Sandbox.dll
Unhandled exception. ReMarkable.NET.Unix.Stream.UnixException (0x80004005): EINVAL: Invalid argument (22)
   at ReMarkable.NET.Unix.Driver.Display.HardwareDisplayDriver.Refresh(Rectangle rectangle, WaveformMode mode, DisplayTemp displayTemp, UpdateMode updateMode) in D:\ReMarkable.NET\ReMarkable.NET\Unix\Driver\Display\HardwareDisplayDriver.cs:line 163
   at ReMarkable.NET.Unix.Driver.Display.HardwareDisplayDriver.Draw(Image`1 image, Rectangle srcArea, Point destPoint, Rectangle refreshArea, WaveformMode waveformMode, DisplayTemp displayTemp, UpdateMode updateMode) in D:\ReMarkable.NET\ReMarkable.NET\Unix\Driver\Display\HardwareDisplayDriver.cs:line 102
   at Sandbox.Program.Main(String[] args) in D:\ReMarkable.NET\Sandbox\Program.cs:line 72
Aborted

@Eeems
Copy link

Eeems commented Jul 20, 2021

There has been some discussion on the discord about this: https://discord.com/channels/385916768696139794/771436565757952070/866705834130276402

@martin1ehm
Copy link
Author

There has been some discussion on the discord about this: https://discord.com/channels/385916768696139794/771436565757952070/866705834130276402

Can you repost the Discord link and/or invitation? This one is not working.

@Eeems
Copy link

Eeems commented Jul 20, 2021

There has been some discussion on the discord about this: https://discord.com/channels/385916768696139794/771436565757952070/866705834130276402

Can you repost the Discord link and/or invitation? This one is not working.

That's because it's not an invite link, it's a link directly to a message in a channel. You can find the invite link on https://remarkablewiki.com/

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

Successfully merging a pull request may close this issue.

4 participants