Skip to content
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

TV Out for the business card? #13

Open
AndersBNielsen opened this issue Jan 22, 2020 · 26 comments
Open

TV Out for the business card? #13

AndersBNielsen opened this issue Jan 22, 2020 · 26 comments

Comments

@AndersBNielsen
Copy link

Obviously I'm thoroughly addicted to playing Rogue on businesscard-linux by now - not even kidding.
I'm just left with a feeling it's wrong to connect to it with another computer when it technically has the capability to run everything on it's own.

Connecting an LCD requires a minimum of an additional backlight-circuit and LCD-connector which increases the BOM significantly (for a business card) - and for the displays I have lying around it also needs a TFT power supply circuit like the TPS65120.

But what about TV-out/CVBS - isn't that just a matter of breaking out the pins and throwing on an RCA-cable?

Also, what's needed to enable TV-out as a framebuffer device/screen in linux?
I see there's an "Allwinner Composite Configuration Tool" that might make things easier, but I have no idea if it just works out of the box?

"My business card runs Doom" doesn't sound that bad either ;-)

@thirtythreeforty
Copy link
Owner

Dude I almost got Doom running on it as is and I was seriously bummed that I couldn't have an "Of course it runs Doom" section of my write-up. Doom didn't like X11 forwarding...

That could work. I need to play with it. Does the TV out peripheral have a Linux driver?

@AndersBNielsen
Copy link
Author

AndersBNielsen commented Jan 22, 2020 via email

@thirtythreeforty
Copy link
Owner

Ah, gotcha. I will dig and see. Certainly you could put together a demo on the Nano if the driver support is there.

@AndersBNielsen
Copy link
Author

AndersBNielsen commented Jan 22, 2020 via email

@sorry-i-am-late
Copy link

sorry-i-am-late commented Jan 22, 2020 via email

@AndersBNielsen
Copy link
Author

AndersBNielsen commented Jan 22, 2020 via email

@AndersBNielsen
Copy link
Author

AndersBNielsen commented Jan 23, 2020 via email

@thirtythreeforty
Copy link
Owner

thirtythreeforty commented Jan 23, 2020

That is a driver, but it looks like it is coded against Linux 3.10, so it's unlikely to work with the mainline kernel (the kernel has no stable internal API).

There's a driver in the mainline kernel for something graphics related at drivers/gpu/drm/sun4i/ but I don't know if that applies to the TV peripheral. Given the tool mentioned above (and of course the reference manual), it should be possible to write a driver. I will do some research when I have the time.

@AndersBNielsen
Copy link
Author

AndersBNielsen commented Jan 23, 2020

https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/sun4i/sun4i_tv.c

This should be it - not sure if it only works for the A10 though.

Also - there seems to be "something" in uboot as well.

@AndersBNielsen
Copy link
Author

It seems the linux-sunxi guys didnt get any graphics working on mainline with F1C100S
https://linux-sunxi.org/Linux_mainlining_effort

hmmm... Either way I will solder on an RCA-cable and see what happens. I think I'm stuck for now if dmesg doesn't output anything interesting when I plug it in.

@thirtythreeforty
Copy link
Owner

True, although not much attention is usually paid to the F1C100s (until lately)... If the F1C100s TV peripheral is in the sun4i family, it should be supportable with a small amount of work on the driver.

@Nybo
Copy link

Nybo commented Feb 12, 2020

Hi George and Anders,
I am working on getting a cheap SPI display working on the Lichee Nano using the fbtft driver.
I found a 240x240 pixel st7789v display for 9¥on Taobao.
Do you think that would run Doom ? :)

@thirtythreeforty
Copy link
Owner

I sincerely hope so! There is enough CPU to run it for sure. The main obstacle would be ensuring Doom can draw to the framebuffer - I imagine it can, no problem

@AndersBNielsen
Copy link
Author

Currently I'm still waiting for 4,2" and 5" TFT's(800x480 and 480x272) from Asia - things are always slow this time of year but I suppose this year even more so. SPI flash should be easier - would love to see what you get out of it.

In the mean time I tried the stock image to see if I could get a better understanding of the SoC-specific features - I was met with the JEDEC ID bytes issue though, so somebody must've thought it was a great idea to shave a few cents off using the actual Winbond flash, breaking all the stock images in the process.
And of course there's no source available.

When I have the time I will try the SD card image instead and just maybe the TV-out will work with the old kernel and tell me which drivers it's using and if there are any tricks to it.

@thirtythreeforty
Copy link
Owner

I encountered a branch of @Icenowy's kernel that appeared to support the display peripheral:

https://github.com/Icenowy/linux/tree/f1c100s-480272lcd-test

