View Single Post
  #6  
Old 08-20-2023, 05:35 PM
Indefinite Indefinite is offline
Kobold

Indefinite's Avatar

Join Date: Apr 2014
Posts: 142
Default

Quote:
Originally Posted by Sarekrn [You must be logged in to view images. Log in or Register.]
Anytime a sound needs to be played Im getting an error:

File "/home/d00d/.local/lib/python3.9/site-packages/playsound.py", line 261, in <module> │
│ playsound(argv[1]) │
│ File "/home/d00d/.local/lib/python3.9/site-packages/playsound.py", line 162, in _playsoundNix │
│ import gi │
│ File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in <module> │
│ from . import _gi │
│ ImportError: cannot import name '_gi' from partially initialized module 'gi' (most likely due to a circular import) (/usr/lib/python3/dist-packages/gi/__init__.py) │
│ Exception in thread Thread-11: │
│ Traceback (most recent call last): │
│ File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner │
│ self.run() │
│ File "/usr/lib/python3.9/threading.py", line 892, in run │
│ self._target(*self._args, **self._kwargs) │
│ File "/home/ecor1/.local/lib/python3.9/site-packages/playsound.py", line 254, in <lambda> │
│ playsound = lambda sound, block = True: _playsoundAnotherPython('/usr/bin/python3', sound, block, macOS = False) │
│ File "/home/d00d/.local/lib/python3.9/site-packages/playsound.py", line 229, in _playsoundAnotherPython │
│ t.join() │
│ File "/home/d00d/.local/lib/python3.9/site-packages/playsound.py", line 218, in join │
│ say_you │ You say, 'parser timer 60' raise self.excmbered_off │ You are no longer encumbered. │
│ targ File "/home/d00d/.local/lib/python3.9/site-packages/playsound.py", line 211, in run │
│ self.ret = self._target(*self._args, **self._kwargs) │
└───────────────────────────────────────────────── ────────────────────────────────────────────────── ───────────────────────────────────────────── ──── File "/home/d00d/.local/lib/python3.9/site-packages/playsound.py", line 226, in <lambda>
t = PropogatingThread(target = lambda: check_call([otherPython, playsoundPath, _handlePathOSX(sound) if macOS else sound]))
File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3', '/home/ecor1/.local/lib/python3.9/site-packages/playsound.py', '/tmp/eqa/sound/b4d2431a1ceabf47a18fe36ed9606f6e.wav']' returned non-zero exit status 1.

Any ideas?
`playsound` seemingly has a handful of Linux system package dependencies. Check if you're missing anything in the below list:
https://github.com/mgeitz/eqalert/bl...erfile#L17-L40

You may also need to install pygobject.

If you're running eqalert on a mac I'm not too sure though I know playsound should support mac as well.

If all else fails, as a last ditch effort if you've got docker installed I'd suggest trying out the docker image instead. The compose file assumes pulse audio running on the host, so I'd be interested to know if it could run on a mac.

I'm definitely planning to replace playsound with another cross platform solution down the road, the errors are vague and it hasn't seen active development in two years. If you've built locally and have another preferred way to play sound files this is only called in one place:
https://github.com/mgeitz/eqalert/bl.../sound.py#L294
__________________
Last edited by Indefinite; 08-20-2023 at 05:37 PM..
Reply With Quote