Clicky

Cursed Journey of Getting a Monitor to Work

Isn’t it a shame that this place of the internet is supposed to be a blog yet doesn’t contain blogs but obscure philosophies?

Reallocated in my family home again, a colleague told me that he knows somebody that is able to provide me a nice frameless-touchscreen 23.80 inches monitor for a very low price, comparable to the average prices here due to customs, it’s pretty low; so he just exports it for personal use and sell it for profit. Fair enough, I said. So I went there, tested the monitor, everything looks great.

I already have a secondary as mentioned, it’s plugged through the only HDMI port into my laptop, “Where will I plug the new one?” I asked, “Hmmm I don’t know, but since it’s just about data transfer through an external port like USB-C or something” my internal voice responded. (No need to mention that I didn’t know that I can use dock and solve this whole issue, I’m a relatively uncivilized third-world human and I never knew such a thing existed), I was left was the following thoughts;

First Try; HDMI Splitter

Worked fine but there is one main issue, it doesn’t plug a second monitor to your machine the but it plugs a new monitor to the monitor plugged in your machine. I.e. it will send the signal for both of them, just like an old fashion DSL splitter.

2023-01-23_06-47-11_screenshot.png

Second Try; USB-C

Like my head voice suggested the first thing that came out to my mind is using Type-C USB converter, it’s pretty fast and Apple already did that before with Mac books, and the monitor is modern enough to be compatible with this setup. I ordered “USB31_C_HDMI_ADP”, three days later it was delivered. Never worked, not even given a single sign that it’s going to work, after some investigation found out that my machine USB-C specification said “that’s simply not possible”.

Connect to an external storage, or data devices. Note: An appropriate adapter may be needed for connecting external devices. This connector cannot be used to connect external display devices

Third Try; USB-A

After while I learned that using DisplayLink is possible, yet I couldn’t find a way to purchase a one without paying +$100 for customs. So I had to use a USB-A converter that uses the manufacturers’ firmware (which implies, of course, my machine have to be compatible with those firmware). Again, I purchased a USB-A converter “MACROSILICON Display Adapter”.

After I plugged it into my machine, reading dmesg I noticed that it’s being linked to /sys/bus/usb/drivers/snd-usb-audio/, which means that it’s being treated as a USB audio device. So I had to force it to unbind this, using this udevadm role:

# For HDMI-to-USB adaptor:
SUBSYSTEM=="usb", DRIVER=="snd-usb-audio", ATTRS{idProduct}=="2109", ATTRS{idVendor}=="534d", \
    RUN+="/bin/sh -c 'echo -n $kernel > /sys/bus/usb/drivers/snd-usb-audio/unbind'"

After this amount of work I found out that this piece should be used for USB video device class like webcams, digital camcorders, transcoders, analog video converters and still-image cameras, etc..

So, getting this to work was in vain.

Fourth Try; USB-A (Right Piece)

I found an abscure company called Fresco Logic that develops this kind of solution with claimed Linux/Android driver support, and that’s the other story.

Linux Driver

It sounds like the so-called driver that fresco logic developed was disconnected since 2021, I use the latest 6.1.7 kernel which means this will never compile, note that you have to build it yourself since it uses your linux-headers toolchain to build, so at least you need to use a build that matches your current kernel, otherwise you will get invalid object message.

Another is story is me trying to downgrade the Kernel to 5.6 to get this to work, but we shall not proceed into this for now, a plot-twist is even after swapping to 5.6 it didn’t compile. “So why not go through the code, update the APIs and get it to work for you?”, I’d have you to look at the code first my dear;

2023-01-23_07-06-11_screenshot.png

Anyway, I tried 5.7, 5.5, 5.8, 5.15, and eventually 5.10 worked (no idea of how). So now it compiled, how to use it? Plot-twist 2: it is not a driver, it’s a prototype proof of concept that this piece can be used in linux, but no DRM available.

Meanwhile.. Windows A ubiquitous advantage for Windows that is commonly mentioned in these situations that it ’just works’. So I installed Windows to give it a try, sadly it was right.

2023-01-23_07-10-32_screenshot.png

After working 12 hours on it I was able to get a basic DRM to work for it, it’s a little buggy but at least it does the job.

Final Results

The DRM I coded was very insecure unfortunately and I couldn’t risk depending on it, when I was completely desperate an idea came to my mind reminding me that I had an old unused laptop with Windows installed, I could use it connected to the monitor and connect it with barrier to my main laptop, so it feels like it is just another monitor (with restricted filesystem access lol). Unexpectedly it worked:

2023-01-23_07-33-42_screenshot.png

This experience raised some questions to my head about the reliability of LKMs, the Windows driver efficiently works in like all Windows versions (each has many different build versions), and due to kernel APIs change in linux-headers it can not work after any related kernel patches, could that be the reason that the NVIDIA drivers have too frequent updates in Linux compared to Windows? To make sure it will work? I don’t know I’m not a kernel engineer, but really this experience could be much pleasant than that easily.


I seek refuge in God, from Satan the rejected. Generated by: Emacs 29.4 (Org mode 9.6.17). Written by: Salih Muhammed, by the date of: 2023-01-23 Mon 17:14. Last build date: 2024-07-04 Thu 21:55.