As I did not need it for my project, I did not test it. However, I would imagine that that is what your mystery image is compiled from. I don't remember the difference between that branch and the other branch that I worked from (although both commit logs mention LCD things):

https://github.com/Icenowy/linux/tree/f1c100s

@Nybo
Copy link

Nybo commented Mar 13, 2020

I managed to get chocolate-doom running on the F1C100s :)
First I had to use fbtft driver from 5.4 kernel, since it is broken in previous versions.
Then I had to get a 320x240 display instead of 240x240, since 240x240 is just too small for doom :)
The 320x240 is 2 inches and costs about 2$

For the next step I will add some buttons, so I can actually control the game, and a speaker ofcourse. After that maybe ESP8089 for multiplayer :)

Do you know if there are working drivers for the keyadc, headphone output or esp8089?

@thirtythreeforty
Copy link
Owner

Awesome! There is an out-of-tree driver for esp8089: https://github.com/al177/esp8089

I don't know about keyadc or headphones, but I'd be willing to bet they're close cousins of the sun4i peripherals.

@AndersBNielsen
Copy link
Author

I managed to get chocolate-doom running on the F1C100s :)
First I had to use fbtft driver from 5.4 kernel, since it is broken in previous versions.
Then I had to get a 320x240 display instead of 240x240, since 240x240 is just too small for doom :)
The 320x240 is 2 inches and costs about 2$

For the next step I will add some buttons, so I can actually control the game, and a speaker ofcourse. After that maybe ESP8089 for multiplayer :)

Do you know if there are working drivers for the keyadc, headphone output or esp8089?

I finally got myself a 7" 800x480 LCD and would like to try it out but I'm a little bit over my head with kernel modification.
What's the easiest way to fetch and compile in the fbtft driver from the 5.4 kernel? How do I configure resolution etc?
Does uboot support tft's like these?

@thirtythreeforty
Copy link
Owner

In Buildroot, make linux-menuconfig will open Kconfig for the kernel. Modify, save, and exit to update the kernel's working config.

In principle U-Boot supports TFTs, but in practice I doubt they work on the F1C100s because drivers.

@AndersBNielsen
Copy link
Author

Uboot seems to support TFT's - that's how I verified my tft works. With the stock image(from 2018) it actually gave me a nice little Tux and uboot version. Nothing else though - probably because it can't boot from the off brand flash.

I'll see if I can figure out how to get the 5.4 fbtft driver into this build.

@Nybo
Copy link

Nybo commented Mar 29, 2020

The fbtft drivers are only for small SPI based displays, so it wont work for a parallel RGB display.
I also tried getting a 800x480 RGB display up and running, but without success.
I used the settings from suniv-f1c100s-licheepi-nano-with-lcd.dts, but I could never get the kernel configured for it to work. Maybe some drivers are missing from mainline?

@AndersBNielsen
Copy link
Author

I will try the licheepi nano image on an SD card, since it doesn't boot with my spi flash. Maybe I can at least figure out which driver it is actually using.
It frustrates me a little bit that graphics work in uboot from the stock image but I can't get it to output anything at all.

@wb7odyfred
Copy link

F1C100s & F1C200s Board with LCD and TVout RCA connector

Here is a board one could test out several ideas and interfaces of the F1C100s chip.

I can't read the Chinese documentation on this TaoBao website, so don't know details to share here. I was looking for a PCB that supported TVout and this seems to fit my needs. I wanted to see if I could play 1/4 VGA (320x240) videos on standard television. What would you do with this board and LCD? Please share your ideas. Fred

@Mr-Bossman
Copy link

if u wana take a look at my repo i have and 8080 lcd working and audio i was trying to get compisite video working but i desided that i dont have enough knowlage in that department and was going to leave it to others. if people want scematics for how i got the lcd and audio working i will gladly post them i dont exactly understand how video drivers in linux work so i made it in userland by maping the memory. i also got usb working. most of the working demos with composite use melis os or the modified kernel for allwiner chips

@Mr-Bossman
Copy link

the composite video controller thing has an auto detect feture to detect when a compoite tv is conected i compiled the kernel with the allwinner a10 (i think that one) composite video driver mapped to the memory of the f1c200s's it didnt detect the compostie tv i
looked at the memory dump before and after pluging it in im not sure if i did the device tree corectly but it did metion that it was enabled in dmesg. it may have a circut that needs to go with it but i havent found any examples. it also may need to be set up in uboot like they did with the curent lcd config ( witch doesnt make any sence) if any one finds any information on the composite video that would be amasing and try and post it in relavent forums or here. unfortunatly with the banin of alot of chinese websites its going to be even harder to find info about this

@Mr-Bossman
Copy link

you can also make somthing like this https://olimex.wordpress.com/2012/06/12/low-cost-lcd-to-vga-adapter/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants