Skip to content

Conversation

@lluchs
Copy link
Contributor

@lluchs lluchs commented Jan 15, 2021

This is useful to point out parts of your drawing directly on remarkable when streaming to a video conference.

Demo:

pen_marker.mp4

I don't have a RM1, so I couldn't test there. I did implement two bytes per pixel, but inverting might work differently.

Adds a dependency on libremarkable for input handling.

@rien
Copy link
Owner

rien commented Jan 22, 2021

Hi there!

This looks good, I didn't know this would be so easy. Do you notice an impact on framerate/lag?

I'm planning on adding commandline features to reStream. so I'll merge this once that is implemented, with the option to turn this feature on/off.

Thanks!

@lluchs
Copy link
Contributor Author

lluchs commented Jan 22, 2021

Do you notice an impact on framerate/lag?

I believe the framerate is currently only limited by the bandwidth of the USB link, so there's no impact from drawing the cursor. It does make the low framerate on more complex pages (that don't lz4-compress as well) very noticeable, though.

I'm planning on adding commandline features to reStream. so I'll merge this once that is implemented, with the option to turn this feature on/off.

Excellent, I can update the PR once that's there.

@rien rien mentioned this pull request Jan 28, 2021
@rien
Copy link
Owner

rien commented Jan 29, 2021

@lluchs I've created a new release (with the addition of command line arguments), can you rebase your PR on it and add an option to enable this feature?

This is useful to point out parts of your drawing when streaming to a
video conference.
Copy link
Contributor Author

@lluchs lluchs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rebased and added an option now. There's a few places that might need adjustments for RM1.

I believe the framerate is currently only limited by the bandwidth of the USB link

That doesn't seem to be true by the way, I think I was confused by top output because of the idling second core. I think I'm going to try doing the compression with two threads...

anyhow = "1.0"
lz-fear = "0.1"
clap = "3.0.0-beta.2"
libremarkable = "0.4.3"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pulls in a lot of unnecessary dependencies, I already opened a PR (linked earlier) to reduce that somewhat. Doesn't seem to have an effect on binary size, though.


/// Draw pen position into fb data, if necessary (in hover range and not drawing).
fn draw_pen_position(&mut self, buf: &mut [u8]) {
if let (false, Some((y, x))) = (self.drawing, self.pen_pos) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The input and framebuffer axes are swapped on RM2, so we have (y, x) here. Might be different on RM1.

px_end = cursor + buf.len() as isize;
}
// invert pixel (on RM2)
// TODO: Do something sensible on RM1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how the RM1 framebuffer works, inverting each byte like this might be wrong.

@abmantis
Copy link
Contributor

abmantis commented May 7, 2022

Are there any plans to get this merged?

Comment on lines +250 to +252
// we need negative numbers to calculate offsets correctly
let width = self.width as isize;
let height = self.height as isize;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// we need negative numbers to calculate offsets correctly
let width = self.width as isize;
let height = self.height as isize;
let flip = self.width > self.height;
let (x, y) = if flip { (y, x) } else { (x, y) };
// we need negative numbers to calculate offsets correctly
let width = if flip { self.height } else { self.width } as isize;
let height = if flip { self.width } else { self.height } as isize;

A rm2 without rm2fb has inverted width/height

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change, it works nicely!

@rien
Copy link
Owner

rien commented May 9, 2022

Hi @abmantis, I can look at merging this but I would first have to test if this works on an rM1.

You can create a new PR with the changes you requested, rebased with the current main branch.

@abmantis
Copy link
Contributor

abmantis commented May 9, 2022

Hi @abmantis, I can look at merging this but I would first have to test if this works on an rM1.

You can create a new PR with the changes you requested, rebased with the current main branch.

I already had a working branch that was updated from the main branch already. Opened a PR now: #90
I've only tested this on a rM2 (without rm2fb). If you are not able to get a rM1 to test, maybe it can be integrated anyway since it is not enabled by default, and someone can open an Issue or PR later if it does not work properly on rM1.

@abmantis
Copy link
Contributor

abmantis commented Oct 8, 2023

@rien ever had the change to look at #90 ?

@rien rien merged commit 0572e18 into rien:main Jan 9, 2024
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 this pull request may close these issues.

3 participants