Sensoray 401x Firmware Update

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

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

Version 2027 - 25 Mar 2026
- ExFAT format support for USB drive - can write files larger than 4GB.
- When writing data to USB drive is slow, switch to reduced framerate 
  until it can catch up. If recordings show frequent reduced framerate,
  it means the USB drive needs to be replaced.
- Smoother passthru during heavy writes to USB drive.

Version 2014 - 28 June 2023
- Fix MP4 recordings playback issue with QuickTime.

Version 2013 - 27 Apr 2023
- Updating custom.zip will now prompt before doing reset parameters.
- Fix status text flickering when copying/deleting files.
- Fix "Failed to save log" message when save was actually successful.
- Fix data loss during RTSP streaming due to max buffer size.
- Add overlay POST URI to upload overlays and images
- Changed POST response to HTTP 200 OK when used with wget/curl
- Fix Primary OSD position changing after reboot when near bottom or right 
  side of display.
- 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.
- Fix bug in MP4 recording that prevented importing into Pinnacle Studio.

Version 2010 - 8 Feb 2022
- 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 copying files with overwrite sometimes failing "Insufficient space on dest."
- 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_s4011.fw"

Version 2005 - 16 Aug 2021
- Add support for Edimax ew7811Un V2 (7392:b811)

Version 1960 - 21 May 2021
- Fix MP4 recordings not being closed correctly, making them unplayable.

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

Version 1958 - 14 Apr 2021
- Fix JPEG snapshot wrong size with PAL input.
- Fix secondary overlay text entry crash.

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

Version 1956 - 1 Mar 2021
- Fix JPEG snapshot first frame corrupt and containing old images.

Version 1952 - 26 Feb 2021
- Fix JPEG snapshots to produce the same file on both int and ext.

Version 1951 - 23 Feb 2021
- Fix external over internal priority for loading secondary overlays on startup.

Version 1950 - 22 Feb 2021
- Start display in idle mode, will change to passthru after splash screen.
- Detect gaps in video recording, and display "USB Stall Detected" when occurs.

Version 1946 - 14 Dec 2020
- Add keyboard layout option (Advanced configuration -> Advanced options)
- UK keyboard layout: swap @ and ", add £, add #~ key, altGr AEIOU

Version 1942 - 15 July 2020
- Add spinner to snapshot indicator when USB drive is being slow.

Version 1941 - 14 July 2020
- Optimize snapshot/recording filename generation, to prevent video "hitching"
  after creating hundreds of files.

Version 1940 - 2 July 2020
- Add more diagnostic messages in log.txt
- Fix snapshot delay when USB storage is busy

Version 1938 - 22 June 2020
- Fix audio audio disappear in recordings when paused.

Version 1937 - 9 June 2020
- Add color killer option to Advanced video menu.
- Add Colorbars Test mode to Advanced video menu.

Version 1936 - 12 May 2020
- Fix TS playback foward seek amount not resetting at start.
- Update time on display during TS playback forward seek.

Version 1932 - 23 Apr 2020
- Merge fixes from 4023:
- Fix Advanced "Back menu option" setting "on top".
- Adjust menu cursor initial position to account for hidden items.
- Fix length of text background when string contains UTF-8.
- Loading a custom.zip will reload current language file automatically.
- Add snapshot index to snapshot notification.
- Fix corrupted mp4 after dual recording and ext storage gets full.
- Overlays->"Erase all secondary text" will now delete files from internal.
- Secondary overlay attributes (not text) are preserved in board flash memory.
- 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.
- 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.
- Fix frames lost at end of recording if cache is filled when stopped.
- Added audio inputs for Line-in Mono mode: both mixed, left-only, right-only.
- Secondary text rectangle will now shrink to fit empty lines.
- Add File Management - Select Files - All option. Works like Group except
  all files are automatically selected and directly opens action menu.
- Fix bug with unending "Wait until safe to remove".

Version 1930 - 6 Mar 2020
- Fix bug with recordings not always starting on keyframe.

Version 1929 - 3 Mar 2020
- Play video added support for transport stream (.ts) files.
- Transport stream PCR timestamps fixed, and prevent audio packet clumping.
- Fix encoder interface menus appearing on model 4011.

Version 1925 - 18 Feb 2020
- Fix menu background bug with long filenames.

Version 1924 - 7 Feb 2020
- DVR Serial API version 1.1

Version 1923 - 8 Aug 2019
- Fix AGC volume bug

