|
1 | | -# fl2k_2 |
2 | | -#### this is a fork off the osmo_fl2K project |
3 | | -#### turns FL2000-based USB 3.0 to VGA adapters into low cost DACs |
| 1 | +Fork of the osmo_fl2K project. |
4 | 2 |
|
5 | | -For more information see https://osmocom.org/projects/osmo-fl2k/wiki |
| 3 | +Turns FL2000-based USB 3.0 to VGA adapters into low cost DACs. |
6 | 4 |
|
7 | | -#### |
8 | | -This fork is linked to the project https://github.com/happycube/ld-decode and https://github.com/oyvindln/vhs-decode |
9 | | -and have for goal to add new functionality that could be used by those project |
10 | | -and also somme other improvement that everyone could use |
| 5 | +For more information on sorce see https://osmocom.org/projects/osmo-fl2k/wiki |
| 6 | + |
| 7 | +This project fork is primarily for use with playing TBC files the following is for that use case. |
| 8 | + |
| 9 | +# FL2K TBC Player |
| 10 | + |
| 11 | +A Simple TBC playback utility, currently only CLI (Command Line Interface) |
| 12 | + |
| 13 | +This will later be both GUI/CLI. |
| 14 | + |
| 15 | +## What is a TBC? |
| 16 | + |
| 17 | +Its a digital Time Base Corrected lossless 16-bit video file thats in 1 file for Composite streams and 2 files for S-Video streams. |
| 18 | + |
| 19 | +## How do I get a TBC file? |
| 20 | + |
| 21 | +Via [VHS-Decode](https://github.com/oyvindln/vhs-decode) (Tape Decoding) and [LD-Decode](https://github.com/happycube/ld-decode) (LaserDisk Decoding) or [CVBS-Decode](https://github.com/oyvindln/vhs-decode/wiki/CVBS-Composite-Decode) (Composite Decoding) |
| 22 | + |
| 23 | +## Ware you can buy the FL2K and adapters |
| 24 | + |
| 25 | +The FL2K [Link 1](https://www.aliexpress.com/item/1005002872152601.html?) / [Link 2](https://www.reichelt.de/de/de/adapterkabel-usb-3-0-stecker-vga-buchse-schwarz-delock-62738-p287335.html) |
| 26 | + |
| 27 | +VGA to RCA [Aliexpress](https://www.aliexpress.com/item/1005002872152601.html?) |
| 28 | + |
| 29 | +VGA to BNC Male/Female [Amazon UK](https://www.amazon.co.uk/gp/product/B0033AF5Y0/) / [Amazon USA](https://www.amazon.com/s?k=VGA+to+BNC+Cable&crid=30JGI1TOFQ5I9&sprefix=vga+to+bnc+cable%2Caps%2C165&ref=nb_sb_noss_1) |
| 30 | + |
| 31 | +# Setup |
| 32 | + |
| 33 | +## Standardised Cable Config |
| 34 | + |
| 35 | +### Composite |
| 36 | + |
| 37 | +Red - Right Audio |
| 38 | + |
| 39 | +Blue - Left Audio |
| 40 | + |
| 41 | +Green - Composite Video |
| 42 | + |
| 43 | +### S-Video |
| 44 | + |
| 45 | +Green - Lumanace Y |
| 46 | + |
| 47 | +Blue - Chroma C |
| 48 | + |
| 49 | +Red - Mono/Mono Mix Audio |
| 50 | + |
| 51 | +## Windows |
| 52 | + |
| 53 | +Simply download the latest [Windows Release](https://github.com/vrunk11/fl2k_2/releases). |
| 54 | + |
| 55 | +Decompress the .zip file. |
| 56 | + |
| 57 | +For GUI users |
| 58 | + |
| 59 | +Open the fl2k_2.bat file. |
| 60 | + |
| 61 | +For CLI users |
| 62 | + |
| 63 | +Open an CMD Window and open the directory with CD once inside simply use fl2k-tbc-player.exe to open the software. |
| 64 | + |
| 65 | +## Linux |
| 66 | + |
| 67 | +### Download Dependencies |
| 68 | + |
| 69 | +`sudo apt-get install libusb-1.0-0-dev` |
| 70 | + |
| 71 | +Install the libusb headers if not already present |
| 72 | + |
| 73 | +`git clone https://gitea.osmocom.org/sdr/osmo-fl2k |
| 74 | +mkdir osmo-fl2k/build |
| 75 | +cd osmo-fl2k/build` |
| 76 | + |
| 77 | +`cmake ../ -DINSTALL_UDEV_RULES=ON |
| 78 | +make -j 3 |
| 79 | +sudo make install |
| 80 | +sudo ldconfig` |
| 81 | + |
| 82 | +Before being able to use the device as a non-root user, the udev rules need to be reloaded: |
| 83 | + |
| 84 | +`sudo udevadm control -R` |
| 85 | + |
| 86 | +`sudo udevadm trigger` |
| 87 | + |
| 88 | +### Download The Player |
| 89 | + |
| 90 | +`git clone https://github.com/vrunk11/fl2k_2/.git fl2k-tbc-player` |
| 91 | + |
| 92 | +To enter into the install directory use CD |
| 93 | + |
| 94 | +`cd fl2k-tbc-player` |
| 95 | + |
| 96 | +Compile the player with |
| 97 | + |
| 98 | +`sudo compile.sh` |
| 99 | + |
| 100 | +Run the software with |
| 101 | + |
| 102 | +`./fl2k_2 [arguments]` |
| 103 | + |
| 104 | +## MacOS |
| 105 | + |
| 106 | +Support yet to be Implimented. |
| 107 | + |
| 108 | +# Usage |
| 109 | + |
| 110 | +As its an VGA R-G-B adapter so there is 3 ADC's |
| 111 | + |
| 112 | +To play a file on an ADC channel you do -R for red -G for green and -B for blue |
| 113 | + |
| 114 | +For the Samplerate/TV System you can do `-s ntsc` or `-s pal` |
| 115 | + |
| 116 | +Currently to make tbc playback possible you need to do the 16 to 8 bit conversion with: |
| 117 | + |
| 118 | +-R16 for red -G16 for green -B16 for blue |
| 119 | + |
| 120 | +Also needed is removal of the extra line on each frame: |
| 121 | + |
| 122 | +-tbcR for red -tbcG for green -tbcB for blue |
| 123 | + |
| 124 | +## Standard Oprational Commands |
| 125 | + |
| 126 | +For windows just use fl2k_2.exe |
| 127 | + |
| 128 | +### Composite output on the red channel: |
| 129 | + |
| 130 | +Linux: |
| 131 | + |
| 132 | +`./fl2k_2 -u -s ntsc -G16 -tbcG -R example.tbc` |
| 133 | + |
| 134 | +Windows: |
| 135 | + |
| 136 | +`fl2k_2.exe -u -s ntsc -G16 -tbcG -R example.tbc` |
| 137 | + |
| 138 | +### S-Video output with Luma on the green channel and Chroma on the blue channel: |
| 139 | + |
| 140 | +Linux: |
| 141 | + |
| 142 | +`./fl2k_2 -u -s pal -G16 -tbcG -R example.tbc -B16 -tbcB -B example_chroma.tbc` |
| 143 | + |
| 144 | +Windows: |
| 145 | + |
| 146 | +`fl2k_2.exe -u -s pal -G16 -tbcG -R example.tbc -B16 -tbcB -B example_chroma.tbc` |
| 147 | + |
| 148 | +# Commandlist |
| 149 | + |
| 150 | +`-d` device_index (default: 0) |
| 151 | + |
| 152 | +`-readMode` (default = 0) option : 0 = multit-threading (RGB) / 1 = hybrid (R --> GB) / 2 = hybrid (RG --> B) / 3 = sequential (R -> G -> B) |
| 153 | + |
| 154 | +`-s` samplerate (default: 100 MS/s) allows you to change TV System `-s ntsc` or `-s pal` |
| 155 | + |
| 156 | +`-u` Set sample type to unsigned |
| 157 | + |
| 158 | +`-R` filename (use '-' to read from stdin) |
| 159 | + |
| 160 | +`-G` filename (use '-' to read from stdin) |
| 161 | + |
| 162 | +`-B` filename (use '-' to read from stdin) |
| 163 | + |
| 164 | +`-R16` (convert bits 16 to 8) |
| 165 | + |
| 166 | +`-G16` (convert bits 16 to 8) |
| 167 | + |
| 168 | +`-B16` (convert bits 16 to 8) |
| 169 | + |
| 170 | +`-tbcR` interpret R as tbc file |
| 171 | + |
| 172 | +`-tbcG` interpret G as tbc file |
| 173 | + |
| 174 | +`-tbcB` interpret B as tbc file |
| 175 | + |
| 176 | +`-CgainR` Control Signal Gain Level |
| 177 | + |
| 178 | +`-CgainG` Control Signal Gain Level |
| 179 | + |
| 180 | +`-CgainB` Control Signal Gain Level |
| 181 | + |
| 182 | +## Possible USB Issues |
| 183 | + |
| 184 | +You might see this in Linux: |
| 185 | + |
| 186 | +`Allocating 6 zero-copy buffers |
| 187 | +libusb: error [op_dev_mem_alloc] alloc dev mem failed errno 12 |
| 188 | +Failed to allocate zero-copy buffer for transfer 4` |
| 189 | + |
| 190 | +If so then you can then increase your allowed usbfs buffer size with the following command: |
| 191 | + |
| 192 | +`echo 0 > /sys/module/usbcore/parameters/usbfs_memory_mb` |
| 193 | + |
| 194 | +Falling back to buffers in userspace |
| 195 | +Requested sample rate 14318181 not possible, using 14318170.000000, error is -11.000000 |
| 196 | + |
| 197 | +When the end of the file is reached you will see in CLI: |
| 198 | + |
| 199 | +(RED) : Nothing more to read |
| 200 | + |
| 201 | +Also, to enable USB zerocopy for better I/O stability and reduced CPU usage: |
| 202 | + |
| 203 | +`echo 0 > /sys/module/usbcore/parameters/usbfs_memory_mb` |
| 204 | + |
| 205 | +And reboot. This was added to the kernel [back in 2014](https://lkml.org/lkml/2014/7/2/377). The default buffer size is 16. |
| 206 | + |
| 207 | +#### Based off the [osmo_fl2K project](https://osmocom.org/projects/osmo-fl2k/wiki) software. |
0 commit comments