fluendo / fluster

Testing framework for decoders conformance

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

terminal: input characters echoing is broken after running a test suite

dabrain34 opened this issue · comments

The linux terminal does not echo the input characters after running a full test suite run such as:

./fluster.py run -ts JCT-VC-HEVC_V1

Need stty sane to be executed to get back a usable terminal

Thanks for reporting, i can reproduce it! We will take a look into it.

I can not reproduce with Alacritty, only with GNOME Terminal.

I can not reproduce with Alacritty+ZSH. Only with BASH (Alacritty or GNOME Terminal)

In my case, a Intel laptop, it is related to OpenGL/VAAPI backend for VDPAU and FFmpeg-H.265-VDPAU decoder.

It can be reproduced only with the following command:

./fluster.py run -ts JCT-VC-HEVC_V1 -d FFmpeg-H.265-VDPAU  -tv AMVP_A_MTK_4 CONFWIN_A_Sony_1 TSUNEQBD_A_MAIN10_Technicolor_2  > /dev/null 2> /dev/null

Do you have an Intel GPU and libvdpau-va-gl1 installed?

My computer owns an Intel GPU indeed

I dont have libvdpau-va-gl1installed in my ubuntu 22.04 setup.

The following command is also reproducing the issue
./fluster.py run -ts JCT-VC-HEVC_V1 -d FFmpeg-H.265-VDPAU -tv AMVP_A_MTK_4 CONFWIN_A_Sony_1 TSUNEQBD_A_MAIN10_Technicolor_2

@dabrain34 are you using bash or zsh? Trying to narrow down the issue...

I'm using bash

I was able to isolate the problem in this small piece of code. On my laptop the error is not deterministic, it fails less than half of the time.

from multiprocessing import Pool
from unittest.result import TestResult
from time import perf_counter
import subprocess


jobs=3
failfast=False
timeout=30
verbose=True
tests = [1,2,3]

def run_command(command, verbose = False, check = True, timeout = None):
    """Runs a command"""
    sout = subprocess.DEVNULL if not verbose else None
    serr = subprocess.DEVNULL if not verbose else None
    if verbose:
        print(f'\nRunning command "{" ".join(command)}"')
    try:
        subprocess.run(command, stdout=sout, stderr=serr, check=check, timeout=timeout)
    except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as ex:
        raise ex


def _run_worker(test):
    print("running", test)
    cmd = ['ffmpeg']
    out = run_command(cmd, timeout=timeout, verbose=verbose)
    return out


with Pool(jobs) as pool:

    def _callback(test_result) -> None:
        print(
            test_result,
            flush=True,
        )
        if failfast:
            pool.terminate()

    start = perf_counter()
    for test in tests:
        pool.apply_async(_run_worker, (test,), callback=_callback)
    pool.close()
    pool.join()

It looks like you have multiple ffmpeg processes racing each other to save and restore tty settings. I believe the -nostdin option should avoid this.

I asked in help-bash mail list [1]. And the community did the work ❤️

@dabrain34 and @mdimopoulos can you check solution of PR #164 ?

[1] https://lists.gnu.org/archive/html/help-bash/2024-02/msg00084.html