py-gpt icon indicating copy to clipboard operation
py-gpt copied to clipboard

Unable to open the microphone

Open kernelhacks opened this issue 1 year ago • 11 comments

Hi I'm unable to open the MIC on the APP, this is the error

Exception: [Errno -9996] Invalid input device (no default output device) Type: OSErrorMessage: [Errno -9996] Invalid input device (no default output device) Traceback: File "/snap/pygpt/238/src/pygpt_net/plugin/audio_input/simple.py", line 88, in start_recording self.stream = self.p.open(format=pyaudio.paInt16, File "/snap/pygpt/238/lib/python3.10/site-packages/pyaudio/init.py", line 639, in open stream = PyAudio.Stream(self, *args, **kwargs) File "/snap/pygpt/238/lib/python3.10/site-packages/pyaudio/init.py", line 441, in init self._stream = pa.open(**arguments)

I thought that the issues were related to Pyaudio so I tested the Pyaudio library with a little script to record my voice and is working, so I'm not sure what is causing this. My Environment: OS: Ubuntu 22.04.4 LTS CPU: Intel® Xeon(R) CPU E5-2690 v4 @ 2.60GHz × 56 Mem: 128 Python Ver: 3

kernelhacks avatar Jun 14 '24 05:06 kernelhacks

I ran the source code, and it is working fine. it seems that the snap installation process has the issues described above.

kernelhacks avatar Jun 14 '24 05:06 kernelhacks

Try this:

sudo snap connect pygpt:audio-record :audio-record

szczyglis-dev avatar Nov 14 '24 05:11 szczyglis-dev

me neither. I have tried snap and python installation with python 3.11.6 and no way.

Audio Input: Exception: 'NoneType' object has no attribute 'agent_call'
Type: AttributeErrorMessage: 'NoneType' object has no attribute 'agent_call'
Traceback:   File "/home/user/.pyenv/versions/3.11.6/envs/my-pygpt-env/lib/python3.11/site-packages/pygpt_net/plugin/audio_input/worker.py", line 82, in handle_simple
    self.response(transcript)
  File "/home/user/.pyenv/versions/3.11.6/envs/my-pygpt-env/lib/python3.11/site-packages/typing_extensions.py", line 2853, in wrapper
    return arg(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.pyenv/versions/3.11.6/envs/my-pygpt-env/lib/python3.11/site-packages/pygpt_net/plugin/base/worker.py", line 74, in response
    self.reply(response, extra_data)
  File "/home/user/.pyenv/versions/3.11.6/envs/my-pygpt-env/lib/python3.11/site-packages/pygpt_net/plugin/base/worker.py", line 84, in reply
    if self.ctx.agent_call and self.plugin is not None:
       ^^^^^^^^^^^^^^^^^^^

System Report Details

Report Details

  • Generated Date: 2024-11-20 19:45:53

Hardware Information:

  • Hardware Model: MEDION H81H3-EM2
  • Memory: 16.0 GiB
  • Processor: Intel® Core™ i7-4790 × 8
  • Graphics: NVIDIA GeForce GTX 745
  • Disk Capacity: 480.1 GB

Software Information:

  • Firmware Version: H81EM2W08.309
  • OS Name: Ubuntu 24.04.1 LTS
  • OS Build: (null)
  • OS Type: 64-bit
  • GNOME Version: 46
  • System Windows: X11
  • Kernel version: Linux 6.8.0-48-generic

077531 avatar Nov 20 '24 18:11 077531

Please try again, the bug mentioned above has been fixed in recent versions (although it has nothing to do with microphone access, and connecting slots in the Snap version is still necessary).

szczyglis-dev avatar Nov 22 '24 04:11 szczyglis-dev

damn me too i tried hours of troubleshooting. i guess i will look for alternative. jpegg files arent working either. This program worked yesterday on manjaro. Awsome program too

di4megit avatar Dec 07 '24 17:12 di4megit

Has anyone figured this audio issue out yet...??? i am also having an issue just using the basic Chat feature in gpt-4o, or gpt-4, getting this error =

Error code: 404 - {'error': {'message': 'The model gpt-4o does not exist or you do not have access to it.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}

...and this is what i get when trying the audio input =

Exception: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Type: TypeErrorMessage: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' Traceback: File "/snap/pygpt/338/src/pygpt_net/plugin/audio_input/simple.py", line 88, in start_recording device_id = int(self.plugin.window.core.config.get('audio.input.device', 0))

....and when i go to setting in PyGPT there is no mic to chose from, but yet in the OS settings i see all the mics and they work fine on every other program using a mic....

...and i do use the - sudo snap connect pygpt:audio-record :audio-record ...and still no mic shows up or works....HELP PLEASE...!!!

My OS = Zorin OS 17.2 Pro/Ubuntu based AMD® Ryzen 7 5700g with radeon graphics × 16 RENOIR (renoir, LLVM 15.0.7, DRM 3.57, 6.8.0-50-generic) Windows System X11 MEM = 32gb Latest Update Latest Kernel

gitme1now avatar Jan 01 '25 17:01 gitme1now

Just to chime in, the no Mic issue is still hitting me with the snap install on Mint 22. Version: 2.4.46, Linux, x86_64 (snap) Build: 2024-12-16 OpenAI API: 1.55.1, LangChain: 0.2.16, LlamaIndex: 0.10.67

Will test against a manual compile when I have some spare time.

Guyverix avatar Jan 02 '25 18:01 Guyverix

is this NOT the place to go for support...???? Don't seem to be getting any at all here....

gitme1now avatar Jan 13 '25 19:01 gitme1now

Try to connect Alsa if this is not connected yet:

sudo snap connect pygpt:alsa

and

sudo snap connect pygpt:audio-record :audio-record

szczyglis-dev avatar Jan 16 '25 17:01 szczyglis-dev

I have submitted a request for auto-connecting the alsa and audio-record interfaces to Canonical/Snapcraft:

https://forum.snapcraft.io/t/request-auto-connect-for-snap-pygpt/44708

Waiting for the Snapcraft team to consider it.

szczyglis-dev avatar Jan 19 '25 13:01 szczyglis-dev

I think my problem is related: https://github.com/szczyglis-dev/py-gpt/issues/128

sgavka avatar Aug 05 '25 07:08 sgavka