-
Notifications
You must be signed in to change notification settings - Fork 8
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
Installation instructions for Fedora + few basic questions #1
Comments
It's not possible to use the Raspberry Pi 3 because it has a usb hub that uses the only usb port on the soc. The Pi Zero is probably best as a usb display adapter. The Pi4 (usb-c) is not as convenient for usb since it needs to be powered through the gpio header since it's so power hungry, but it can use the network port instead as transport (see wiki: usbip). Or can PC USB ports deliver 3A nowadays? (anyways I haven't tried this) You need to look up the Fedora docs for how to compile a kernel. Linux v5.9 will have all the dependencies for the host driver, v5.8 needs this: torvalds/linux@bd34cea (if I'm not mistaken) |
I might buy a pi zero and give it a try. So, in my case, the host is the laptop and the device is the pi zero? If that's the case, I'll use your pi zero image and a recent kernel for Fedora. I've seen a way to install a vanilla kernel on fedora and I think when Linux 5.9 is released it will be available with this method. Or maybe I'll just wait for Fedora 33, which might have Linux 5.9 out of the box Thanks for your help! |
Yes |
I've ordered a pi zero. I'll tell you how it goes. Thanks again |
I bought a Raspberry Pi Zero and installed the kernel 5.9.0-36.vanilla.1.fc32.x86_64 in Fedora 32 using these instructions:
Now when connecting the zero to the usb port of the laptop I see in the logs that there is a "Pi Display Gadget":
And running lsusb I see a new OpenMoko device:
But Gnome settings doesn't recognise the usb display adapter, not when using Wayland or X. In X, when I run xrandr --listproviders it finds only the laptop's adapter Is there anything else I should do to configure this? Should I try with a different distro? Thanks a lot for your help! |
I forgot to mention that sometimes the laptop is not able to detect the usb device properly. When this happens lsusb takes a long time and doesn't show the OpenMoko device and I see this in the logs:
|
Looks like the driver isn't loaded, you're missing this:
Check if the module is available:
You could try loading the module manually:
The timeouts (-110) you're getting could be due to rebooting host or gadget while connected. I've had this problem myself but haven't had time to look into it so I just disconnect the cable before rebooting. I assume that you power the Pi through the power port as well and not only from the host port. |
The module is not present in the kernel I'm using.
According to the Fedora Vanilla Repositories FAQ the mainline kernels use basically the same configuration as the Fedora rawhide kernels. Maybe a few staging drivers might get turned on to help their development, but apart from it the plan is to stick closely to what Fedora does. I think I'll have to ask them to add the module or compile the kernel myself...
I've tried both ways but usually just the host port. I'll will connect both of them always now Thanks again for your help. I'll keep you informed! |
I have checked this and it's actually not recommended to power it from 2 sources: Using Both PWR and USB in OTG Mode on the Pi Zero I have always done that when experimenting, but maybe I've been lucky not frying anything. |
Some can. I absolutely love this project, and have noticed that there hasn't been much action on it for several months. It would be great to see something make it upstream! |
Wrt power, I have on my todo list to measure how much power the Pi4 actually needs for this use case. The Pi zero seems to use less than 100mA judging by a quick google search.
Ufortunately I've been ill for the past months so I haven't been able to work on it. Lately I've had some "good periods" that I use to address the review comments I got on the version 3 of the patchset. No idea when I'm done with that though. |
I hope you will recover soon. I'll totally understand if you can't answer my noob questions ... I thought this patch was already mainlined in the 5.9 kernel. That's why it didn't appear on my machine. According to this doc, it should be "easy" to compile an out of tree kernel in fedora, but downloading the patch from the mailing list is like black magic to me. Could you add the code to this repo so I can just git clone and try to compile it using the above fedora document or something like this from Stack Overflow Thanks again! Take care |
The patch is available here: https://patchwork.freedesktop.org/patch/367673/mbox/ |
I applied the patch to the kernel source, modifed the makefile for in place compilation, pulled gud_drm.h into the directory and made gud_drm_connector.c and gud_drm_drv.c use it (next time I would just take them from the patch itself instead of applying it since the relevant changes are all new files). Here's my fork with the module (untested beyond "compiles and doesn't crash my machine" ). |
Now that Fedora 32 has kernel 5.9.8 and using @solarkraft 's approach I've been able to compile the kernel, load it and test the usb device. With GNOME on Wayland, the external screen is detected in the Settings > Displays but no matter what setting I choose (using both screens side to side, mirror screen or just the external screen) the external display shows nothing. It's on but It looks like is just showing black pixels When changing the external display resolution it shows that it's doing it, but the screen is still black When using both screens side to side, the mouse pointer disappears when it "goes" to the side where the external display is supposed to be, but it's not shown. I see this in the logs when trying to use the external display. The line "MESA-LOADER: failed to open gud_drm (search paths /usr/lib64/dri)" looks suspicious, maybe I forgot to do something
These are the steps I've followed on Fedora 32:
|
These are the relevant entries:
(gud_drm prints the flushing failure error only once to avoid trashing the log) -11 is -EAGAIN, but I don't know which function it is that actually returns it. The swiotbl error is printed in swiotlb_tbl_map_single(). AFAIU swiotbl is used when the device can't access the buffer using DMA. In that case it uses a "bounce" buffer to copy to/from so the device can reach it. This is ofc slow due to the memcpy. You could try this change and see if a smaller transfer buffer (512k) works (the framebuffer will be split up into smaller parts): static int gud_drm_probe(struct usb_interface *interface,
const struct usb_device_id *id)
- max_buffer_size = 1 << desc.bMaxBufferSizeOrder;
+ max_buffer_size = 512 * 1024; |
I'm trilled to say that the change worked and now my external display is finally working!!!! Thank you very much for your support all this weeks In the end I had to put The performance is correct with my 1900x1200 24 inches monitor. The mouse is slightly slow but usable. It helped to change the desktop background from a stock gnome photo to an image with a solid colour. Now the only issue I have is what I wrote in a previous comment, when I reboot the laptop or the gadget very often it fails with this error:
Could it be that the raspberry pi driver is not loaded in the raspberry zero fast enough? The solution I've found is to unplug the raspberry pi, shut down the computer and wait for a 5 or more minutes. It normally works this way. If you wait just a minute it doesn't work Anyway, thanks again for your help and patience :-) |
I'm glad you could make it work! Wrt swiotbl, it's possible to configure it using the There is a serial console on the USB interface that will give you access to the gadget and the kernel log (username is root). Here are some notes that I haven't put on the wiki yet: Debug consolescreen can be used to attach to the console:
Kill session: Prevent ModemManager from capturing /dev/ttyACM0 (on the host)One off, just stop it (or disable if not needed):
|
Scratch that, there's no USB serial console when it can't start the gadget... You can however turn on output of kernel messages to the monitor by editing Change these:
and add these (all arguments on one line):
There is also a serial console available on the header as is usual on the Pi. |
Hi. I've been using your driver (v3) since November daily and it works very well, at least for my usage (software developer). Even sharing my screen on video conferences or resuming from suspend. The mouse has a little lag but I got used to it and when I want to watch a video I drag the browser to the laptop's display. Performance is better when using a solid image as desktop background, at least in my setup (Pi Zero with USB 2.0). I tried using the I also still have the problem mentioned in a comment before but when It happens I just unplug the pi zero for a few minutes and plug it again to the laptop to make it work again. I use this script to load the driver and automatically build it if there is a kernel update:
Usage: I'm happy it's going to be mainline in kernel 5.13 so it will be much easier to use for everyone. Thanks a lot again for your work! |
Thanks for reporting back, it's nice to hear that it's stable for daily use. |
First of all thanks for creating this project. I'm very interested in trying it because my laptop (Macbook Pro 2011 with Fedora 32) has a faulty discrete AMD card and I've managed to keep it as my main computer forcing the use of the integrated card (Intel). The problem is that I cannot use an external display because the display port doesn't work.
I would like to try your solution to be able to use the laptop (it has usb 2 ports) with an external 1920x1200 display and an spare Raspberry Pi 3 Model B that I have at home. I need it mainly for web browsing and programming.
I understand from the wiki that I have to boot the raspberry pi with one of the provided images. Which one would be better for the rapberry pi 3?
How can I install and configure your driver on Fedora (Gnome on Wayland) so the computer can use the external display? I'm not too familiar with compiling the kernel. I think last time I did it was more that 15 years ago...
And last question: how are the two computers connected? From one of the laptop's usb connectors to the raspberry's micro-usb? I thought the raspberry micro-usb was just for powering it, not for transferring data
Thanks a lot for your work!
The text was updated successfully, but these errors were encountered: