Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mixer capability checks #26

Closed
emphasize opened this issue Dec 20, 2023 · 2 comments · Fixed by #28
Closed

Add mixer capability checks #26

emphasize opened this issue Dec 20, 2023 · 2 comments · Fixed by #28
Labels
bug Something isn't working

Comments

@emphasize
Copy link
Member

emphasize commented Dec 20, 2023

Taken from a @goldyfruit matrix conversation

deplovment method: docker
sound device: Google Voice HAT

2023-12-19 18:32:03.734 - PHAL - ovos_bus_client.session:from_message:471 - WARNING - No session context in message:mycroft.volume.get
2023-12-19 18:32:03.737 - PHAL - ovos_bus_client.session:from_message:472 - DEBUG - Update ovos-bus-client or add `session` to `message.context` where emitted. context={}
exception calling callback for <Future at 0x7fa61bff90 state=finished raised ALSAAudioError>
Traceback (most recent call last):
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 340, in _invoke_callbacks
    callback(self)
  File "/home/ovos/.venv/lib/python3.11/site-packages/pyee/_executor.py", line 57, in _callback
    self.emit("error", exc)
  File "/home/ovos/.venv/lib/python3.11/site-packages/pyee/_base.py", line 118, in emit
    self._emit_handle_potential_error(event, args[0] if args else None)
  File "/home/ovos/.venv/lib/python3.11/site-packages/pyee/_base.py", line 88, in _emit_handle_potential_error
    raise error
  File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/.venv/lib/python3.11/site-packages/ovos_PHAL_plugin_alsa/__init__.py", line 113, in handle_volume_request
    "muted": self.alsa.is_muted()}))
             ^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/.venv/lib/python3.11/site-packages/ovos_PHAL_plugin_alsa/__init__.py", line 223, in is_muted
    return bool(self.mixer.getmute()[0])
                ^^^^^^^^^^^^^^^^^^^^
alsaaudio.ALSAAudioError: Mixer Master,0 has no playback switch capabilities, [default]

Add capability checks to prevent this behaviour

@goldyfruit
Copy link
Member

Got this one as well when trying to save the STT audio file.

2023-12-21 10:14:37.262 - HiveMind-voice-sat - ovos_dinkum_listener.service:_hotword_audio:600 - ERROR - Error while saving STT audio
Traceback (most recent call last):
  File "/home/hivemind/.venv/lib/python3.11/site-packages/ovos_dinkum_listener/service.py", line 572, in _hotword_audio
    self.bus.emit(Message("mycroft.audio.play_sound",
  File "/home/hivemind/.venv/lib/python3.11/site-packages/hivemind_bus_client/client.py", line 277, in emit
    self.internal_bus.emit(message.payload)
  File "/home/hivemind/.venv/lib/python3.11/site-packages/ovos_utils/messagebus.py", line 61, in emit
    self.ee.emit(message.msg_type, message)
  File "/home/hivemind/.venv/lib/python3.11/site-packages/pyee/_base.py", line 115, in emit
    handled = self._call_handlers(event, args, kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hivemind/.venv/lib/python3.11/site-packages/pyee/_base.py", line 98, in _call_handlers
    self._emit_run(f, args, kwargs)
  File "/home/hivemind/.venv/lib/python3.11/site-packages/pyee/_base.py", line 83, in _emit_run
    f(*args, **kwargs)
  File "/home/hivemind/.venv/lib/python3.11/site-packages/ovos_audio/service.py", line 484, in handle_instant_play
    volume_poll: Message = self.bus.wait_for_response(Message("mycroft.volume.get"))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hivemind/.venv/lib/python3.11/site-packages/hivemind_bus_client/client.py", line 381, in wait_for_response
    self.emit(message)
  File "/home/hivemind/.venv/lib/python3.11/site-packages/hivemind_bus_client/client.py", line 277, in emit
    self.internal_bus.emit(message.payload)
  File "/home/hivemind/.venv/lib/python3.11/site-packages/ovos_utils/messagebus.py", line 61, in emit
    self.ee.emit(message.msg_type, message)
  File "/home/hivemind/.venv/lib/python3.11/site-packages/pyee/_base.py", line 115, in emit
    handled = self._call_handlers(event, args, kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hivemind/.venv/lib/python3.11/site-packages/pyee/_base.py", line 98, in _call_handlers
    self._emit_run(f, args, kwargs)
  File "/home/hivemind/.venv/lib/python3.11/site-packages/pyee/_base.py", line 83, in _emit_run
    f(*args, **kwargs)
  File "/home/hivemind/.venv/lib/python3.11/site-packages/ovos_PHAL_plugin_alsa/__init__.py", line 113, in handle_volume_request
    "muted": self.alsa.is_muted()}))
             ^^^^^^^^^^^^^^^^^^^^
  File "/home/hivemind/.venv/lib/python3.11/site-packages/ovos_PHAL_plugin_alsa/__init__.py", line 223, in is_muted
    return bool(self.mixer.getmute()[0])
                ^^^^^^^^^^^^^^^^^^^^
alsaaudio.ALSAAudioError: Mixer Master,0 has no playback switch capabilities, [default]

@JarbasAl JarbasAl added the bug Something isn't working label Dec 21, 2023
@goldyfruit
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants