open3doled / open-3d-oled

Other
4 stars 0 forks source link

Open3DOLED

Beta Testers Needed

I'm looking for beta testers who have potentially compatible displays. I have 49 partially assembled units. If you have a 120hz TV and it is either and OLED with BFI (@120hz), or an LCD with fast pixel response time your display may work, checkout this fantastic table provided by rtings.com for relevant display parameters. Just to be clear the beta units are not free, but produced near cost and bundled with a pair of panasonic glasses with custom firmware optimized for software pageflipping (see below for details about this). The price for the emitter and 1 pair of M size glasses is $100 USD with tracked global shipping. I will help you configure the unit to work with your display and help with any trouble shooting, if the unit does not work with your TV you can return it for a refund (minus cost of shipping). In return all I ask is that you share the config settings that work best with your TV. If interested contact me at: support at open3doled dot com.

Introduction

Open3DOLED is a set of software and hardware designs that allow one to turn any display into a 3D display using compatible shutter glasses.
It works best for displays that incorporate Black Frame Insertion (BFI) technologies and have framerates that exceed 120hz.
This includes OLED TV's by the likes of LG and Sony which incorporate technologies like LG "Motion Pro" and Sony "Clearness" settings.
It can also work on LCD TV's and monitors that have fast pixel response time, in such cases it works best if the TV supports HDMI/DVI QFT (Quick Frame Transport), this can be used to force a large vertical blanking interval during which time the image on the LCD will be static.
It also has been tested to work on the latest Sony micro-LED TV's.
If your compatibility information for your TV is not listed below, or you are considering buying a TV and would like to know if it might be compatible I would suggest referring to this fantastic table provided by rtings.com
You can compare, sort and filter by pixel response time, support for BFI 120hz, BFI duty cycle, PWM backlight fruency and duty cycle.
In addition to the RTINGs website you will also need to confirm the orientation of the front polarizer on your TV. Most TV's have a vertical front polarizer, but about 10% have a horizontal front polarizer. In the event you have have one of these TV's there is a $30 USD extra fee for me to flip the front polarizer on each pair of glasses. I have measured the front polarization of over 70 different modern TV's and provided them in the FAQ, if your TV isn't listed you can check the front polarization using a pair of polarized sunglasses from the dollar store. Polarized sunglasses are vertically polarizer, just like the majority of TVs so if you can see the TV throught the glasses then your TV has a vertical front polarizer (or no polarizer at all). There is a webstore in the works where you will be able to buy a pre-built/pre-programmed emitter unit in the next month or so once preliminary beta testing is complete..
In the future custom firmware images that are optimized for software pageflipping for popular brands of glasses by Panasonic (and other manufacturers) may be released.
(I plan to sell these glasses on the webstore initially along with the emitters to help recoup the over 400(?) hours put into this project, they reduce jitter greatly and eliminate crosstalk from dropped frames)

Glasses Warning

Getting Started

Configuring TV or Monitor

Calibration and Playback

3DPlayer Installation Instructions:

Ubuntu Install:

OR

~/.virtualenvs/open3doled/bin/python3 3d_player.py


### Windows Release Install:
Download the latest release version from the Releases page.
Unzip and run 3d_player.exe
The first time you run the program it can take a while to load all required libraries, please be patient.

If running windows 11 or 10 with DPI scaling be sure to disable it as follows.
1) Right click properties on 3d_player.exe in the 3DPlayer folder
2) Click on "Compatability" tab then click on the button at the bottom "Change high DPI settings"
3) At the very bottom check the box next to the text "Override high DPI scaling behavior. Scaling performed: Application"
4) Click OK on this sub dialog as well as the parent one

### Calibration

* Put the sensor bar on the top left corner of your TV and connect it to the PC you will be using to play your 3D videos.
* Start Open3DOLED 3DPlayer
* Click the "Open emitter settings" icon button on the main toolbar, and then in the emitter settings window "Connect" to your 3d emitter
* Click on "Load Settings From Disk" and select a profile for your TV and glasses from the "settings" directory. Some settings files are optimized to reduce vignetting (black at top and bottom of screen) and others are optimized to reduce ghosting (cross talk between left and right eye at top and bottom of screen), choose the settings file matching your preference.
* If you are using a none OLED display or a display for which settings are not already available it is recommended that you set "OPT101 Ignore All Duplicates" to 1. This can be disabled later, but will ensure the highest possibility the emitter can synchronize to your TV.
* If necessary change the "IR Protocol" to match your glasses, most settings templates should have this set correctly already. (Optional)
* Click "Update Settings" to send these settings to the emitter (Leave this window open but you can let it go into the background)
* Click the "Open disply settings" icon button on the main toolbar, and then the checkbox that says "Calibration Mode" at the bottom you can close this window.
* Click the "Open a video file for playback" icon button on the main toolbar, then click the "Select" button next to "Video File" and from the videos directory choose the file "ghosting_test_video_1080p_red_left_blue_right_side_by_side_full.mp4" then click "Open"
* Use F11 or the "Toggle fullscreen" icon button on the main toolbar to make the video fullscreen if it does not automatically go fullscreen
* Perform calibration using the onscreen callibration instructions paying consideration to the following points
  * Position the emitter and trigger boxes.
  * Adjust timing with a goal of either optimizing for zero ghosting (with some minor vignetting at top and bottom) or vignetting (with some minor ghosting at top and bottom).
* When you are happy with the calibration settings you can press the escape key to close the video or F11 to minimize the playback window.
* Next navigate back to the emitter settings window, you should see that "Frame Delay" and "Frame Duration" have no been updated to the optimized values obtained during calibration.
* Click "Save Settings to EEPROM" to make these settings persist next time your power up the 3d emitter.
* Click "Save Settings to Disk" to make a copy of your optimized 3d emitter settings locally incase for whatever reason you decide to experiment with a different type of 3d glasses.
* Click the "Open disply settings" icon button on the main toolbar, and disable the checkbox that says "Calibration Mode", you should see that the "Whitebox Vertical Position" has changed from "0" to whatever value you aligned it with.
* Click "Save Settings to Disk" to make a copy of your optimized display settings locally incase for whatever reason you decide to experiment with a different display.
* Click "Close" on the display settings window.
* Your now done and should be able to watch 3D videos on your OLED!
* Refer to this video for an example using a slightly dated version of the software if you need a demonstration of this proceedure https://youtu.be/tEjXUV8hVDs

### Command Line Interface
3DPlayer supports a simple command line interface for integration into systems like Kodi, if you implement scripts for a video management s ystem please let us know so we can link to them here.
If the "video-path" command line argument is supplied it will auto launch playback of that video using the default settings you have stored from prior usage.
Defaults can be overriden using additionally avaiable command line arguments to support videos with different formats and subtitle files.

Linux (in terminal): python3 3d_player.py --video-path ./videos/ghosting_test_video_1080p_red_left_blue_right_side_by_side_full.mp4 --frame-packing side-by-side-full --right-eye right --display-resolution 1920x1080 Windows (in command prompt): 3d_player.exe --video-path ./videos/ghosting_test_video_1080p_red_left_blue_right_side_by_side_full.mp4 --frame-packing side-by-side-full --right-eye right --display-resolution 1920x1080 3d_player.exe --video-path "C:\open-3d-oled\3DPlayer\videos\ghosting_test_video_1080p_red_left_blue_right_side_by_side_full.mp4" --frame-packing side-by-side-full --right-eye right --display-resolution 1920x1080


## PotPlayer
For those who want the best and most versatile playback performnce on Windows it is recommended to use [PotPlayer](PotPlayer/README.md). 
Click [here](PotPlayer/README.md) for instructions on how to setup and PotPlayer.

