Standard-Intelligence / hertz-dev

first base model for full-duplex conversational audio
https://si.inc
Apache License 2.0
1.58k stars 102 forks source link

Undefined external error #3

Open SoftologyPro opened 2 weeks ago

SoftologyPro commented 2 weeks ago

This is Windows. Server started in it's own command prompt. Shows "Using device CUDA" Clent started in a separate command prompt. I press enter for defaults. Gives this error...

Enter the index of the input device or press enter for default:
Enter the index of the output device or press enter for default:
Traceback (most recent call last):
  File "D:\Tests\Hertz-Dev\hertz-dev\inference_client.py", line 159, in <module>
    client.start()
  File "D:\Tests\Hertz-Dev\hertz-dev\inference_client.py", line 121, in start
    with sd.InputStream(callback=self.audio_callback,
  File "D:\Tests\Hertz-Dev\hertz-dev\venv\lib\site-packages\sounddevice.py", line 1440, in __init__
    _StreamBase.__init__(self, kind='input', wrap_callback='array',
  File "D:\Tests\Hertz-Dev\hertz-dev\venv\lib\site-packages\sounddevice.py", line 909, in __init__
    _check(_lib.Pa_OpenStream(self._ptr, iparameters, oparameters,
  File "D:\Tests\Hertz-Dev\hertz-dev\venv\lib\site-packages\sounddevice.py", line 2794, in _check
    raise PortAudioError(errormsg, err, hosterror_info)
sounddevice.PortAudioError: Error opening InputStream: Unanticipated host error [PaErrorCode -9999]: 'Undefined external error.' [MME error 1]

If I specify input and output device IDs for my headset I get

Traceback (most recent call last):
  File "D:\Tests\Hertz-Dev\hertz-dev\inference_client.py", line 159, in <module>
    client.start()
  File "D:\Tests\Hertz-Dev\hertz-dev\inference_client.py", line 121, in start
    with sd.InputStream(callback=self.audio_callback,
  File "D:\Tests\Hertz-Dev\hertz-dev\venv\lib\site-packages\sounddevice.py", line 1440, in __init__
    _StreamBase.__init__(self, kind='input', wrap_callback='array',
  File "D:\Tests\Hertz-Dev\hertz-dev\venv\lib\site-packages\sounddevice.py", line 909, in __init__
    _check(_lib.Pa_OpenStream(self._ptr, iparameters, oparameters,
  File "D:\Tests\Hertz-Dev\hertz-dev\venv\lib\site-packages\sounddevice.py", line 2794, in _check
    raise PortAudioError(errormsg, err, hosterror_info)
sounddevice.PortAudioError: Error opening InputStream: Unanticipated host error [PaErrorCode -9999]: 'DirectSound error' [Windows DirectSound error -2147467259]

This is the defaults it selects and all options.

Audio Device Configuration:
--------------------------------------------------
Default Input Device:
{'name': 'Microphone (Logitech USB Headse', 'index': 1, 'hostapi': 0, 'max_input_channels': 2, 'max_output_channels': 0, 'default_low_input_latency': 0.09, 'default_low_output_latency': 0.09, 'default_high_input_latency': 0.18, 'default_high_output_latency': 0.18, 'default_samplerate': 44100.0}

Default Output Device:
{'name': 'Speakers (Logitech USB Headset ', 'index': 3, 'hostapi': 0, 'max_input_channels': 0, 'max_output_channels': 2, 'default_low_input_latency': 0.09, 'default_low_output_latency': 0.09, 'default_high_input_latency': 0.18, 'default_high_output_latency': 0.18, 'default_samplerate': 44100.0}

All Available Devices:
--------------------------------------------------
Device 0:
Name: Microsoft Sound Mapper - Input
Channels (in/out): 2/0
Sample Rates: 44100.0

Device 1:
Name: Microphone (Logitech USB Headse
Channels (in/out): 2/0
Sample Rates: 44100.0

Device 2:
Name: Microsoft Sound Mapper - Output
Channels (in/out): 0/2
Sample Rates: 44100.0

Device 3:
Name: Speakers (Logitech USB Headset
Channels (in/out): 0/2
Sample Rates: 44100.0

Device 4:
Name: 27MU67 (NVIDIA High Definition
Channels (in/out): 0/2
Sample Rates: 44100.0

Device 5:
Name: Digital Audio (S/PDIF) (High De
Channels (in/out): 0/2
Sample Rates: 44100.0

Device 6:
Name: 27MU67 (NVIDIA High Definition
Channels (in/out): 0/2
Sample Rates: 44100.0

Device 7:
Name: Primary Sound Capture Driver
Channels (in/out): 2/0
Sample Rates: 44100.0

Device 8:
Name: Microphone (Logitech USB Headset H540)
Channels (in/out): 2/0
Sample Rates: 44100.0

Device 9:
Name: Primary Sound Driver
Channels (in/out): 0/2
Sample Rates: 44100.0

Device 10:
Name: Speakers (Logitech USB Headset H540)
Channels (in/out): 0/2
Sample Rates: 44100.0

Device 11:
Name: 27MU67 (NVIDIA High Definition Audio)
Channels (in/out): 0/2
Sample Rates: 44100.0

Device 12:
Name: Digital Audio (S/PDIF) (High Definition Audio Device)
Channels (in/out): 0/2
Sample Rates: 44100.0

Device 13:
Name: 27MU67 (NVIDIA High Definition Audio)
Channels (in/out): 0/2
Sample Rates: 44100.0

Device 14:
Name: 27MU67 (NVIDIA High Definition Audio)
Channels (in/out): 0/2
Sample Rates: 48000.0

Device 15:
Name: Digital Audio (S/PDIF) (High Definition Audio Device)
Channels (in/out): 0/2
Sample Rates: 48000.0

Device 16:
Name: Speakers (Logitech USB Headset H540)
Channels (in/out): 0/2
Sample Rates: 48000.0

Device 17:
Name: 27MU67 (NVIDIA High Definition Audio)
Channels (in/out): 0/2
Sample Rates: 48000.0

Device 18:
Name: Microphone (Logitech USB Headset H540)
Channels (in/out): 2/0
Sample Rates: 48000.0

Device 19:
Name: SPDIF Out (HD Audio SPDIF out)
Channels (in/out): 0/2
Sample Rates: 44100.0

Device 20:
Name: Output (NVIDIA High Definition Audio)
Channels (in/out): 0/2
Sample Rates: 48000.0

Device 21:
Name: Output (NVIDIA High Definition Audio)
Channels (in/out): 0/2
Sample Rates: 48000.0

Device 22:
Name: Microphone (Logitech USB Headset H540)
Channels (in/out): 2/0
Sample Rates: 44100.0

Device 23:
Name: Speakers (Logitech USB Headset H540)
Channels (in/out): 0/2
Sample Rates: 44100.0

Any ideas to get this working?

SoftologyPro commented 2 weeks ago

OK, I got a little further. The initial errors were due to my microphone security settings disabling mic access. So for anyone else with those errors, check microphone security settings in WIndows. Now that that is turned on (and I confirmed record works in other apps) it gets a little further, but still has this error when the client starts (and I press enter for defaults)

Enter the index of the input device or press enter for default:
Enter the index of the output device or press enter for default:
Traceback (most recent call last):
  File "D:\Tests\Hertz-Dev\hertz-dev\inference_client.py", line 159, in <module>
    client.start()
  File "D:\Tests\Hertz-Dev\hertz-dev\inference_client.py", line 132, in start
    asyncio.run(self.process_audio())
  File "D:\Python\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "D:\Python\lib\asyncio\base_events.py", line 649, in run_until_complete
    return future.result()
  File "D:\Tests\Hertz-Dev\hertz-dev\inference_client.py", line 69, in process_audio
    async with websockets.connect(self.server_url) as ws:
  File "D:\Tests\Hertz-Dev\hertz-dev\venv\lib\site-packages\websockets\legacy\client.py", line 635, in __aenter__
    return await self
  File "D:\Tests\Hertz-Dev\hertz-dev\venv\lib\site-packages\websockets\legacy\client.py", line 654, in __await_impl__
    _transport, protocol = await self._create_connection()
  File "D:\Python\lib\asyncio\base_events.py", line 1081, in create_connection
    raise exceptions[0]
  File "D:\Python\lib\asyncio\base_events.py", line 1060, in create_connection
    sock = await self._connect_sock(
  File "D:\Python\lib\asyncio\base_events.py", line 969, in _connect_sock
    await self.sock_connect(sock, address)
  File "D:\Python\lib\asyncio\proactor_events.py", line 709, in sock_connect
    return await self._proactor.connect(sock, address)
  File "D:\Python\lib\asyncio\windows_events.py", line 826, in _poll
    value = callback(transferred, key, ov)
  File "D:\Python\lib\asyncio\windows_events.py", line 613, in finish_connect
    ov.getresult()
ConnectionRefusedError: [WinError 1225] The remote computer refused the network connection

Server refused connection? Am I running these the right way? ie server in one cmd.exe window, client in another cmd.exe window.

calculating commented 2 weeks ago

windows is untested atm, my guess is something with the firewall. we'll have a chance to test soon, till then please let us know if you find a solution