Commit graph

4150 commits

Author SHA1 Message Date
2c197c275e [assistant.picovoice] Implemented mic mute/unmute handling. 2024-05-02 00:51:09 +00:00
9de49c71a1 [assistant.picovoice] Conversation flow improvements.
- The `Responding` state should be modelled as an extra event/binary
  flag, not as an assistant state. The assistant may be listening for
  hotwords even while the `tts` plugin is responding, and we don't want
  the two states to interfere with each either - neither to build a more
  complex state machine that also needs to take concurrent states into
  account.

- Stop any responses being rendered upon the `tts` plugin when a new
  hotword audio is detected. If e.g. I say "Ok Google", I should always
  be able to trigger the assistant and stop any concurrent audio
  process.

- `SpeechRecognizedEvent` should be emitted even if `cheetah`'s latest
  audio frame results weren't marked as final, and the speech detection
  window timed out. Cheetah's `is_final` detection seems to be quite
  buggy sometimes, and it may not properly detect the end of utterances,
  especially with non-native accents. The workaround is to flush out
  whatever text is available (if at least some speech was detected) into
  a `SpeechRecognizedEvent` upon timeout.
2024-05-02 00:51:09 +00:00
a6f7b6e790 Added more default imports under the platypush module root.
These objects can now also be imported in scripts through
`from platypush import <name>`:

- `Variable`
- `cron`
- `hook`
- `procedure`
2024-05-02 00:51:09 +00:00
aa333db05c [assistant.picovoice] More features.
- Added wiring between `assistant.picovoice` and `tts.picovoice`.

- Added `RESPONDING` status to the assistant.

- Added ability to override the default speech model upon
  `start_conversation`.

- Better handling of conversation timeouts.

- Cache Cheetah objects in a `model -> object` map - at least the
  default model should be pre-loaded, since model loading at runtime
  seems to take a while, and that could impact the ability to detect the
  speech in the first seconds after a hotword is detected.
2024-05-02 00:51:09 +00:00
af875c996e Added tts.picovoice plugin. 2024-05-02 00:51:09 +00:00
a4c911a5d7 Added ffmpeg requirement for assistant.picovoice. 2024-05-02 00:51:09 +00:00
8193c5702c s/partial_transcript/transcript/g 2024-05-02 00:51:09 +00:00
8378bee7c6 Refactored AssistantEvent.
`AssistantEvent.assistant` is now modelled as an opaque object that
behaves the following way:

- The underlying plugin name is saved under `event.args['_assistant']`.

- `event.assistant` is a property that returns the assistant instance
  via `get_plugin`.

- `event.assistant` is reported as a string (plugin qualified name) upon
  event dump.

This allows event hooks to easily use `event.assistant` to interact with
the underlying assistant and easily modify the conversation flow, while
event hook conditions can still be easily modelled as equality
operations between strings.
2024-05-02 00:51:09 +00:00
a670f01647 [assistant.picovoice] Better partial transcript + flush handling logic. 2024-05-02 00:51:09 +00:00
921025be0c picovoice -> assistant.picovoice 2024-05-02 00:51:09 +00:00
bb38f2439c Better integration with the native base API of the assistant plugin. 2024-05-02 00:51:09 +00:00
f7517eb321 [WIP] Added speech detection logic over Cheetah. 2024-05-02 00:51:09 +00:00
a9498ea191 [WIP] Added initial hotword integration. 2024-05-02 00:51:09 +00:00
44f9c03bf3 [#304] Removed old Picovoice integrations 2024-05-02 00:51:09 +00:00
98c99c7888
[Automatic] Updated components cache
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-17 02:09:18 +00:00
e123463804
[media.chromecast] Refactored implementation.
All checks were successful
continuous-integration/drone/push Build is passing
Explicitly use a `CastBrowser` object initialized at plugin boot instead
of relying on blocking calls to `pychromecast.get_chromecasts`.

1. It enables better event handling via callbacks instead of
   synchronously waiting for scan batches.

2. It optimizes resources - only one Zeroconf and one CastBrowser object
   will be created in the plugin, and destroyed upon stop.

3. No need for separate `get_chromecast`/`_refresh_chromecasts` methods:
   all the scanning is run continuously, so we can just return the
   results from the maps.
2024-04-17 03:56:45 +02:00
f99f6bdab9
[media.chromecast] Resource clean up + new API adaptations.
All checks were successful
continuous-integration/drone/push Build is passing
- `pychromecast.get_chromecasts` returns both a list of devices and a
  browser object. Since the Chromecast plugin is the most likely culprit
  of the excessive number of open MDNS sockets, it seems that we may
  need to explicitly stop discovery on the browser and close the
  ZeroConf object after the discovery is done.

- I was still using an ancient version of pychromecast on my RPi4, and I
  didn't notice that more recent versions implemented several breaking
  changes. Adapted the code to cope with those changes.
2024-04-17 02:49:31 +02:00
4972c8bdcf
Unregister a Zeroconf instance if it already exists before publishing a backend service.
All checks were successful
continuous-integration/drone/push Build is passing
`mdns` connection are another culprit for the increasing number of open
files in the process.
2024-04-16 00:12:55 +02:00
33d4c8342d
[#389] Possible fix for "Too many open files" media issue.
All checks were successful
continuous-integration/drone/push Build is passing
It seems that the process keeps a lot of open connections to Chromecast
devices during playback.

The most likely culprit is the `_refresh_chromecasts` logic.

We should start a `cast` object and register a status listener only if a
Chromecast with the same identifier isn't already registered in the
plugin.
2024-04-15 23:01:10 +02:00
027bcea612
[Automatic] Updated components cache
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-08 21:05:46 +00:00
b4d0716bc5
Added layer of compatibility with both paho.mqtt >= 2.0.0 and < 2.0.0.
See 28aa2e6b26/ChangeLog.txt (L6)
2024-04-08 23:01:54 +02:00
584f226b62 mqtt CallbackAPIVersion fix for paho.mqtt >= 2.0.0
fix to work with paho.mqtt >= 2.0.0
2024-04-08 16:05:27 +02:00
dba0acb82e
[Automatic] Updated components cache
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-05 18:57:53 +00:00
a026a101cd
Removed stt.deepspeech integration.
All checks were successful
continuous-integration/drone/push Build is passing
The project hasn't seen a commit in three years and it's probably been
abandoned by Mozilla.

New and better maintained speech-to-text integrations will be
investigated.
2024-04-05 20:56:45 +02:00
b00623f655
[Automatic] Updated UI files
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-05 02:00:03 +00:00
03765ad652
[UI] Better style for music widget.
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-05 03:58:12 +02:00
96f3420c8e
[Automatic] Updated components cache
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-05 01:47:09 +00:00
c31180dae8
[music.mopidy] Fixed parsing of new_state upon playback_state_changed.
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-05 03:46:01 +02:00
b1498bfc28
[Automatic] Updated components cache
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-05 01:41:38 +00:00
083c9e250e
[music.mopidy] Better handling of client events.
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-05 03:40:27 +02:00
88ffc3b795
[Automatic] Updated components cache
Some checks reported errors
continuous-integration/drone/push Build was killed
2024-04-05 00:56:48 +00:00
5f6fd4aa54
Added --db CLI option and support for configuration over environment.
All checks were successful
continuous-integration/drone/push Build is passing
Closes: #280
2024-04-05 02:54:45 +02:00
c8361aa475
[Automatic] Updated components cache
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-04 00:53:18 +00:00
496a3f4911 Updated docs 2024-04-04 00:52:30 +00:00
d2ec93b798 [#297] Removed music.spotify backend.
1. I no longer I use a Spotify account (I switched to Tidal after
   Spotify deprecated libspotify), and I wouldn't like to create one
   just to test this integration.

2. After a couple of years, the libspotify open fork (Librespot) seems
   to be still in an unstable stage and it's already been discontinued
   once - I would avoid rebuilding the integration against a dependency
   that may change a lot in the near future.
2024-04-04 00:52:30 +00:00
73cc47b964
[Automatic] Updated UI files
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-03 23:57:10 +00:00
787b6a6af6
[UI] A more consistent light style for the music widget.
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-04 01:54:52 +02:00
6f24504cc4
[Automatic] Updated UI files
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-03 23:11:49 +00:00
5d9a201a5b
[#297] Mopidy/MPD refactor+migration, UI side.
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-04 01:07:05 +02:00
e2246c8d30
[Automatic] Updated components cache
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-03 23:02:09 +00:00
58518a4d63 Better timeout management on mopidy status refresh. 2024-04-03 23:01:22 +00:00
5346833152 [WIP] API adaptations for music.mpd 2024-04-03 23:01:22 +00:00
89d618b35f [WIP] music.mopidy refactor, initial backend rewrite. 2024-04-03 23:01:22 +00:00
d2e5e5230b [music.mpd] Removed deprecated actions.
- `setvol` ➡️  `set_volume`
- `seekcur` ➡️  `seek`
- `playlistinfo` ➡️  `get_tracks`
- `listplaylists` ➡️  `get_playlists`
- `listplaylist` ➡️  `get_playlist`
- `listplaylistinfo` ➡️  `get_playlist`
- `playlistadd` ➡️  `add_to_playlist`
- `playlistdelete` ➡️  `remove_from_playlist`
- `playlistmove` ➡️  `playlist_move`
- `playlistclear` ➡️  `playlist_clear`
- `rename` ➡️  `rename_playlist`
- `rm` ➡️  `delete_playlist`

stuff
2024-04-03 23:01:22 +00:00
a3b6d411e4 [music.mpd] Adjust default poll_interval: 5 -> 20 seconds. 2024-04-03 23:01:22 +00:00
288344a348
[Automatic] Updated UI files
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-05 10:19:13 +00:00
8f35fbed16
Merge pull request #404 from BlackLight/snyk-upgrade-66089ad9a01450eef161c7e7fac48843
All checks were successful
continuous-integration/drone/push Build is passing
[Snyk] Upgrade axios from 1.6.4 to 1.6.7
2024-03-05 11:15:26 +01:00
0e8408a83f
Merge branch 'master' into snyk-upgrade-66089ad9a01450eef161c7e7fac48843 2024-03-05 11:15:09 +01:00
8c0939c308
Merge pull request #405 from BlackLight/snyk-upgrade-785cc8b707ebb00ef02379485bb64589
[Snyk] Upgrade sass-loader from 10.4.1 to 10.5.2
2024-03-05 11:14:19 +01:00
8c2abf5d9a
Merge branch 'master' into snyk-upgrade-785cc8b707ebb00ef02379485bb64589 2024-03-05 11:14:08 +01:00