Version 1922 - 17 July 2019
- Minor change to UNDIP serial protocol

Version 1921 - 12 July 2019
- Take wifi into account when updating firmware.
- System information menu shows if wifi firmware is installed.

Version 1913 - 19 June 2019
- No longer initializes display to NTSC when configured for PAL

Version 1906 - 7 June 2019
- Change UNDIP protocol to set distance when S=1

Version 1904 - 3 June 2019
- Add Serial Setup Protocol menu

Version 1892 - 2 May 2019
- Fix video playback from internal returning immediately.
- Fix audio playback not switching between mono and stereo.

Version 1890 - 29 Apr 2019
- Correct audio sample rate
- Fix touchscreen menu activation based on EV_ABS bits
- Fix transport stream recording stopping when limit it reached.

Version 1888 - 19 Mar 2019
- Fix copy file percentage not starting at zero in individual selection mode.

Version 1887 - 12 Mar 2019
- Fix for stop recording lockup after saving secondary overlay text.
- Audio Line input now records in stereo, Mic in mono.

Version 1882 - 11 Feb 2019
- Add Setup->Video option Recording Limit for file size.

Version 1880 - 20 Dec 2018
- Fix audio passthru not working on power-up on some boards

Version 1879 - 29 Nov 2018
- Fix audio passthru cutting in/out during recording
- Fix playback freezing when audio passthru is enabled
- Add hardware fail detection USB_ID and USB_VBUS

Version 1857 - 24 Aug 2018
- Add error checking for custom.zip extraction
- Increase daily file limit to 3 digits

Version 1856 - 20 July 2018
- Fix interpolation mode not affecting snapshots
- Fix logo screen sporadic hang

Version 1843 - 6 July 2018
- Fix device lockup after recording long dual files at lower bitrate.
- Fix red dot appearing when starting file playback.
- Fix Esc moving to next viewed snapshot.
- Default text file "English.txt" can be created from Advanced Options menu.
- When pressing Esc after F4 or F6, the notification is correctly hidden.

Version 1835 - 31 May 2018
- Improved support for more USB devices on hubs.
- When scanning storage for firmware updates, the external storage will
  now take priority over internal.

Version 1809 - 22 May 2018
- Add TS or MP4 recording option at "Setup->Video->Recording Format"
  (TS won't get corrupted if power is cut or storage error)
  (TS playback on device is currently not supported)

Version 1798 - 17 May 2018
- Modify USB host driver to allow more devices on hubs.

Version 1757 - 4 May 2018
- Fix simultaneous encode/decode lockup (RTSP via WiFi, playback on device)

Version 1755 - 9 Mar 2018
- Add File Management "Select files" option: Individual or Group.
  When set to Group, Move/Copy/Delete may be selected with the 
  Ok button. Pressing Back/Esc will show the number of files selected
  and give options to confirm the action, select more or cancel.

Version 1753 - 21 Feb 2018
- Fix DVR_Copy_or_Move, DVR_Esc_disabled, DVR_AudioPassthru not appearing
    in saved config.txt

Version 1752 - 20 Feb 2018
- Fix unintended parameter reset when formatting completes.

Version 1751 - 19 Feb 2018
- Coded overlay allows more than 14 lines in codes.txt if created elsewhere.
    On-device editing will only change the first 14 lines.
- Codes menu will display multiple pages to select up to 127 items.

Version 1750 - 19 Feb 2018
- Passthru audio option added to audio menu.  (default disabled)
- When moving or copying files, stop/back will cancel overwrite.
- Unsupported filesystem can be formatted from System Information menu
- Setup->Video->PlaybackSeek: new option Continous allows continous 
    fast-forward or rewind during playback.
- Added download web page for downloading files over WiFi.

Version 1735 - 11 Dec 2018
- Fix overlay menu for additional text overlay
- Add advanced option to change Esc and R key behavior (since ver 1733)
  Advanced Options -> Esc stops recording : Disabled    Enabled
                         Esc key behavior : nothing     stop recording
                           R key behavior : rec/stop    rec/pause

Version 1734 - 7 Dec 2017
- Fix up/down keys in playback mode with USB keyboard

Version 1733 - 17 Nov 2017
- Change Esc key to do nothing while recording (prevents accidental stop)
- Change R key from Rec/Pause to Rec/Stop (use P key now to pause)
- Adding additional secondary text overlay (name ADDTL, key A)
- Backported fixes for bugs in USB host driver.

Version 1732 - Nov 2017
- Change "Mute Recording at Start" options: Mute/Unmute/Disabled

Version 1731 - 27 Oct 2017
- Fix spurious intermittent "Storage Error" notifications
- Unsupported disk format will appear as "Storage Error" and
  also show "Unsupported format" in System Information

Version 1724 - 19 Oct 2017
- Fix "Toggle Copy or Move" not appearing without USB keyboard connected.
- Fix displaying of disk size in exponential format

Version 1722 - 18 Oct 2017
- Added file management menu option to toggle copy or move.
- All text occurrences of "screen shot" have been renamed "snapshot".
- Inserting a storage device with unsupported filesystem (non-FAT32) will 
  display "External Storage Error" and will no longer lock up in the setup menu.

Version 1721 - 29 Sept 2017
- Fix visual glitches left on screen when renaming files

Version 1720 - 12 Sept 2017
- Fix problems reported with overlays and Interpolate=On

Version 1718 - 28 Aug 2017
- Fix secondary overlay broken in 1717

Version 1717 - 25 Aug 2017
- Fix jerkiness on preview with Interpolate On
   (preview will be jerky only when Secondary Overlay is enabled)
- Fix units being reported in ft or m when encoder hasn't been calibrated
- Fix bug when menu has no options
- Custom.zip may contain config.txt which will be used with Reset Parameters

Version 1716 - 28 July 2017
- Fix PAL standard, broken in version 1710
- Fix text editing (rename, etc) broken in 1711

Version 1711 - 26 July 2017
- Shortened some messages that were getting cut off, and extended the max message length.
- Additional Reset/Save/Load Params in Advanced Options menu for system integrators.
- Custom.zip limited to 128KB message will be displayed if too large.
- Fix playback bug due to previous version passthru fix
- Fix lockup when jpeg decoding fails (bad splash.jpg)

Version 1710 - 17 July 2017
- Fix passthru mode intermittently not being reenabled after playback
- Workaround field misalignment on non-interpolated recorded streams

Version 1708 - 11 July 2017
- Status message position stored independently for NTSC and PAL, and Coarse/Fine adjustment.
- Messages "Wait until safe to remove" and "STOP" traded places for better visibility.
- Add option to show icons for shorter status messages (in Advanced Options menu)
- Add option to change menu background transparency (in Advanced Options menu)
- Add option to disable Auto Gain and Auto Brightness (in Advanced Video menu)

version 1707 - 28 June 2017
- Fix DIO33V0 (Rec/Pause) broken since version 1684
- Fix overlay glitch of first character on unaligned horizontal coordinate
- Fix flicker taking snapshot with Interpolate On (snapshots are now interpolated)
- Fix on-screen display crash (PAL only)

version 1704 - 22 June 2017
- Add option to keypad configuration to set pin to Recording LED output
- Add option to move status message position (in Advanced Options menu)

version 1700 - 5 June 2017
- Fix turn on/off WiFi repeating

Version 1699 - 31 May 2017
- Fix for unrecognized USB stick partitioning scheme.

Version 1698 - 30 May 2017
- Improve performance of overlays when Interpolate option is off
- Remove 50% & 75% background on secondary overlay due to performance

Version 1697 - 24 May 2017
- Improved quality of passthru video when Interpolate option is off
- Add Brightness, Contrast, Hue, Saturation controls to Advanced Video menu
- Move chroma and luma filter options to Advanced Video menu
- Add record status and red dot options to Advanced Options menu
- Recording status may be Enabled, Disabled, or Hide after 5sec

Version 1696 - 17 May 2017
- Add chroma and luma filter options to Setup->Video menu
- Fix possible parameter corruption after upgrading from older version

Version 1689 - 4 May 2017
- Rename and custom overlay text options require USB keyboard
- Wifi menu option no longer shows after flashing non-wifi firmware

Version 1687 - 14 Apr 2017
- Fix snapshot overlay position

Version 1686 - 11 Apr 2017
- Pause toggle key is now Play/Pause: additionally opens Play Videos Menu
- New Date formats: YYYYMMDD and YYYYMMMDD
- New action Up/Screenshot acts as Up in menus, Screenshot otherwise
- FF only key acts as OK in menus
- Rew only key acts as Back in menus
- USB keyboard page up/down keys may be used in directory menus
- Fix backspace problem when entering text with USB keyboard
- Add predefined primary overlays for date&time with encoder count
- Renaming files will use previous extension if none supplied

Version 1685 - 6 Apr 2017
- Fix snapshot overlays (were not appearing)
- Add option to turn snapshot overlays on/off to Setup->Video menu

Version 1684 - 3 Apr 2017
- Fix possible lockup after firmware update

Version 1683 - 16 Mar 2017
- Fix loading negative polarity encoder calibration parameter

Version 1680 - 13 Mar 2017
- Fix menu inoperable with both USB sticks inserted (since ver 1671)

Version 1679 - 9 Mar 2017
- Add Audio AGC menu item

Version 1678 - 24 Feb 2017
- Fix crash when loading secondary overlays
- Remove duplicated menu item on primary overlay

Version 1677 - 26 Jan 2017
- Recorded overlay text is improved when interpolate=on
- Multi-line overlay text drawing is optimized
- If storage is removed while recording, a warning is displayed
  and the device restarts automatically

Version 1671 - 24 Jan 2017
- Overlay menu moved to main menu
- Secondary overlays added: Title, Coded, Extra

Version 1662 - 19 Jan 2017
- Fix passthru video stutter while recording

Version 1646 - 1 Dec 2016
- Make displayewd recording time consistent after split 4GB recordings
  (recording time will wrap to zero after 13 hours continuous recording)

Version 1558 - 22 Sep 2016
- Rename files in file management menu
- defaults: 3500kbps video, interpolation on
- fix bug with USB keyboard repeat when start record

Version 1487 - 11 Aug 2016
- foreign language support
- keypad button for rotary encoder reset

Version 1505 - 10 Aug 2016
- corrections to wifi in dvr menu

Version 1500 - 9 Aug 2016
- added notifications for wifi update

Version 1495 - 2 Aug 2016
- Wifi enabled
	-rtl8192, ath9271, rl2870 chipsets supported
- Requires loading s4011.fw_loader to update from older firmware
- firmware load time increased to about 60 seconds.

Version 1480 - 29 July 2016
- fix video freeze after stopping playback

Version 1482 - 29 July 2016
- allow changing wifi settings through html

Version 1480 - 29 July 2016
- allows updating wifi archive from usb/dvrmenu

Version 1477 - 28 July 2016
- can disable ext USB ports
- adds Back option during pause/end video playback
- snapshot quality 97

Version 1475 - 21 July 2016
- Back option on top of menu
- Custom overlay text

Version 1385 - 15 Apr 2016
- Add rotary encoder interface (model 4012)
- Add video overlay
- Fix sticky messages on main screen after back is pressed
- Slow down USB keyboard delay and repeat rate
- Support keypad customization
- Improved file writing performance to storage devices

Version 1307 - 9 Mar 2016
- Setup option to record to internal or external storage, or both.
- Recording to both storage simultaneously should no longer freeze,
  though rec time may briefly stop updating.
- Setup option for playback seek amount, default is 10 sec.
- Added delete files menu.
- Confirmation for changing Video Standard

Version 1290 - 22 Feb 2016
- MP4 files will be split at 4GB due to FAT32 filesystem limit.
  The recording time indicator will also reset to 0 when split occurs.
- MP4 files will close correctly when the filesystem is full, and
  a message "Storage full or write error" will be displayed.
- Interpolation option added to setup menu - when on, video will 
  eliminate interlacing artifacts.

Version 1277
- Recording -> Pause -> Stop -> lockup fixed.
- New setup menu option to change the video bitrate.
- Font is now 16x16 pixels.
- Recording time is now shown next the "REC" or "PAUSE" indicator 
  in the format "0:00:00".  Playback of recordings will also show 
  the time when paused, or seeking forward or back.
- Setting the date and time now allows you to select the range 
  (1-9, 10-19, 20-29, 30-31)  then select the number within that range.
- The default storage is now defaulted to which is currently available.
- Fixed bug where the playback would not play the whole recording.

Version 1274
- Play Video is functional, with Pause/Rew/FF
- View Snapshots is functional
- Mute/Unmute is functional
- Recording will now show WAIT after STOP is pressed, until it is safe 
  to remove the memory stick
- USB keyboard support
  Esc, Backspace, Left Arrow - menu back or stop recording
  Enter, Space, Right Arrow - enter menu / select item
  Up Arrow - menu up
  Down Arrow - menu down
  S - screen shot
  R - start recording
  P - toggle pause recording
  M - toggle mute
  