## FAQ, Useful Commands and Tips
* The sensor bar once configured does not need to be connected to your PC unless you are using advanced debugging features. It can be connected to the USB power on the back of your TV.
* Supported TVs

Working (Tested)

Computer monitors are a bit more mixed some older and even some newer monitors have +/- 45 degree polarization. With +/- 45 degree polarization I believe your best option for brightness is to use nvidia 3d vision glasses, as glasses with either horizontal or vertical front polarizing film will lose half their brightness. You can verify if your monitor has 45 degree polarization as if you rotate sunglasses to +45 or -45 one of them should make the screen go dark.

The Panasonic (and sony if I remember right) glasses natively require a non-horizontal (perferably vertical) polarizer on the front of the TV to work without flipping the lens. It seems to be very variable even from the same manufacturer and same model for example LG C1 55 has vertical but LG C1 65 has horizontal. My best current guess is that the polarizer film they use the coat the front of the TV's comes on a roll with a width that is slightly too small to fit two 65 inch screens side by side so tehy rotate it vertically to maximize film utilization. If you are unsure about your TV please check using a pair of polaroid sunglasses before purchasing any glasses from me. Cheap polaroid sungless can normally be found at the dollar store for $2 or there abouts. Polaroid sungless have a vertical front polarizer just the same as the Panasonic glasses in their default configuration.

I went to my local electronics store and recorded the polarization of various TV's front polarizers they are listed below, but please double check your TV just to be sure!

HISENSE 43A6K v 50A6K v 65U7H v 65U8N v 65UX v

LG OLED42C3PJA v OLED48B4PJA v OLED55B2PJA v OLED65B2PJA h OLED65B3PJA h

ORION OSW40G10 v

PANASONIC TH-43LF1 v TH-50MR770 v TH-55LW1 v TH-55MZ1800 v TH-65MX950 v TH-75MX950 v TV-42Z85A v TV-43W80A v TV-43W90A v TV-48Z85A v TV-50W90A v TV-55W90A v TV-55Z90A v TV-55Z95A v TV-65W90A v

SHARP 2T-C42BE1 v 4T-C43FN2 v 4T-C43GP2 v 4T-C50FN2 v 4T-C50GP2 v 4T-C55FN2 v 4T-C55EP1 v 4T-C55GN1 v 4T-C55GP1 v 4T-C55GS1 none 4T-C55GN2 v 4T-C65FL1 v 4T-C65FS1 none 4T-C65GN1 v 4T-C65GP1 v 4T-C65GQ1 h 4T-C65GS1 none 4T-C75EL1 v 4T-C75GN1 v 8T-C65DX1 h 8T-C75DX1 v

SONY KJ-43X80L v KJ-43X85K v KJ-50Z80L v KJ-50X85K v K-55XR70 v K-55XR80 v XRJ-48A90K v (maybe none not sure) XRJ-50X95K v XRJ-55A80L v XRJ-55X90L v XRJ-65A95K none XRJ-65X90L v XRJ-65X95L h (not entirely sure about this one) XRJ-75X90L v

TCL 40S5400 v 40S54H v 43C645 v 43P63H v 55C645 v 55P655 v

TOSHIBA REGZA 40V35N v REGZA 43Z570L v REGZA 48X8900N v REGZA 50M550M v REGZA 50Z570L v REGZA 55M550M h REGZA 55Z670N v REGZA 55Z870N v REGZA 55Z870M v REGZA 55X9900N v REGZA 55X8900N v REGZA 65Z670N v REGZA 65Z870N v REGZA 65Z970N v REGZA 65X9900N h REGZA 65X8900N h REGZA 75Z970N v

XIAOMI R23Z012A v R23Z013A v

