I've been trying to get this to work for a couple hours already but I still wasn't able to get it to work.
The first issue that I am facing is that when I connect open the website from my capture card to see the video output in the browser (to see if it's actually working) while running the app, I get the following error:
Expression 'ret' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1736
Expression 'AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1904
Expression 'PaAlsaStreamComponent_Initialize( &self->capture, alsaApi, inParams, StreamDirection_In, NULL != callback )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2171
Expression 'PaAlsaStream_Initialize( stream, alsaHostApi, inputParameters, outputParameters, sampleRate, framesPerBuffer, callback, streamFlags, userData )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2839
Traceback (most recent call last):
File "/home/pi/Downloads/poketools/shiny_reset.py", line 101, in <module>
is_shiny = record_and_check_shiny(FREQ, SHINY_AUDIO_FILE, REC_DURATION)
File "/home/pi/Downloads/poketools/shiny_reset.py", line 40, in record_and_check_shiny
game_recording = atf.record_game_sound(freq, recording_duration)
File "/home/pi/Downloads/poketools/audio_template_finder.py", line 13, in record_game_sound
recording = sd.rec(int(duration*freq), samplerate=freq, channels=1)
File "/usr/local/lib/python3.9/dist-packages/sounddevice.py", line 274, in rec
ctx.start_stream(InputStream, samplerate, ctx.input_channels,
File "/usr/local/lib/python3.9/dist-packages/sounddevice.py", line 2576, in start_stream
self.stream = StreamClass(samplerate=samplerate,
File "/usr/local/lib/python3.9/dist-packages/sounddevice.py", line 1415, in __init__
_StreamBase.__init__(self, kind='input', wrap_callback='array',
File "/usr/local/lib/python3.9/dist-packages/sounddevice.py", line 892, in __init__
_check(_lib.Pa_OpenStream(self._ptr, iparameters, oparameters,
File "/usr/local/lib/python3.9/dist-packages/sounddevice.py", line 2741, in _check
raise PortAudioError(errormsg, err)
sounddevice.PortAudioError: Error opening InputStream: Device unavailable [PaErrorCode -9985]
the above error appears after a few seconds, after I see the following (which is the other issue):
my switch has a thing where it checks if the software can be played before it opens the game, when I see the video output from my capture card, I see it being stuck in a low where it tries to open the game, and keeps spamming A, so it closes the popup to check if the game is playable, tries to start the game, closes popup, over and over.