-
Notifications
You must be signed in to change notification settings - Fork 6
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
pending changes #1
Comments
So what was the story around xtermjs/xterm.js#2503 ? I was so excited that almost everything was working, and then it seemed they abruptly pulled the plug. Will they never ship sixel? Or they might someday, just not anytime soon? Is it OK if I point other JS devs looking for sixel this way? |
I stalled the PR over there mostly due to time constraints. The PR grew really big over a quite long time, which makes it harder and harder to merge in. Furthermore its maintenance is not easy, as it uses many internal private symbols for the buffer and output interaction. In fact that code belongs into core some day, such a heavy lifting should not reside on an addon. But we never made it to that point, mainly because the whole image story is still uncertain ground in terminals and still might see more than one groundbreaking shift. All in all - no good conditions to be moved into core.
Sure. Well the sixel lib has still a few issues on the decoder, but in general should do its job. The encoder is not yet wasm optimized, which has no priority on my end (just added it to have support in both directions). |
I'm working on DOOM inside terminals now. Would you be interested in me testing against xterm.js with this? Perfectly fine if not, I do not want to create uninteresting work for you. :) If you are interested, is there a recommended way to get xterm.js + xterm-addon-image working with a local shell? Also:
Is this about DECSDM? I'm using that now for rendering to the bottom text row (when the that location is within 1000x1000 of the top-left, due to xterm limits). If so, there is an odd interaction with transparent-images-over-old-images, as seen here. This behavior currently affects wezterm and DomTerm. |
@klamonte Sure, feel free to play around with it. This what you would need:
DECSDM is correctly support as far as I had tested it. The cursor positioning currently follows the right-or-below semantics (thats more like xterm would do it), which is subpar, compared to VT340's mode (always at first image column of the last image row). This needs to be changed before it can get released. Since you play around with transparent composition, thats also not yet done in the addon. Planned for second alpha version. |
I can't get it to work on Debian. After installing:
Then (after aliasing yarn=yarnpkg):
I get:
Based on the stack trace, something in there thinks it is running on Windows. Any tips? |
This looks like node-gyp is missing, hmm. How did you install nodejs? On ubuntu I never use the node packages from the distro repo, as they are broken in several ways, maybe thats the issue here? |
Thank you, I used the nodesource version, installed yarn as per https://vitux.com/how-to-install-yarn-node-package-manager-on-debian-11/ , and it ran! vttest looked good. When jexer itself ran mouse and keyboard input died -- turns out I wasn't also honoring BEL to end OSC sequences (I use OSC 4 to query the ANSI colors) -- so thanks for exposing my bug. :) Performance wasn't good. Firefox pegged out around 30+ kbytes/sec of sixel. Given the numbers I've seen you post on your decoder, I'm sure that's a firefox problem and not a xterm.js problem. XtermDOOM was posting 20-30 FPS, and firefox was pegging both of my measly cores trying to keep up lol. But for you: simplescreenrecorder-2022-02-02_10.13.32.mp4 |
Yes Firefox is slower in WASM execution than Chrome, but 30 kb/s? Thats 500 times lower than I would expect, for Firefox I saw ~22 MB/s, while Chrome was around 41 in my tests. Whats the pixel size of a single frame from the doom output? Are you sure that there is nothing else slowing down things? If you care enough, maybe open devtools-->performance in Chrome and record for a few seconds, while sixels are streamed. Then after stopping, check the tab "Bottom-Up" down below. I am pretty sure, that something else is going on here. |
Oh I'm sure something else is going on too. :) I'm sorry if it looked like I was saying your code is slow, I know it's very fast. I just wanted you to see it, and if you want to play with it too you know where to look. |
@klamonte Are there instructions anywhere how to get that DOOM thingy up and running? |
Some more discussion (I sort of threadjacked oops!) at: https://codeberg.org/dnkl/foot/issues/481#issuecomment-363377 |
My encoder definitely struggles at any decent frame rate. chafa's and notcurses' encoders are on the order of 100-1000x (not exaggerating) faster. I have a lot more work to do on the DOOM side to clean up CPU, and then go through the entire image from DOOM-->Jexer-->compositing-->xterm pipeline again. A couple things that may improve you for now:
You can also compare it against running inside wezterm. Jexer uses iTerm2 PNG images for that which is a lot faster. BTW those FPS numbers are about what my laptop is getting on xterm itself. So great job with xterm.js! :) |
@klamonte WezTerm is at ~35 FPS for me.
Will try that tomorrow. All in all, this looks really promising, well done 😺 |
Jexer is unique in its sixel output strategy. It emits images first, then text, and expects the text to destroy the image. The images are also 1 row high and I think they might be doing like 10 cols max. So lots of intersecting sixel and text. Oh, and when multithread is enabled the sixel images are produced in whatever order the thread pool gets to them, so there will be lots of "place->sixel->place->sixel->..." and then "place->text->place->text->...". Don't know if that helps or not. 🤷♀️ |
Here are some results:
Thats prolly the reason why I see such worse browser load with jexer.ECMA48.sixelPaletteSize=256. The context switches for sixel/text are quite expensive due to the internal worker setup (its kinda a "long line", I have no cheap memory mapping in place, SABs are a nightmare to use since spectre/meltdown). I might try to run this with a non-worker based version (sixel decoding done directly in the mainthread), which should remove alot of the messaging overhead. But thats not a viable solution for xterm.js in general, as it makes the mainthread busy up to perceivable stalls for bigger images. |
I think DOOM itself maxes at 60 FPS, as that is the same limit foot found. You can eliminate the RGB by commenting out the getTheme().setFemme() line in src/xterm/XtermDOOM.java . |
I used to cache RGB, and then notcurses-demo crashed me. :-) |
"subscribe" (Hi @jerch, this is my new account.) |
WB! And no worries, I have not forgotten about the original topic (yet), but still have other things to do before I can get back to it. I even might introduce an optional worker setup setting to work around the issue found above (so peeps can decide on their own, whether to use worker-based or mainthread-based decoding, depending on their integration needs). |
Dealt with in several PRs. |
@AutumnMeowMeow Just released the first npm version 😄 |
The text was updated successfully, but these errors were encountered: