qbancoffee / imac_g3_ivad_board_init

iMac G3 IVAD board initialization with an arduino
GNU Lesser General Public License v3.0
146 stars 14 forks source link

Emac with just a Pi4 #8

Closed earthwormjim-uk closed 3 years ago

earthwormjim-uk commented 3 years ago

Have been inspired to try this with an Emac and a Pi4 (no arduino). VGA cable is made and i2cdetect is reporting 46 and 53, as expected. Looking at the emac_ivad_board_init for the arduino and contemplating next steps, any suggestions or pointers? Thanks!

qbancoffee commented 3 years ago

Sorry, I missed this message.

Wow, I hope you get it to work and please share what you've learned. The sending of the initialization string is very similar for both the eMac and the iMac so you might just need to modify the python script that runs from the pi and be good to go. using the iMac without an arduino is possible and here is a link to the video if you haven't seen it. https://youtu.be/isjo-4vQxwM

it's in the root and it's called "init_ivad.py"

You should only need to edit the config.txt and add the following at the bottom. hdmi_group=2hdmi_ignore_edid=0xa5000080#hdmi_mode=1#hdmi_mode=87hdmi_cvt=1152 864 80 1

good luck!

earthwormjim-uk commented 3 years ago

Thanks for replying. what you have described is exactly the approach I've taken, which gives me encouragement that I can get it to work. The CRT is making all the right sounds so I think I'm close, probably just missing something. When I get it going I'll share the script, Cheers!

earthwormjim-uk commented 3 years ago

Small update, it's now working and usable at the CLI but needs more work - the screen geometry and settings aren't great, and there is screen flickering in retroarch / retropie. Maybe need some specific retroarch.cfg settings?

qbancoffee commented 3 years ago

Most of the changes I made were in the config.txt and I don't remember making changes in retroarch. Are you supplying the custom monitor settings or are you loading the edid.dat in the repo? Are you using the sample config.txt file? Can you include a picture of how the image looks?

Great progress!

earthwormjim-uk commented 3 years ago

Pictures below. I'm trying to understand exactly how the config.txt works. It seems that if I set ignore_edid, then it even ignores the manually specified edid.dat file, is that as expected? it's not how I read the documentation. I'm getting interesting results by creating my own edid.dat files but nothing I'm completely happy with. The edid in the emac repo not working for me.

IMG_20210616_121333 IMG_20210616_122555

qbancoffee commented 3 years ago

You've made really good progress! Generally I've found the documentation to be pretty good when it comes to the raspberry pi 3 however, I can't say the same for the raspberry pi 4.

That said, I have found that the edid bit in the documentation works as documented. You've probably seen this already but to use the edid file you need the following lines with your filename provided.

hdmi_edid_file=1 hdmi_edid_filename:0=FileForPortZero.edid hdmi_edid_filename:1=FileForPortOne.edid

It looks like you're trying to fill the whole screen. Is that why you're unhappy with your results? This part really frustrated me because I couldn't fill the whole screen without some sort of distortion at the edges and to my chagrin it seemed like Apple never intended it to be filled either.

Look for eMac pictures and you'll see that there is usually a 1 inch black border around the image.

earthwormjim-uk commented 3 years ago

Thanks, couldn't have done this without the great work done by yourself and pedropena. I may be being optimistic but I think it should be possible to get better output. I created some custom edid files but they didn't seem to work so reconnected the emac logic board and dumped the edid, so I have a the edid used by OSX. Checking it with edid-decode it is valid and has the expected values in it, however unfortunately edidparser concludes that only DVI is supported and the max resolution is 1024x768. If I use this and disable the v3d driver in config.txt I get a really good output, no borders, no flickering (see below), but only up to 1024x768 :-( I'd like to retain the v3d driver and get higher res, getting a good edid.dat as suggested by pedropena might do it. IMG_20210618_111844

qbancoffee commented 3 years ago

I'm not home at the moment but when I get back home I think I can help you out with an EDID that can get you a higher resolution. That said, you results are fantastic!

earthwormjim-uk commented 3 years ago

thanks, hope your getting some holiday time! small update from some more experimenting over the weekend - looking at the edid dumped from the emac in an editor and comparing with another, I've changed my mind - I don't think the edid is the answer, and I don't think it's possible to create a good edid for this? The CRT settings just don't match any of the standard or preferred settings for an edid. Instead I've used the edid to derive the complete monitor timings and put those in the config file using hdmi_timings=. This looks (almost) great at 1280x960, but doesn't work for 1024x768 for reasons I don't understand. The 'almost' is that although geometry and resolution are near perfect, there are small but irritating screen artefacts (speckles), again for reasons unknown. I'm hoping that this isn't due a limitation of the pi implementation of hdmi_timings, which seems to only cope with whole number horizontal refresh rates. any thoughts on that? I will upload some code and scripts when I get it fine tuned. The pic doesn't do it justice but; IMG_20210621_135842

qbancoffee commented 3 years ago

Thanks, tons of fun in the sun!

Great results and I know what you mean by the pic doesn't do it justice, I went through the same thing... You are correct that the res and refresh rates are not vesa standards but you can specify custom timings in an edid file and using an edid editor, I was able to create a custom edid using aw edid editor, by analog way, I think....

I was also able to create a custom timing that worked well with a pi 2 and a pi 3. Regarding the annoying sparklies, I noticed that was an issue only when I used a VGA cable longer than about one foot and that didn't have a ferrite choke.

I'll look through my files when I get home because clearly I forgot to put some things in the repo.

Great progress!

earthwormjim-uk commented 3 years ago

Interesting, I also used AWEdidEditor and started with the edid dumped from the (OSx) eMac. I found that the piemac looked at the edid and didn't see anything it liked, so went with a less-than-optimum default (according to tvservice at least).
I've also looked at CRU, which is nice utility but didn't give me any more than AWEdidEditor did. Using a pi4 I suspect is part of the problem, a different GPU means some of the sw implementations maybe are still not ironed out? If I could just lose the speckles / artefacts it would be great, but I'm struggling with that. The cable is only 6/7 inches long, and now has 3 ferrite cores on it! I still think it's a sw issue, currently experimenting with fbset, and vcgencmd, both of which give inconsistent results as well and haven't solved the artefacts. Learning lots, but not sure what else to try - more ferrite cores? :-D

earthwormjim-uk commented 3 years ago

Fixed the artefacts this evening after not touching this for a couple of weeks, it now looks really good, just tinkering with the hex values to get the best out of it, I'll upload some code for the emac, can I add into this repo? let me know and I'll close this issue off, thanks for all help and encouragement.

qbancoffee commented 3 years ago

glad to hear you have a clean picture now! The best way to add to the repo is by forking it and making changes to your fork. You can then submit a pull request and I'll go over the changes and merge them to the main branch making sure there is a history of where it came from and so on and so forth. If you're not familiar with git then it seem like it's more work than it's worth in which case you can send it to me and add it to the repo and properly credit you somewhere.

earthwormjim-uk commented 3 years ago

Yeah happy to use git, expect a pull request at some point, thanks.