thirtythreeforty / businesscard-linux

A Buildroot distribution small enough to run on my business card
https://www.thirtythreeforty.net/posts/2019/12/my-business-card-runs-linux/
1.81k stars 187 forks source link

TV Out for the business card? #13

Open AndersBNielsen opened 4 years ago

AndersBNielsen commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

I’m basically asking you about the driver XD

I hear “they” got it working with another Allwinner on Armbian. I can’t really figure out if the tool I mentioned is a driver or just a tool to fix overscan. Haven’t had the time to check out the source yet.

On Wed, 22 Jan 2020 at 17.14, George Hilliard notifications@github.com wrote:

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?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thirtythreeforty/businesscard-linux/issues/13?email_source=notifications&email_token=AB2SHIR7M45IZDJOW76QD6TQ7BWFDA5CNFSM4KKB67G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJUFH7Q#issuecomment-577262590, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2SHIU7UOPOV6FN72MJ4OLQ7BWFDANCNFSM4KKB67GQ .

thirtythreeforty commented 4 years ago

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

AndersBNielsen commented 4 years ago

The first thing I did when I got the Nano was to replace the firmware with this(didn’t even dump it) so I have no clue. I bet I can find it and check it out though.

On Wed, 22 Jan 2020 at 17.29, George Hilliard notifications@github.com wrote:

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thirtythreeforty/businesscard-linux/issues/13?email_source=notifications&email_token=AB2SHIQCUMGUIIL5LQI2JU3Q7BX5ZA5CNFSM4KKB67G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJUHADA#issuecomment-577269772, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2SHIVSSM3YZJTFGXN2Y6DQ7BX5ZANCNFSM4KKB67GQ .

sorry-i-am-late commented 4 years ago

https://twitter.com/Claude1079/status/1168167016269848577 some guy on the internet.

On Wed, Jan 22, 2020 at 11:16 AM AndersBNielsen notifications@github.com wrote:

The first thing I did when I got the Nano was to replace the firmware with this(didn’t even dump it) so I have no clue. I bet I can find it and check it out though.

On Wed, 22 Jan 2020 at 17.29, George Hilliard notifications@github.com wrote:

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/thirtythreeforty/businesscard-linux/issues/13?email_source=notifications&email_token=AB2SHIQCUMGUIIL5LQI2JU3Q7BX5ZA5CNFSM4KKB67G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJUHADA#issuecomment-577269772 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AB2SHIVSSM3YZJTFGXN2Y6DQ7BX5ZANCNFSM4KKB67GQ

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/thirtythreeforty/businesscard-linux/issues/13?email_source=notifications&email_token=ANZ33ELRAFDYOWG234Y32QTQ7B5QJA5CNFSM4KKB67G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJUMJ4Y#issuecomment-577291507, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANZ33EPW34VTCMF3DATUNIDQ7B5QJANCNFSM4KKB67GQ .

AndersBNielsen commented 4 years ago

Three months late-ish :) But wow - an FPGA seems to defeat the point.

I see in the docs sipeed offers a VGA-adapter so that should work too - without the FPGA... still a bit more bulky than just TV-out + GND broken out.

https://github.com/Lichee-Pi/linux

Can you identify if they have a composite driver in there? ^^

On Wed, 22 Jan 2020 at 19.07, sorry-i-am-late notifications@github.com wrote:

https://twitter.com/Claude1079/status/1168167016269848577 some guy on the internet.

On Wed, Jan 22, 2020 at 11:16 AM AndersBNielsen notifications@github.com wrote:

The first thing I did when I got the Nano was to replace the firmware with this(didn’t even dump it) so I have no clue. I bet I can find it and check it out though.

On Wed, 22 Jan 2020 at 17.29, George Hilliard notifications@github.com wrote:

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/thirtythreeforty/businesscard-linux/issues/13?email_source=notifications&email_token=AB2SHIQCUMGUIIL5LQI2JU3Q7BX5ZA5CNFSM4KKB67G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJUHADA#issuecomment-577269772

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AB2SHIVSSM3YZJTFGXN2Y6DQ7BX5ZANCNFSM4KKB67GQ

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/thirtythreeforty/businesscard-linux/issues/13?email_source=notifications&email_token=ANZ33ELRAFDYOWG234Y32QTQ7B5QJA5CNFSM4KKB67G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJUMJ4Y#issuecomment-577291507 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ANZ33EPW34VTCMF3DATUNIDQ7B5QJANCNFSM4KKB67GQ

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thirtythreeforty/businesscard-linux/issues/13?email_source=notifications&email_token=AB2SHIRGH53FIHJ7WJVS36DQ7CDNHA5CNFSM4KKB67G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJURRTY#issuecomment-577312975, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2SHIRBLTG5NJIGCJTAWJ3Q7CDNHANCNFSM4KKB67GQ .

AndersBNielsen commented 4 years ago

Is this what we’re looking for here?

https://github.com/BPI-SINOVOIP/BPI-M2U-bsp/tree/master/linux-sunxi/drivers/video/sunxi/disp2/tv

Never added a driver to compile with buildroot so I have no idea how :/

On Wed, 22 Jan 2020 at 19.41, Anders Nielsen forstuvning@gmail.com wrote:

Three months late-ish :) But wow - an FPGA seems to defeat the point.

I see in the docs sipeed offers a VGA-adapter so that should work too - without the FPGA... still a bit more bulky than just TV-out + GND broken out.

https://github.com/Lichee-Pi/linux

Can you identify if they have a composite driver in there? ^^

On Wed, 22 Jan 2020 at 19.07, sorry-i-am-late notifications@github.com wrote:

https://twitter.com/Claude1079/status/1168167016269848577 some guy on the internet.

On Wed, Jan 22, 2020 at 11:16 AM AndersBNielsen <notifications@github.com

wrote:

The first thing I did when I got the Nano was to replace the firmware with this(didn’t even dump it) so I have no clue. I bet I can find it and check it out though.

On Wed, 22 Jan 2020 at 17.29, George Hilliard <notifications@github.com

wrote:

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/thirtythreeforty/businesscard-linux/issues/13?email_source=notifications&email_token=AB2SHIQCUMGUIIL5LQI2JU3Q7BX5ZA5CNFSM4KKB67G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJUHADA#issuecomment-577269772

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AB2SHIVSSM3YZJTFGXN2Y6DQ7BX5ZANCNFSM4KKB67GQ

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/thirtythreeforty/businesscard-linux/issues/13?email_source=notifications&email_token=ANZ33ELRAFDYOWG234Y32QTQ7B5QJA5CNFSM4KKB67G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJUMJ4Y#issuecomment-577291507 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ANZ33EPW34VTCMF3DATUNIDQ7B5QJANCNFSM4KKB67GQ

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thirtythreeforty/businesscard-linux/issues/13?email_source=notifications&email_token=AB2SHIRGH53FIHJ7WJVS36DQ7CDNHA5CNFSM4KKB67G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJURRTY#issuecomment-577312975, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2SHIRBLTG5NJIGCJTAWJ3Q7CDNHANCNFSM4KKB67GQ .

thirtythreeforty commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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