myorangedragon / longmynd

An Open Source Linux ATV receiver
GNU General Public License v3.0
25 stars 16 forks source link

Move TS FIFO Handling to dedicated pthread #7

Closed philcrump closed 4 years ago

philcrump commented 5 years ago

Different interfaces on a single USB device can be opened simultaneously from different applications. This change takes advantage of this to open the interface associated with the TS stream in a seperate context to the I2C interface, and use the TS context within a dedicated thread.

To achieve this, the USB context creation and configuration has been abstracted to take pointers to the context and interface variables, and a pair of functions inserted to call the creation with the correct relevant variables.

After removing the TS fifo handling from the main thread, the report chunking has been removed and a timer inserted that currently runs the full report and decision loop every ~100ms, sleeping at least 10ms each loop.

This has been tested by Dave G8GKQ and found to work well with 2MS high-bitrate signals on the Portsdown 2019.