Sensoray 4023 Firmware Update

To update, copy the file s4023.fw to the root folder of the USB storage
device and insert the disk into the USB port on the 4023.  Enter the
setup menu and select "Update Firmware" option.  The device will take
about 30 seconds to update and restart.  When updating to a previous
firmware version, always be sure to Reset Parameters from the System
Information menu.

For support questions, please contact support@sensoray.com.

Version 1630 - 6 Jan 2026
- Serial API ver 1.5 - add CMD_SET/GET_VIDEO_INPUT
- Add parameter Capture_ForceInputMode2 (for second video input)
- Update Set Date for year to start at 2026

Version 1626 - 10 Nov 2025
- Possible fix for video going black.
 
Version 1625 - 10 Oct 2025
- Fix abrupt recording stop when capturing from CVideo source
  (Error recovery may cause the display to flicker,
   but the recording will not show it.)

Version 1621 - 20 May 2025
- Fix video blank when no input and 1080p60 output. (Rev.F board)
- Fix switching video output to/from Composite NTSC/PAL.
- Fix intermittent failure to detect video after switching inputs.

Version 1588 - 7 May 2025
- Prevent black screen from occurring (firmware crash) while recording
  in cases where USB drive could be malfunctioning and returns errors
  on file writes.
- Fix plug/unplug event message glitches when opening menus.
- Fix intermittent video loss on Rev.F boards when switching
  between passthru video and playback video or view snapshots,
  or after splash screen.

Version 1582 - 14 Jan 2025
- Add F12 key to cycle between output display modes
  (Auto / 1080p60 / 1080p30 / 720p60)

Version 1579 - 10 Jan 2025
- Fix video output reset on Rev.F (this version won't work on Rev.D)
- Fix 720p30/25 input with display set to 1080p60.

Version 1574 - 18 June 2024
- Fix recording buffering issue causing frame drops.
- Add Display Output mode option "1080p60" for Rev.D hardware.
- Fix splash screen on Rev.D hardware.

Version 1555 - 29 May 2024
- Fix crash on video signal disconnected.

Version 1553 - 9 May 2024
- Update video processing pipeline to remedy glitches

Version 1548 - 11 Apr 2024
- Restart AHD capture if stuck, when upscaling CVBS to 1080p.

Version 1547 - 11 Apr 2024
- Add firmware update key combination: Ctrl+Shift+U
  (can be used if display is not functional)

Version 1539 - 8 Feb 2024
- 4023TA RevD will always show 1920x1080p60 for Display Output, and
  when set to Auto will no longer upscale 720p60 to 1080p60 by default.

Version 1537 - 8 Feb 2024
- Add support for 1080p60 video output on 4023TA RevD.
  Older revs will be limited to 1080p30, detected automatically.
  
Version 1504 - 7 Nov 2023
- 'Sensoray' serial protocol API version 1.3
- Allow larger font 38x64 with Sensoray protocol

Version 1496 - 24 Aug 2023
- Add Menu Text Size option under Advanced Configuration -> Advanced
  Options -> Menu Text Size. (8x13, 16x16, 19x32)  Large menus will be
  split into multiple pages, with the page number shown on the right of
  the menu title.

Version 1495 - 17 Aug 2023
- Add larger font 38x64 (pixel-doubled 19x32)
- Add outline background for primary overlay (except 8x13)

Version 1492 - 4 Aug 2023
- Make default Audio Input Line Mono instead of Stereo, to reduce audio
  processing overhead.

Version 1491 - 3 Aug 2023
- Fix audio passthru and playback (not working since version 1456)

Version 1490 - 3 Aug 2023
- Fix regression: monitor blanking fix from ver 1461.

Version 1484 - 2 Aug 2023
- Add no-audio modes for Setup->Video->Recording Format. (This is to reduce
  resource usage and avoid frame drops.)
- This version uses USB DMA mode, which doesn't work with some USB WiFi adapters.

Version 1469 - 20 July 2023
- Add support for EFI(GPT) partition tables on USB storage device.

Version 1467 - 12 June 2023
- Fix GPIO keypad not working. (broken in version 1461)

Version 1463 - 6 June 2023
- Fix unrecoverable firmware crash when Keypad GPIO set to 'Recording LED Output'

Version 1461 - 2 June 2023
- Fix playback intermittently causing invalid video modes and blanking monitor.

Version 1456 - 10 Feb 2023
- Fix crash when recording/snapshot to external (broken in previous version)

Version 1454 - 9 Feb 2023
- Fix bug in MP4 recording that prevented importing into Pinnacle Studio.

Version 1453 - 30 Nov 2022
- Fix for 720p30/25 camera misdetected as 720p60/50 showing monochrome

Version 1448 - 25 Oct 2022
- Prevent custom text from clearing the Primary Overlay text, and allow
  selecting custom text string but not editing when USB keyboard is absent.
- The Primary Overlay "Custom Text" menu option will no longer change 
  depending on whether the USB keyboard is present, allowing it to be hidden
  using the language file customization.

Version 1447 - 22 Aug 2022
- Fix video playback and view snapshots image shifted slightly up and to
  the left, when Display Output is set to NTSC-CVideo or PAL-CVideo.

Version 1440 - 2 Aug 2022
- Fix changing Display Output Mode showing garbled overlay until exit menus.
- When Display Output is set to NTSC-CVideo or PAL-CVideo, and composite
  video is connected to the input: fix playback, snapshots, and overlays 
  on passthru video.

Version 1435 - 23 June 2022
- Fix Primary OSD position changing after reboot when near bottom or right 
  side of display.

Version 1434 - 10 Feb 2022
- Fix corrupted snapshots when output file size too big.
- Certain USB drives have been found to stop responding during copy operations, 
  causing the copy process to fail.  This firmware will detect the non-
  responsive drive and power-cycle the USB port in an attempt to get the drive
  working again and resume the copy operation.
- Fix copy files with overwrite sometimes failing "Insufficient space on dest."
- Fix status text flickering when copying/deleting files.
- Fix "Failed to save log" message when save was actually successful.

Version 1429 - 10 Dec 2021
- Remove unintentional code that cleared overlays replaced with "OSD too big"
  message.  (It was for performance testing.)
- Updating custom.zip will now apply new config.txt parameters if present.
- New rescue files which will automatically update the device if present on 
  external storage: "rescue_config.txt", "rescue_custom.zip", "rescue_s4023.fw"
- Faster snapshots (possible fix for corrupted snapshots)

Version 1419 - 8 Oct 2021
- Fix failure to boot up in versions 1415 & 1416 when 
  "Setup->Video->Display Output Mode" is set to "Auto".

Version 1416 - 8 Oct 2021 --- DO NOT USE ---
- Relaxed NORflash timing for new BOM

Version 1415 - 22 Sept 2021 --- DO NOT USE ---
- When no input is connected, simulated video will be limited to 30fps.
- Implement max-file-size for TS (transport stream) recordings.
- New features for Sensoray Serial API ver 1.2:
-  add 2 more virtual encoders (always offboard)
-  overlay region=16 refers to primary overlay

Version 1400 - 8 Sept 2021
- Add support for Edimax ew7811Un V2 (7392:b811)
- Revert change in previous version (USB DMA -> PIO) due to
  incompatibility with WiFi devices.

Version 1396 - 20 Aug 2021
- Slight improvement to file copy performance. (USB PIO -> DMA)
- Fix failure to update firmware after file copy.

Version 1381 - 21 May 2021
- Fix MP4 recording not being closed properly, leaving file unplayable.

Version 1380 - 20 May 2021
- Fix secondary overlay text entry crash.

Version 1379 - 16 Apr 2021
- Fix corrupt display status when PAL recording video is played.
- Fix playback exiting bug causing video to freeze.
- Disable overlay status message during playback.

Version 1378 - 14 Apr 2021
- Fix secondary overlay text entry crash.

Version 1377 - 12 Apr 2021
- Calculate and clear rectangle for DMA overlay text with newlines.

Version 1374 - 8 Apr 2021
- Fix firmware crash when serial overlay enabled without setting text.

Version 1373 - 7 Apr 2021
- Add serial port rx/tx to log (Ctrl-Shift-D, 4023 log)
- Fix hardware model identifier returned through serial api

Version 1372 - 16 Mar 2021
- Fix issue with text entry and certain symbols using UK keyboard layout.

Version 1371 - 18 Feb 2021
- Add NTSC-CVideo and PAL-CVideo display output options to "Setup->Video->
  Display Output" menu.  This requires the composite video cable connected
  to J3.

Version 1370 - 25 Jan 2021
- Remove Advanced Options -> Status Message Position -> Video Standard:
  previously when set to PAL, status message position was not retained.

Version 1366 - 29 Oct 2020
- Fix scaled-down pass-thru overlay notifications.

Version 1364 - 27 Oct 2020
- Fix splash screen corrupt image
- Fix overlay position movement after changing forced display mode

Version 1361 - 14 Oct 2020
- Fix overlay position limits
- Fix splash screen mode selection bug
- Set aspect ratio 4:3 for recording CVBS, 16:9 for HD

Version 1353 - 9 Oct 2020
- Fix bug with AHD/CVI video standards not being detected properly. 
- Fix bug where forced 720p25 mode wasn't taking effect.

Version 1349 - 8 Oct 2020
- Advanced video menu now includes video attribute controls:
    Brightness, Saturation, Hue, Contrast
- Advanced video menu adds "Force camera mode" default setting "Auto" which 
    will auto-detect input signal, otherwise forces the input to be set to 
    the selected mode.
- Advanced video menu adds "Force display mode", default setting "Auto" which
    will try to use the same mode as the camera input.  If the monitor EDID
    doesn't support that mode, this allows an alternate mode to be selected 
    for passthru and affects both recording and snapshots, and allows overlays
    to be visible (avoids "Primary/Secondary overlay active" message.)
    This menu may also be accessed from Setup->Video->Display Output.
- Advanced video menu adds "Allow display modes...", which lists a set of modes
    that can be enabled/disabled to override any missing modes in the monitor
    EDID table.  Note these are used only when "Force Display Mode" is "Auto".
    Please make sure that the monitor supports the mode before enabling it,
    otherwise the monitor will display "out of range" etc.
- Added PAL/576P50 display mode support, which may be used for CVBS input.
  NTSC/480P60 display mode is not supported, but will be in a future update.
- Splash screen is now supported: create custom.zip containing a jpeg image
  at "images/splash.jpg" with resolution 720x576, 1280x720, 1920x1080.
  Note: total size of custom.zip may not exceed 128KB.

- Merge changes/fixes from model 4011:
- Add keyboard layout option (Advanced configuration -> Advanced options)
    UK keyboard layout: swap @ and ", add £, add #~ key, altGr AEIOU
- Add spinner to snapshot indicator when USB drive is being slow.
- Optimize snapshot/recording filename generation, to prevent video "hitching"
  after creating hundreds of files.
- Fix audio audio disappear in recordings when paused.
- Fix TS playback foward seek amount not resetting at start.
- Update time on display during TS playback forward seek.

Version 1321 - 3 Jun 2020
- Fix format char '^' effect in OSD text.
- OSD font 3 background 50% and 75% will use solid black instead.

Version 1320 - 13 May 2020
- Fix serial port configuration

Version 1319 - 28 Apr 2020
- Fix stopping recording with translated language resulting in error dialog.

Version 1318 - 23 Apr 2020
- Increase maximum characters for generated menu items as well.

Version 1317 - 23 Apr 2020
- Fix Advanced "Back menu option" setting "on top", broken in 1160.
- Adjust menu cursor initial position to account for hidden items.
- Increase maximum characters for custom language menu item to 57.

Version 1316 - 22 Apr 2020
- Add accented characters to menu overlay font.
- Fix length of text background when string contains UTF-8.
- Loading a custom.zip will reload current language file automatically.

Version 1313 - 20 Apr 2020
- Add snapshot index to snapshot notification.

Version 1312 - 15 Apr 2020
- Fix playback corruption on first few frames.

Version 1310 - 14 Apr 2020
- Fix corrupted mp4 after dual recording and ext storage gets full.
- Fix playback getting stuck after attempting to play corrupt mp4.

Version 1305 - 9 Apr 2020
- Overlays->"Erase all secondary text" will now delete files from internal.
- Secondary overlay attributes (not text) are preserved in board flash memory.
- Snapshot overlay enable/disable not applicable to 4023, so removed.

Version 1302 - 6 Apr 2020
- Add "White" for primary and secondary overlay background options,
  white background with black text.
- Move primary overlay Text Size option to Setup Primary Overlay submenu.
- Language selection for English default can be hidden menu item.
- Configure keypad GPIO moved to submenu, all advanced options can be hidden.

Version 1301 - 3 Apr 2020
- Add "Erase all secondary text" to Overlays menu.
- Add "Transparent Black" for secondary overlay background options,
  transparent background with black text.
- Add option to hide menu items using translated language files feature,
  lines starting with tilde(~) will be hidden in menus.

Version 1298 - 25 Mar 2020
- Fix frames lost at end of recording if cache is filled when stopped.
- Restored transparency background option for secondary overlays.

Version 1294 - 24 Mar 2020
- Added audio inputs for Line-in Mono mode: both mixed, left-only, right-only.
  Use line mono to prevent video stutter when dual-recording 1080p30.
- Secondary text rectangle will now shrink to fit empty lines.

Version 1284 - 19 Mar 2020
- Fix issue that could prevent playback or viewing snapshots.
- Fix Select Files - All option not being saved after power cycle.
- Throughput tests for int & ext, fix temporary files not deleted.

Version 1265 - 16 Mar 2020
- Add File Management - Select Files - All option. Works like Group except
  all files are automatically selected and directly opens action menu.

Version 1258 - 12 Mar 2020
- Fix bug with unending "Wait until safe to remove".
- Improve diagnostic logging for playback errors.
- When EDID is absent, assume monitor supports any display mode.

Version 1237 - 6 Mar 2020
- Fix bug with recordings not always starting on keyframe.
- Fix bug with playback of above recordings getting stuck at LOAD.

Version 1233 - 4 Mar 2020
- Play video added support for transport stream (.ts) files.
- Transport stream PCR timestamps fixed, and prevent audio packet clumping.
- Fix intermittent view snapshot error "File not playable"

Version 1231 - 25 Feb 2020
- Secondary overlay background options changed to Blue or Black.
  (Transparent option was removed with previous performance improvement.)
- Viewing snapshots will keep current display mode set to 25/30 fps.
- Up/down arrow keys can be used to navigate snapshots.

Version 1228 - 24 Feb 2020
- Improved performance of secondary overlays.

Version 1224 - 18 Feb 2020
- Workaround encoder interface bug (changed i2c clock rate to 200kHz)

Version 1214 - 13 Feb 2020
- Serial API version 1.1
- All secondary overlays are all loaded from storage, along with 
  position, font, and background.

Version 1213 - 29 Jan 2020
- Add option "Overlays->Setup Primary->Disable on boot", which can
  be useful if the serial port is used to drive the overlays.

Version 1212 - 24 Jan 2020
- Attempt to reduce "USB Problem" false-positives.

Version 1211 - 17 Jan 2020
- Fix snapshot causing overlay glitches in 1080p30 recording.
- Snapshot message will stay on display until fully saved.
- Snapshots taken while recording 1080p30 may take longer.

Version 1210 - 18 Dec 2019
- View snapshots reliability has been improved.
- Fix case where on-screen keyboard was not being erased.
- Fix multi-line text entry bug when clearing long lines.
- Changing audio passthru no longer blanks screen.
- Video input selection may now show "No signal".

Version 1208 - 12 Dec 2019
- Remove erroneous black rectangle overlay
- Fix race condition with snapshots and recordings getting stuck
- Fix playback video seeking to wrong spot
- Add playback menu for touchscreen
- Add check for recording resolutions supported by display

Version 1207 - 26 Nov 2019
- Implemented play video and view snapshots.
- Changed 25x57 font to 19x32. Can now be selected thru serial API.

Version 1197 - 25 Sept 2019
- Fix for flickering old/previous frames in recording and passthru

Version 1196 - 20 Aug 2019
- Fix AGC audio volume bug
- Fix case where snapshot caused display corruption.
- Fix snapshot causing display flicker.
- Recording LED option now has Active high or low setting.

Version 1195 - 29 Jul 2019
- Fix recording resolution bug in previous version.

Version 1192 - 26 Jul 2019
- Use new PIC encoder address to not interfere with EDID communication.
- Setup Video "Display Output" submenu added to override resolution to 
  1080p30/25 or 720p60/50.  NOTE: Recording will use the same resolution,
  but will allow overlays on passthru video.

Version 1188 - 19 Jun 2019
- Fixed touchscreen interface

Version 1175 - 6 Jun 2019
- Add 25x57 font size for OSD

Version 1171 - 29 May 2019
- Added serial port setup menu
- Added Setup>Video>"Display Output" to show output resolution

Version 1161 - 15 May 2019
- Fix crash when determining monitor mode.

Version 1160 - 16 Apr 2019
- Add touchscreen input mode, with on-screen-keyboard
- Fix transport stream recording stopping when limit is reached.

Version 1158 - 15 Mar 2019
- Fix video sync placement, and HDMI vs DVI display detection.

Version 1149 - 26 Feb 2019
- Adjust 1280x800p60 display mode timings.
- Fix incorrect video blanking calculation

Version 1146 - 12 Feb 2019
- Adjust 1280x800p60 display mode timings.
- Add Setup->Video option Recording Limit for file size.

Version 1143 - 5 Feb 2019
- Fix incorrect video sync widths (may improve compatibility with monitors)

Version 1140 - 4 Feb 2019
- Advanced video menu, add "Save EDID to internal"

Version 1139 - 30 Jan 2019
- Scale down option removed. Recording and snapshots will be full camera resolution by default.
- The display EDID will be queried to determine output resolution support.
- Automatic scale-down mode in case camera resolution and fps not supported by display.
  (Note: scale-down quality will be lower than display resolution. For best results,
   use a display whose EDID supports the camera resolution and framerate.)

Version 1116 - 11 Jan 2019
- Default option to scale down 1080p30/25 to 720p. Recording will also be scaled down.
- Add menu item (Keyboard K) Advanced Video -> Display 1080p30/25 (to override the above.)
- Improved 1080p30 encoding bandwidth
- Fix overlay drawing glitch and position limits
- Adjust bitrate options: 2Mbps to 10Mbps

Version 1106 - 20 Dec 2018
- Fix line audio input and passthru
- Fix HD video passthru
- Add video input selection menu item

Version 1091 - 13 Dec 2018
- First firmware

