{"id":36766046,"url":"https://github.com/fliperama86/neopico-hd","last_synced_at":"2026-04-25T19:03:37.697Z","repository":{"id":327162866,"uuid":"1107230678","full_name":"fliperama86/neopico-hd","owner":"fliperama86","description":"Digital video and audio capture with HDMI output for Neo Geo MVS arcade hardware using Raspberry Pi Pico 2","archived":false,"fork":false,"pushed_at":"2026-04-24T04:24:36.000Z","size":10450,"stargazers_count":76,"open_issues_count":2,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-04-24T06:23:44.387Z","etag":null,"topics":["digital","hdmi","neogeo","rp2350"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fliperama86.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-11-30T20:27:46.000Z","updated_at":"2026-04-24T04:24:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/fliperama86/neopico-hd","commit_stats":null,"previous_names":["fliperama86/neopico-hd"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/fliperama86/neopico-hd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fliperama86%2Fneopico-hd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fliperama86%2Fneopico-hd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fliperama86%2Fneopico-hd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fliperama86%2Fneopico-hd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fliperama86","download_url":"https://codeload.github.com/fliperama86/neopico-hd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fliperama86%2Fneopico-hd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32273224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["digital","hdmi","neogeo","rp2350"],"created_at":"2026-01-12T12:59:53.086Z","updated_at":"2026-04-25T19:03:37.692Z","avatar_url":"https://github.com/fliperama86.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Discord](https://img.shields.io/discord/1469422496833863884)](https://discord.gg/Th7HEHTC8p)\n\n# NeoPico-HD\n\nDigital video and audio capture with HDMI output for Neo Geo MVS arcade hardware using Raspberry Pi Pico 2 (RP2350B).\n\n## Features\n\n- **Native 240p HDMI output** at 60fps (via 480p line doubling for audio compatibility)\n- **Experimental 720p HDMI output** - `NEOPICO_VIDEO_720P=ON`, centered 3x 4:3 scale; release builds use the non-RT PicoHDMI path for the best 720p stability\n- **15-bit RGB + SHADOW/DARK capture** - 19-bit capture path includes SHADOW and DARK control lines\n- **Pixel Conversion Modes** - Default 32K RGB LUT, optional 64K SHADOW LUT path via `NEOPICO_ENABLE_DARK_SHADOW=ON`\n- **Digital audio capture** from I2S bus (before DAC) with 48kHz HDMI output\n- **Zero-overhead DMA video capture** - uses PIO + DMA with ping-pong buffering for perfect stability\n- **PicoHDMI Output** - Powered by the [PicoHDMI](https://github.com/fliperama86/pico_hdmi) library for efficient, hardware-native TMDS encoding via RP2350 HSTX.\n\n## Status\n\n| Feature                 | Status                                     |\n| ----------------------- | ------------------------------------------ |\n| 480p HDMI video         | Working                                    |\n| 720p HDMI video         | Experimental (`NEOPICO_VIDEO_720P=ON`, non-RT release build) |\n| 60fps capture           | Working                                    |\n| RGB555 video path       | Working                                    |\n| SHADOW/DARK capture     | Working                                    |\n| SHADOW conversion mode  | Optional (`NEOPICO_ENABLE_DARK_SHADOW=ON`) |\n| HDMI audio (48kHz)      | Working                                    |\n| OSD Diagnostics         | Working                                    |\n| Morhph4K, RetroTink 4K  | Tested                                     |\n| Samsung Q80, Acer Pred. | Tested                                     |\n\n## Hardware Requirements\n\n- **Raspberry Pi Pico 2** - Must be RP2350**B** variant (48 GPIOs) for digital audio capture\n- **Neo Geo MVS board** - Tested on MV1C\n- **HDMI connector** wired to Pico GPIO\n\n### Hardware Setup \u0026 Signal Integrity\n\nTo ensure clean audio and video capture, follow these best practices:\n\n1.  **Common Ground**: A solid ground connection between the MVS board and the Pico is **mandatory**.\n2.  **HDMI Power**: It is **absolutely mandatory** to have the HDMI connector properly powered with **+5V**. While some devices (like the Morph4K) may be forgiving, others (like the RetroTINK, TVs and monitors) will not pick up the signal without it.\n3.  **Level Shifting**: Route all MVS -\u003e Pico digital lines through proper **5V-to-3.3V level shifters**.\n4.  **Clock Conditioning**: Keep **Schmitt-trigger conditioning** on PCLK and BCK for clean edges.\n5.  **Power-Path Isolation**: Prevent back-feed between external 5V and USB 5V (ideal diode/power mux approach recommended).\n6.  **Cable Separation**: Physically separate the I2S audio wires (GPIO 22-24 path) from the video wire bundle to avoid coupling.\n7.  **Shielding**: Use a **GND-Signal-GND** pattern when using ribbon cables.\n\n### Pin Configuration\n\n#### Video Capture (Bank 1)\n\n| Function   | GPIO       | Notes                |\n| ---------- | ---------- | -------------------- |\n| MVS CSYNC  | GPIO 27    | Composite sync       |\n| MVS PCLK   | GPIO 28    | 6 MHz pixel clock    |\n| MVS Blue   | GPIO 29-33 | B4-B0 (contiguous)   |\n| MVS Green  | GPIO 34-38 | G4-G0 (contiguous)   |\n| MVS Red    | GPIO 39-43 | R4-R0 (contiguous)   |\n| MVS SHADOW | GPIO 44    | Shadow dimming       |\n| MVS DARK   | GPIO 45    | Dark dimming control |\n\n#### HSTX Output (Bank 0/1)\n\n| Function | GPIO       |\n| -------- | ---------- |\n| TMDS CLK | GPIO 12-13 |\n| TMDS D0  | GPIO 14-15 |\n| TMDS D1  | GPIO 16-17 |\n| TMDS D2  | GPIO 18-19 |\n\n#### Audio Capture\n\n| Function | GPIO    | MV1C Tap Point |\n| -------- | ------- | -------------- |\n| I2S DAT  | GPIO 22 | R91            |\n| I2S WS   | GPIO 23 | R90            |\n| I2S BCK  | GPIO 24 | R92            |\n\n## Prebuilt Firmware\n\nGitHub Releases include ready-to-flash UF2 files:\n\n| Asset | Mode | Notes |\n| ----- | ---- | ----- |\n| `neopico_hd.uf2` | 480p HDMI | Default MV1C digital-audio build |\n| `neopico_hd_240p.uf2` | 240p HDMI | Runtime-mode 240p output |\n| `neopico_hd_720p_nonrt.uf2` | 720p HDMI | Experimental 1280x720 non-RT PicoHDMI path |\n| `neopico_hd_pcm1802.uf2` | 480p HDMI | PCM1802 analog-audio build |\n\nThe 720p build runs the RP2350 at 372 MHz with 1.3V core voltage. It uses the compile-time PicoHDMI path (`NEOPICO_USE_NONRT_HDMI=ON`) and the PicoHDMI HSTX fast-slew/12mA pad configuration.\n\n## Building\n\nRequires [Pico SDK](https://github.com/raspberrypi/pico-sdk) with `PICO_SDK_PATH` set.\n\n```bash\n# Build and flash\n./flash\n\n# Experimental 720p non-RT build\ncmake -S . -B build_720p_nonrt -DNEOPICO_VIDEO_720P=ON -DNEOPICO_USE_NONRT_HDMI=ON\ncmake --build build_720p_nonrt --target neopico_hd -j4\n\n# Optional standalone HDMI/OSD self-test firmware\ncmake -S . -B build_selftest -DNEOPICO_BUILD_SELFTEST=ON\ncmake --build build_selftest --target neopico_selftest -j4\n```\n\n## Architecture\n\n```\nCore 0: Video Capture               Core 1: Audio Pipeline + HSTX\n+--------------------------+       +--------------------------+\n| Video: PIO1 -\u003e DMA (PP)  |       | Audio: PIO2 -\u003e processing|\n| Conv: 32K LUT (64K opt)  |       | [ PicoHDMI Library ]     |\n| Main loop: Control       |       | - 640x480 @ 60Hz         |\n| Heartbeat LED            |       | - HDMI Data Islands      |\n+--------------------------+       +--------------------------+\n          |                        +--------------------------+\n          |                                   |\n          +--------- framebuf ----------------+\n                  (320x240 RGB565)\n```\n\n### PicoHDMI Library Integration\n\nThe project leverages the [PicoHDMI](https://github.com/fliperama86/pico_hdmi) library (found in `lib/pico_hdmi`) to interface with the RP2350's HSTX peripheral. This library provides the high-performance TMDS encoding and Data Island management required for stable HDMI output.\n\n- **Dedicated Output Core**: To ensure rock-solid HDMI timing (exactly 800 cycles per line), the library runs its main loop on **Core 1**. This isolates the high-priority TMDS serialization from the video capture logic on Core 0.\n- **Zero-Latency Scaling**: We use the library's `video_output_set_scanline_callback()` to implement a scanline doubler. This performs 2x vertical upscaling (240p to 480p) on-the-fly as pixels are streamed to the HSTX, avoiding the need for a full 480p framebuffer.\n- **HDMI Audio Injection**: Audio data is integrated via the library's Data Island queue (`hstx_di_queue`). The audio subsystem pushes TERC4-encoded packets into this queue, which the library then automatically injects during the horizontal blanking intervals.\n- **Frame Synchronization**: A VSYNC callback is used to keep the video capture ring buffer and the HDMI output in perfect sync, minimizing latency and preventing screen tearing.\n\n## Documentation\n\n- **[System Architecture](docs/ARCHITECTURE.md)**: High-level design, core partitioning, and the closed-loop audio sync.\n- **[Video Implementation](docs/MVS_MV1C_DIGITAL_VIDEO.md)**: Tap points, signal logic, and PIO capture.\n- **[Audio Implementation](docs/MVS_MV1C_DIGITAL_AUDIO.md)**: I2S format, ASRC strategy, and drift control.\n- **[HSTX \u0026 HDMI](docs/HSTX_IMPLEMENTATION.md)**: Output timing, TMDS, and Data Islands.\n- **[OSD](docs/OSD_IMPLEMENTATION.md)**: On-Screen Display rendering.\n- **[Best Practices](docs/BEST_PRACTICES.md)**: Critical Do's and Don'ts for developers.\n\n## Architecture Highlights\n\n- **Dual-Core Design**: Dedicated cores for Video Capture (Core 0) and HDMI Output (Core 1).\n- **Closed-Loop Audio Sync**: Software-defined feedback loop effectively \"genlocks\" the MVS audio to the HDMI clock, preventing drift and glitches without an FPGA.\n- **Zero-Lag**: Scanline-doubling architecture with no framebuffer delay.\n\n## Installation\n\nUnlicense\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffliperama86%2Fneopico-hd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffliperama86%2Fneopico-hd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffliperama86%2Fneopico-hd/lists"}