randyrossi / bmc64

A bare metal Commodore 64 emulator for the Raspberry Pi with true 50hz/60hz smooth scrolling, low input latency and better audio/video sync.
GNU General Public License v3.0
474 stars 56 forks source link

Supported sync on DSI connected screen #253

Open penrodyn opened 8 months ago

penrodyn commented 8 months ago

Hi I've connected a Waveshare 4.3" screen (800x480) via the DSI port of my pi 3b and although I get a picture everything runs a lot slower. I have tried creating a customer display setting, running the calculator, amending machines.txt and then selecting that custom mode but it appears to maken no difference. Are these customisations available for the DSI port or is it only HDMI. I've tried the same pi and screen with vice on Retropie and the issue is gone but is rather stick with bmc64. I'm guessing this is a sync issue and bmc is waiting for the screen whereas retropie doesn't bother. Any help much appreciated.

randyrossi commented 8 months ago

It does sound like a sync issue. When you say 'DSI' port, you are referring to the ribbon cable connector? I don't think I've ever tried that type of display. In fact, you might be the first ever to try it. I didn't even think you would get a picture that way. BMC64 waits for the vertical sync for each frame. I wonder if connecting that type of display puts extra load on the GPU and that's the reason for the slowdown. Have you tried disabling the shader? Let me know if that makes a difference.

On Sat, Nov 11, 2023 at 4:05 AM penrodyn @.***> wrote:

Hi I've connected a Waveshare 4.3" screen (800x480) via the DSI port of my pi 3b and although I get a picture everything runs a lot slower. I have tried creating a customer display setting, running the calculator, amending machines.txt and then selecting that custom mode but it appears to maken no difference. Are these customisations available for the DSI port or is it only HDMI. I've tried the same pi and screen with vice on Retropie and the issue is gone but is rather stick with bmc64. I'm guessing this is a sync issue and bmc is waiting for the screen whereas retropie doesn't bother. Any help much appreciated.

— Reply to this email directly, view it on GitHub https://github.com/randyrossi/bmc64/issues/253, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI3HKAE7OQXMP7XLECKNE3YD45UVAVCNFSM6AAAAAA7HDXJ3WVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4DQOBVGIZDINA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Randy Rossi

penrodyn commented 8 months ago

Hi Randy Thanks for the reply - it's much appreciated. As I'd previously used this install on a TV and been playing with the settings I decided to start again with a fresh install and ensure first boot is on DSI/Ribbon Cable. This was with the default resolution etc PAL/50Mhz and no slow downs!

However game music sounds way too quick, maybe 50% quicker but I don't think the games themselves are running overly quick. So, assuming this was a timing issue I added the custom resolution to Config.txt, booted and ran the calculator, which returned;

Ntsc-custom 1026554 60.050000 I am confused by the NTSC, does this mean my screen doesn't support PAL?

Anyhow I created two entries in machine.txt (see below), both look great display wise and no-slow downs but sound is still sped up!  Really confused!

@.disable_overscan=1hdmi_cvt=800 480 50 3 0 0 0sdtv_mode=18hdmi_group=2hdmi_mode=87machine_timing=ntsc-customcycles_per_second=1026554 @.disable_overscan=1hdmi_cvt=800 480 50 3 0 0 0sdtv_mode=18hdmi_group=2hdmi_mode=87machine_timing=pal-custom ThanksLeecycles_per_second=1026554

On Saturday, 11 November 2023 at 18:52:58 GMT, randyrossi ***@***.***> wrote:  

It does sound like a sync issue. When you say 'DSI' port, you are referring to the ribbon cable connector? I don't think I've ever tried that type of display. In fact, you might be the first ever to try it. I didn't even think you would get a picture that way. BMC64 waits for the vertical sync for each frame. I wonder if connecting that type of display puts extra load on the GPU and that's the reason for the slowdown. Have you tried disabling the shader? Let me know if that makes a difference.

On Sat, Nov 11, 2023 at 4:05 AM penrodyn @.***> wrote:

Hi I've connected a Waveshare 4.3" screen (800x480) via the DSI port of my pi 3b and although I get a picture everything runs a lot slower. I have tried creating a customer display setting, running the calculator, amending machines.txt and then selecting that custom mode but it appears to maken no difference. Are these customisations available for the DSI port or is it only HDMI. I've tried the same pi and screen with vice on Retropie and the issue is gone but is rather stick with bmc64. I'm guessing this is a sync issue and bmc is waiting for the screen whereas retropie doesn't bother. Any help much appreciated.

— Reply to this email directly, view it on GitHub https://github.com/randyrossi/bmc64/issues/253, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI3HKAE7OQXMP7XLECKNE3YD45UVAVCNFSM6AAAAAA7HDXJ3WVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4DQOBVGIZDINA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Randy Rossi

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

randyrossi commented 7 months ago

It's been a while since I configured custom modes. But both NTSC and PAL settings don't make sense for different reasons though:

For NTSC, you should be specifying 60hz (3rd parameter). For PAL, you want the cycles_per_second to be close to 985257. But you have an NTSC clock there. Is that what the calc reported? If so, then the display settings might be ignoring the 50hz value and you are really getting a 60hz mode.

@.disable_overscan=1hdmi_cvt=800 480 50 3 0 0 0sdtv_mode=18hdmi_group=2hdmi_mode=87machine_timing=ntsc- customcycles_per_second=1026554 @.disable_overscan=1hdmi_cvt=800 480 50 3 0 0 0sdtv_mode=18hdmi_group=2hdmi_mode=87machine_timing=pal-custom cycles_per_second=1026554

Try changing the hz to 60 for ntsc, keep 50 for PAL and run the timing calc again. Cycles per second should be close to 985257. You might have better luck first finding parameters that work for that display that is known to match a 50hz refresh rate. Try doing that from a regular Pi OS boot. Then use those settings for hdmi_cvt and redo the calc.

On Sun, Nov 12, 2023 at 10:10 AM penrodyn @.***> wrote:

Hi Randy Thanks for the reply - it's much appreciated. As I'd previously used this install on a TV and been playing with the settings I decided to start again with a fresh install and ensure first boot is on DSI/Ribbon Cable. This was with the default resolution etc PAL/50Mhz and no slow downs!

However game music sounds way too quick, maybe 50% quicker but I don't think the games themselves are running overly quick. So, assuming this was a timing issue I added the custom resolution to Config.txt, booted and ran the calculator, which returned;

Ntsc-custom 1026554 60.050000 I am confused by the NTSC, does this mean my screen doesn't support PAL?

Anyhow I created two entries in machine.txt (see below), both look great display wise and no-slow downs but sound is still sped up! Really confused!

@.***disable_overscan=1hdmi_cvt=800 480 50 3 0 0 0sdtv_mode=18hdmi_group=2hdmi_mode=87machine_timing=ntsc-customcycles_per_second=1026554

@.***disable_overscan=1hdmi_cvt=800 480 50 3 0 0 0sdtv_mode=18hdmi_group=2hdmi_mode=87machine_timing=pal-custom ThanksLeecycles_per_second=1026554

On Saturday, 11 November 2023 at 18:52:58 GMT, randyrossi @.***> wrote:

It does sound like a sync issue. When you say 'DSI' port, you are referring to the ribbon cable connector? I don't think I've ever tried that type of display. In fact, you might be the first ever to try it. I didn't even think you would get a picture that way. BMC64 waits for the vertical sync for each frame. I wonder if connecting that type of display puts extra load on the GPU and that's the reason for the slowdown. Have you tried disabling the shader? Let me know if that makes a difference.

On Sat, Nov 11, 2023 at 4:05 AM penrodyn @.***> wrote:

Hi I've connected a Waveshare 4.3" screen (800x480) via the DSI port of my pi 3b and although I get a picture everything runs a lot slower. I have tried creating a customer display setting, running the calculator, amending machines.txt and then selecting that custom mode but it appears to maken no difference. Are these customisations available for the DSI port or is it only HDMI. I've tried the same pi and screen with vice on Retropie and the issue is gone but is rather stick with bmc64. I'm guessing this is a sync issue and bmc is waiting for the screen whereas retropie doesn't bother. Any help much appreciated.

— Reply to this email directly, view it on GitHub https://github.com/randyrossi/bmc64/issues/253, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAI3HKAE7OQXMP7XLECKNE3YD45UVAVCNFSM6AAAAAA7HDXJ3WVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4DQOBVGIZDINA>

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Randy Rossi

  • "There are only two things that are hard about computer science; Naming things, Cache Invalidation, and Off-by-one errors."

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/randyrossi/bmc64/issues/253#issuecomment-1807154430, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI3HKFWFTNX3BCFITRYHZDYEDRHJAVCNFSM6AAAAAA7HDXJ3WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBXGE2TINBTGA . You are receiving this because you commented.Message ID: @.***>

-- Randy Rossi