Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] Can't get framebuffer working inside fbterm

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
tamarindo
Posts: 4
Joined: 2017-05-24 17:40

[Solved] Can't get framebuffer working inside fbterm

#1 Post by tamarindo »

Hello everyone! I'm on Debian Stretch and I'm trying to approach the framebuffer for the first time, just for fun. My final aim is to run framebuffer applications inside tmux. Here I've seen that the best way to do this is to run tmux inside fbterm (at least for Arch), so i installed fbterm from repos. The problem is that no framebuffer application seems to work inside fbterm, whereas they work perfectly fine outside fbterm both in X and in tty. For instance when i run w3m (with w3m-img) i can't see any image in any website, while i see them running w3m in a plain tty. Another example is running fbi in tty, which works out of the box in a simple tty shell, but if i run

Code: Select all

fbi image.jpg
or

Code: Select all

fbi -d /dev/fb0 image.jpg
I obtain
ioctl VT_GETSTATE: Inappropriate ioctl for device (not a linux console?)
I have the same issue running fbterm as root. Just for clarity, everything I tried so far is outside of tmux. Am I missing something?
Thanks a lot!
Last edited by tamarindo on 2017-05-26 20:20, edited 1 time in total.

User avatar
orythem27
Posts: 252
Joined: 2017-05-11 07:59
Location: P.R. China

Re: Can't get framebuffer working inside fbterm (Debian Stre

#2 Post by orythem27 »

I'm not sure about the root cause of your problem, but I myself had also found fbi to be problematic under fbterm. Instead, I use fbv.

And to workaround that fbv does not have a Debian package, I'm using the archlinux package on Debian 9. Just unpack and put the binary executable into your $PATH. You can also build it yourself should you encounter any ABI or other library imcompatibilities under older Debian versions.

As for w3m-img, see this unresolved bug report https://bugs.debian.org/cgi-bin/bugrepo ... bug=590668 for a workaround.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Can't get framebuffer working inside fbterm (Debian Stre

#3 Post by debiman »

you are using fbterm in a tty, meaning not in a Xorg session terminal emulator?

maybe it goes without saying, maybe it doesn't even start in an Xsession. just making sure.

tamarindo
Posts: 4
Joined: 2017-05-24 17:40

Re: Can't get framebuffer working inside fbterm (Debian Stre

#4 Post by tamarindo »

debiman wrote:you are using fbterm in a tty, meaning not in a Xorg session terminal emulator?

maybe it goes without saying, maybe it doesn't even start in an Xsession. just making sure.
Yes, I meant outside Xorg. Indeed, as you pointed out, fbterm does not start at all inside X.
orythem27 wrote:I'm not sure about the root cause of your problem, but I myself had also found fbi to be problematic under fbterm. Instead, I use fbv.

And to workaround that fbv does not have a Debian package, I'm using the archlinux package on Debian 9. Just unpack and put the binary executable into your $PATH. You can also build it yourself should you encounter any ABI or other library imcompatibilities under older Debian versions.

As for w3m-img, see this unresolved bug report https://bugs.debian.org/cgi-bin/bugrepo ... bug=590668 for a workaround.
Thanks, you're right! fbv inside fbterm (I used the binary from the arch package) works fine, and actually inside fbterm+tmux too! My next step will be to give jfbterm a try and to understand how to fit fbv inside tmux pane size instead of full screen. Do you think fbi issue inside fbterm can be considered a bug to be reported?

User avatar
orythem27
Posts: 252
Joined: 2017-05-11 07:59
Location: P.R. China

Re: Can't get framebuffer working inside fbterm (Debian Stre

#5 Post by orythem27 »

tamarindo wrote:My next step will be to give jfbterm a try
If I understand correctly you don't need to actually use jfbterm, just fake the environment variable to trick w3m into thinking itself running in jfbterm. :mrgreen:

Code: Select all

TERM=jfbterm w3m www.google.com
tamarindo wrote:Do you think fbi issue inside fbterm can be considered a bug to be reported?
If there are no similar reports in the bug tracker then it is OK to report. And in this case I think reporting to the upstream 'original' developer of fbi might also be necessary.

tamarindo
Posts: 4
Joined: 2017-05-24 17:40

Re: Can't get framebuffer working inside fbterm (Debian Stre

#6 Post by tamarindo »

orythem27 wrote: If I understand correctly you don't need to actually use jfbterm, just fake the environment variable to trick w3m into thinking itself running in jfbterm. :mrgreen:

Code: Select all

TERM=jfbterm w3m www.google.com
Sorry, I forgot to mention: i tried the line suggested in the bug report

Code: Select all

fbterm -- env TERM=jfbterm w3m google.com
but it results in some error message which I can't read since it appears in just a fraction of second, then fbterm starts end exit immediately, clearing the screen. Then I tried to start fbterm and to set TERM=jfbterm inside, but

Code: Select all

TERM=jfbterm; w3m www.debian.net
returned

Code: Select all

Can't find termcap entry jfbterm
I guess that actually using the real jfbterm would return the same error, but maybe it worths a chance.

User avatar
orythem27
Posts: 252
Joined: 2017-05-11 07:59
Location: P.R. China

Re: Can't get framebuffer working inside fbterm (Debian Stre

#7 Post by orythem27 »

tamarindo wrote:TERM=jfbterm; w3m http://www.debian.net
Try removing the semicolon so that the environment variable will actually apply to `w3m`, not just the shell itself.

Also somebody mentioned that to use this environment variable you have to install jfbterm. In fact you don't have to actually install jfbterm, just put the relevant terminfo file in /usr/share/terminfo and use `TERM=jfbterm w3m <uri>` in fbterm.

I'm able to get it working by downloading http://archive.debian.org/debian/pool/m ... _amd64.deb , extracting it and copy usr/share/terminfo/j/jfbterm to /usr/share/terminfo/j/

If you like a cleaner solution, there are various tutorials on patching w3m-img to work in plain fbterm.

tamarindo
Posts: 4
Joined: 2017-05-24 17:40

Re: Can't get framebuffer working inside fbterm (Debian Stre

#8 Post by tamarindo »

:o orythem27, I'm impressed by your deep knowledge and problem solving ability! Removing semicolomn didn't change the situation, but I tried the "clean way" with the tutorial you suggested, and it works! :D Now I have a fbterm which works pretty well (it's just black and white, but i guess I just forgot to specify some option during compilation) with w3m and images! It works in tmux too, although it misses a few images, but it's fine for now. I learned a lot and it's been funny. Thank you again, and thanks to Shin Iwasaki who posted the patch on the blog you suggested! :D

Post Reply