I had for a while a display on the Kindle from the Pi using:
x11vnc -rfbport 5901 -forever
but could not get the:
xinit /usr/bin/openbox -- /usr/bin/Xvnc :1 -geometry 1200x824 -depth 16 -dpi 160 -alwaysshared -lazytight
to work.
Now I just have instabilities with usbnet, xorg and don't seem to be able to even get that far. startx just seems to stop the usbnet from communicating with the Kindle.
It was promissing but couldn't get the xinit to get the optimal resolution and unless I can get the usbnet and Xorg stability back I can't go any further on the Pi.
:-(

Now I have a complete rendering of the RPi screen on the Kindle … but, its far too small to be of practical use as my monitor is 1824x984 so scaled to 800x600 it looks small.

Some questions:

1. How can I reduce the size of the X desktop to improve the scaling?
2. Can I start the X as a “virtual” console at an 800x600 res?
3. If I want to automate the start up of Xorg so that it and x11vnc starts on boot.
4. Can I rotate the screen in the vncviewer? I think I recall an earlier post saying No.
5. How do I quit from vncviewer? E.g. if I forget to rotate the Kindle screen first, then need to quit vncviewer to rotate and then go back.

The aim eventually is to be able to have the option boot the Pi and use the Kindle as the console without the HDMI Monitor, only connecting my the monitor when needed.

Well, that scenario is what I thought you wanted to do in the first place. Thus the X server (!) used in the xinit command in the OP - it's a pure VNC<->X server. Xvnc is *not* x11vnc. The latter provides a *running* X server display via VNC. The further however is an X server on its own, as well as being a VNC server. Thus the start-up on another port.

Just install (e.g.) tightvnc, it will provide the Xvnc binary.

As for the list of questions:
1. has nothing to do with all this. Look this up for the default raspi X server, whatever that might be.
2. Xvnc is what you're searching for, I think.
3. You want to automate the start of Xvnc. Just use that xinit line suggested in the OP in your system startup scripts, e.g. /etc/rc.local on Arch Linux.
4. Hm, I think it should adapt to the orientation the framebuffer currently has, but that's it.
5. Via launchpad: shift-V-Q. Or adapt the config.lua file, a function for quitting is provided, you can call it for a certain key combinations. Would require messing with Lua, though.

@hawhill thanks for the corrections.
I mistakenly took X11vnc as an arm implementation Xvnc.

After some fixing of fonts and installed prereq packages the problem has moved on a little was I’m stalled at the x2vnc -east localhost:1 stage as there was no binary package of x2vnc for archlinuxarm.

Fortunately I downloaded the x2vnc source package and was able to compile it.

Everything seems to be there but I just get a black screen on the Kindle.
Any tips for diagnosing the problem?

I assume “xinit ..be called direct from a bash console and not from an X terminal window but the x2vnc is from the terminal window.

Following form the above, I restarted the X servers to match @hawhills example.
i.e. device :0 the main X window device 0, device :1 the X server with Xvnc
From a terminal window on device 0 I ran x2vnc -east localhost:1.
I used Realvnc from a PC as the vncviewer instead of the Kindle.
The Windows PC Realvnc viewer connects with device 1 (e.g. a basic X session).
Without x2vnc running device 0 cursor stops at the east end of the desktop, with x2vnc running the mouse runs off the desktop. All appears fine so far... only anything running off the east side does not appear on the vncviewer.
Any advice on configuration or diagnosis appreciated.
More output:

as the connections are x.x.x.177 from the Windows PC viewer and localhost is the x2vnc it seems as if the problem is getting output from device 0 through x2vnc to device 1.

The only warnings I can see are from Vvnc:
XKB extension is not present on the server or is old
Xinerama extension is not present on the server
XRandR extension is not present on the server
but are they critical to x2vnc working?

Last edited by sunnydev; 07-14-2012 at 02:30 PM.
Reason: added some text

No, they shouldn't be. But I must admit that I lost track about how you want to set devices up. "x2vnc" is for input only. In the scenario I proposed using it, there would be another X server running that is in charge of the input devices, and x2vnc would be used to "forward" these input devices to the other (VNC-frontend) X server. But when there's no such second server running on the RasPi, that wouldn't work.

Unfortunately I'm not aware of a tool that allows to "connect input devices" to a VNC server by other means, so this might be a dead end (for now). The VNC client on the Kindle has no mouse support (yet?).

@hawhill
I thought I'd recreated the scenario you described at the start of the thread which I understand to be:
1. A normal X server running on the linux host (device 0) this provides the normal console display on the linux host, keyboard and mouse inputs.
2. The xinit starts the Xvnc (tightvncserver) running as an Xserver (device 1) on the linux host with vnc output to a vncviewer (Kindle or PC).
3. x2vnc then forwards the mouse (and keyboard) to device 1 when the mouse goes off the desktop of device 0, e.g. the East boundary.

In my case both the native X and Xvnc servers work on the Pi. The vnc viewer connects to the Xvnc server. The x2vnc appears to connect to the Xvnc server and the cursor does go off the East boundary.
It appears the last part, the x2vnc forwarding display to thr Xvnc server does not appear to be working.
Also if I use a Windows PC as the viewer rather than the Kindle the Xvnc server responds to mouse control from the PC. Is this normal behaviour or should the x2vnc lockout other mouse input to the Xvnc server?
It could be an x2vnc problem but I was looking for verification that the configuration was "correct" and any tips on diagnosing the x2vnc to validate of that's where the problem is.
Thanks

OK, that is the setup I outlined, yes. I have a hard time imagining what's wrong with x2vnc. When you move the mouse cursor "out of" the main screen, it should appear on the VNC-exported X server, and keyboard input should be forwarded to that server. More than one client on a VNC server is possible, though some need special configuration (flag "-alwaysshared") in order to work that way. x2vnc does _NOT_ forward anything but the input devices, though. So I'm not sure what you mean at that point. This is why I outlined a method that would start a new, separate X server running a new, separate window manager (openbox in the example). You can not just "move applications" from one X server to the other.

Thanks for clarifying the x2vnc.
The problem appears to be the redirected inputs are not getting to the VNC exported X server.
The cursor moves of the East boundary of the X desktop but does not appear on the VNC viewer.
At present it seems my only possible course of action I have is to try compile different versions of x2vnc to see if one of those work.

While it does not exactly solve the problem at hand, you might want to have a look at x2x, too. It basically does the same for 2 X servers - which is what you have, too (when looking at it a slight bit differently). Or synergy, which is basically a x2x with more bells and whistles.

I discovered the problem was with the PC RealVNC viewer configuration on the PC I used to test. The default option in the advanced settings is to render the cursor locally (on the PC viewer). As soon as I switched that off the rendering was done by Xvnc server and therefore appeared on the PC viewer.

I went back and tested with Kindle vncviewer and it all works. Perhaps I missed the cursor first time around as it appears black against a black background or maybe I was too aggressive on the mouse movements as I note the updates to the Kindle are laggy, over usbnet at least.

FYI: I tested x2x between two native X servers on Archlinux/RPi and it appears to work as well as x2vnc. There maybe a slight advantage in using x2vnc as it may have some Xvnc logging advantages but I've fully investigated any logging x2x may have.

When working through the problem I noticed that tightvnc server standard output indicates the number of mouse and keyboard events from x2vnc when the client disconnects. So I noticed when I killed x2vnc that tightvnc was actually picking up the mouse pointer events so that gave the clue about the viewer problem. The logging events with Xvnc aren't there when using x2x.

My next steps are look more configuration of the basic Openbox is required now as there's no usable applications but that's a different problem.

Thanks for the help @hawhill. Works as per your original post on the Raspberry Pi with Archlinuxarm.

I just started bouncing around the idea of using a R-Pi with Kindle on the R-Pi forum the other day, with no response yet. To find you guys working on it here is great news!

Thanks hawhill for the x2x tip! I was also wondering if it might be possible to just share X in that way without doing the whole VNC thing, although I have just been reading that in some cases VNC is actually faster... Seems counter-intuitive.

Once we get the display sorted out, it's just the beginning. There is a wifi card to be hijacked, and a filesystem to be mounted over the usbNetwork. Finally, but it seems too ambitious, there's a whole extra CPU sitting there...

Two complete "extra" cpu and systems if you have the 3G card.
The 3G card is also an ARM SoC -
Very little here to-date on making use of the system on the 3G card.

That's very interesting. It seems that a lot of the Kindle hacking that has been done is focused on retaining the device's functionality and interop with Amazon's services. That is, ``bricking'' is seen as a bad thing. It seems like this device is way more useful as a general purpose computing device. Has anyone yet been able to install an OS from scratch?

This is just an opinion and my own position perspective on @jcg. #162 and please don’t think I’m being critical, quite the opposite, if you have the time, enthusiasm and money then I’d encourage you to go for it.

It’s NOT that bricking is bad, it probably adds lots more options but would that regarded as off topic as this is “mobileread” thread ? If people really have a Kindle that you don’t want to use with Amazon then it sounds like an interesting project.

I would like to be able to use the Kindle as the primary display for the Pi but I don’t want to totally repurpose the Kindle. I still want to take my Kindle on holiday and read my books in the Sun. :-) The goal for me would be have an eInk display I can use with a full size keyboard (to the Pi) for some compute capability. An alternative approach would be a full sized keyboard on the Kindle but that’s another story. I’d probably be replace this configuration later this year with an Android Tablet that has a PixelQi screen when they finally hit the market. The usual promises of imminent release have been going on for months.

Hacking the 3G and tethering sounds a little more risky. Perhaps the TelCos and Amazon have thought of that one and would have some monitoring and protection in place if this goes outside a little non-Amazon use e.g. more than is reasonably possible via the experimental browser etc. I’ve not read the Amazon Terms and Conditions but there could be a gotcha clause in there that makes you liable for costs (assuming they can identify you). Alternatively perhaps they would just cut off the 3G (and brick the device?)

Alas I have constraints of time so I have to moderate my interest, although I’m interested in how you’d get on with these other projects, the only one I can put anytime into would be the non-destructive use of Kindle so returning to that topic: the conclusion I’ve reached so far is x2vnc approach works, it’s a little laggy and a little more is needed to configure the openbox/Xvnc server for more X terminal features and then the automation of it all to fire up from boot. I’ll post some of this to the Rpi forum too.