<commit_before>###############
Troubleshooting
###############

=======
General
=======

===
USB
===

cstate handling
===============

For a good overview/introduction read: https://access.redhat.com/articles/65410

The problem boils down to: Setting kernel arguments in grub. This should be used to verify that the problem really has to do with cstates. To do this add

.. code-block:: text
                
   processor.max_cstate=1 idle=poll

to the kernel arguements.

To achieve the same during run time, let this program run. It has to be killed manually to re-enable cstates.

.. code-block:: c

   #include <cstdio>
   #include <errno.h>
   #include <unistd.h>
   #include <cstdlib>
   #include <fcntl.h>
   #include <cstring><commit_msg>doc: Improve troubleshooting sections<commit_after>###############
Troubleshooting
###############

=======
General
=======

A good starting point is to enable logging.
GStreamer logging and tiscamera logging will most likely be helpful.
See :ref:`logging`.

If in doubt, please :any:`contact our support<contact>`. We will gladly answer any questions and help with troubleshooting.

===
USB
===

cstate handling
===============

cstates are a method of CPU power saving. When dealing with realtime processes like video streaming
aggressive power management can cause latency spikes.

For a good overview/introduction read: https://access.redhat.com/articles/65410

The solution boils down to: Setting kernel arguments in grub.
This should be used to verify that the problem really has to do with cstates.
To do this add

.. code-block:: text
                
   processor.max_cstate=1 idle=poll

to the kernel arguments.

To achieve the same during run time, let this program run. It has to be  manually stopped by pressing `Ctrl-C`.
This will re-enable cstates.

.. code-block:: c

   #include <cstdio>
   #include <errno.h>
   #include <unistd.h>
   #include <cstdlib>
   #include <fcntl.h>
   #include <cstring>
{'fraction_non_alphanumeric': 0.13309535951045384, 'fraction_numerical': 0.006119326874043855, 'mean_word_length': 3.86848635235732, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3370360', 'n_tokens_mistral': 593, 'n_tokens_neox': 559, 'n_words': 232}