* If you are using a non OLED display or a display for which settings are not already available it is recommended that you set "OPT101 Ignore All Duplicates" to 1 under Emitter Settings. This will ensure the highest possibility the emitter can synchronize to your TV, at the cost of not being able to detect duplicate frames and inform the glasses to resynchornize immediately. It will typically result in a resynchronization delay of 1-2 frames on a duplicate frame, you may be able to get satisfactory results without using this by tuning "OPT101 Block Signal Detection Delay" and "OPT101 Block N Subsequent Duplicates" to match your display characteristics.
* If you are using an LCD you will want to use HDMI QFT "Quick Frame Transport" (if available) to force a long blanking interval between frames. You basically run the monitor clock at for example 240hz but only send 120hz of data. That way 50% of the time the monitor will not be updating the physical screen. During this time the shutter glasses will open and show an image with minimal ghosting. Take a look at these [instructions](3DPlayer/settings/viewsonic_xg2431/how_to_setup_custom_resolution_with_quick_frame_transport.txt) for more details of how to enable this.

Development Installation Instructions

Windows Developer Install:

  - install msys2 (https://stackoverflow.com/questions/37460073/msys-vs-mingw-internal-environment-variables)
  - follow steps at https://pygobject.readthedocs.io/en/latest/getting_started.html
  - open ucrt64 shell
  - pacman -S git
  - git clone https://github.com/open3doled/open-3d-oled.git 
  - due to potential issues with the latest msys2 packages not working a copy of the latest working pacman database files are provided it is recommended you copy them over if you are having difficulty getting a build to work
    - cp -rf open-3d-oled/3DPlayer/building/msys2_pacman_db_files/* /var/lib/pacman/sync
  - pacman -Su (you can use "pacman -Suy" here to update your database files if you are trying to build using the latest packages otherwise omit the y option) (you will need to restart your ucrt64 shell after this)
  - pacman -Su
  - pacman -S mingw-w64-ucrt-x86_64-gtk4 mingw-w64-ucrt-x86_64-python3 mingw-w64-ucrt-x86_64-python3-pip mingw-w64-ucrt-x86_64-python3-gobject mingw-w64-ucrt-x86_64-python-pygame mingw-w64-ucrt-x86_64-python-pyopengl mingw-w64-ucrt-x86_64-python-pyopengl-accelerate mingw-w64-ucrt-x86_64-python-numpy mingw-w64-ucrt-x86_64-python-cffi mingw-w64-ucrt-x86_64-python-wheel mingw-w64-ucrt-x86_64-python-pillow mingw-w64-ucrt-x86_64-python-pyusb mingw-w64-ucrt-x86_64-python-pyserial 
  - pacman -S mingw-w64-ucrt-x86_64-gstreamer mingw-w64-ucrt-x86_64-gst-devtools mingw-w64-ucrt-x86_64-gst-plugins-base mingw-w64-ucrt-x86_64-gst-plugin-gtk mingw-w64-ucrt-x86_64-gst-plugins-bad mingw-w64-ucrt-x86_64-gst-plugins-bad-libs mingw-w64-ucrt-x86_64-gst-plugins-good mingw-w64-ucrt-x86_64-gst-plugins-ugly mingw-w64-ucrt-x86_64-gst-python mingw-w64-ucrt-x86_64-gst-libav
  - pacman -S mingw-w64-ucrt-x86_64-python-psutil
  - pip install pysrt cairosvg pyinstaller pysdl2
  - building libgstpython.dll (https://gstreamer.freedesktop.org/documentation/installing/building-from-source-using-meson.html?gi-language=python)
    - pacman -S git mingw-w64-ucrt-x86_64-meson-python mingw-w64-ucrt-x86_64-cc mingw-w64-ucrt-x86_64-meson mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-pkg-config mingw-w64-ucrt-x86_64-pygobject-devel mingw-w64-ucrt-x86_64-python
    - git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git
    - cd gstreamer
    - git checkout 1.22.9
    - cd subprojects/gst-python/
    - meson build
    - cd build
    - ninja
    - cp plugin/libgstpython.dll /ucrt64/lib/gstreamer-1.0/libgstpython.dll
  - cd open-3d-oled/3DPlayer
  - fix to ensure gst-plugin-scanner.exe builds a valid gstreamer plugin cache including our python plugin.
    - export PYTHONLEGACYWINDOWSDLLLOADING=1
  - test the application
    - python3 3d_player.py

  - if you run into issues where it says "Unable to find/initialize GStreamer plugin GSTPageflipGLSink." try deleting the gstreamer plugin registry
    - rm "C:\Users\[USERNAME]\AppData\Local\Microsoft\Windows\INetCache\gstreamer-1.0\registry.x86_64-mingw.bin"

  - If you run into issues about "ImportError('DLL load failed while importing _gi: The specified module could not be found.'))" try either of the following
    - export PYTHONLEGACYWINDOWSDLLLOADING=1
    - mv /ucrt64/libexec/gstreamer-1.0/gst-plugin-scanner.exe /ucrt64/libexec/gstreamer-1.0/gst-plugin-scanner.exe.bak

  - If the application fails with an error about Gst bad types make sure you don't have reminants from a pyinstaller build still around
    - rm -rf ~/open-3d-oled/3DPlayer/build
    - rm -rf ~/open-3d-oled/3DPlayer/dist

Windows Standalone Application Build Instructions:

  - The official build system used ot build releases is Windows 10 22H2 with Intel HD Graphics and NVidia Drivers 552.12 (It shouldn't effect anything but it also has Windows WSL2 with all related packages installed)

  - pip install pyinstaller

  - build the 3d_player.spec file (be sure to do this if you update anything as the format may have changed)
  - it used to build fine without '--contents-directory "."' but now it seems to get a bunch of dll import errors without it at least when built under a VM, so you may be able to remove that directive and bundle all internal files in the _internal directory.

  - pyi-makespec \
    3d_player.py \
    --console \
    --onedir \
    --contents-directory "." \
    --hidden-import pygame \
    --hidden-import pygame._sdl2 \
    --hidden-import pygame.locals \
    --hidden-import OpenGL.GL \
    --hidden-import cairocffi \
    --hidden-import 'PIL._tkinter_finder' \
    --icon=.\\images\\movie-player_icon-icons.com_56259.ico

  - add the following to 3d_player.spec after Analysis is defined to ensure necessary images and gstreamer python modules are bundled
    a.datas += Tree('./images', prefix='images')
    a.datas += Tree('./python', prefix='python')

  - build the pyinstaller release dist 
    rm -rf ./dist 
    PYTHONLEGACYWINDOWSDLLLOADING=1 pyinstaller 3d_player.spec

  - to get rid of gstreamer dll warnings on my system
    rm dist/3d_player/OpenGL/DLLS/*32.*
    rm dist/3d_player/OpenGL/DLLS/*.vc9.*
    rm dist/3d_player/OpenGL/DLLS/*.vc10.*

  - copy remaining assets and zip
    cp -R videos dist/3d_player/videos
    cp -R settings dist/3d_player/settings
    rm dist/3d_player/settings/last_display_settings.json
    cp -R firmwares dist/3d_player/firmwares
    cp -R gstreamer_plugins_active /c/3D/3DPlayerWindowsLatest/gstreamer_plugins_active
    cp -R licenses dist/3d_player/licenses
    cp LICENSE dist/3d_player
    cd dist
    zip -r 3d_player.zip 3d_player

  - 3d_player.zip will be the equivalent of the release files available on the releases page.

  - when you are done remove the "dist" and "build" folder under 3DPlayer otherwise it will not run any longer due to finding invalid libraries with some error about Gst bad types.
    rm -rf dist
    rm -rf build

Licenses

Please refer to LICENSE files and license folders for references to open source licenses. If you find any missing licenses please open a support ticket.

Open3DOLED is licensed under CC BY-NC-SA 4.0