-
Notifications
You must be signed in to change notification settings - Fork 570
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
profiles: anki: fix opening, allow media & add to firecfg #6545
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kmk3
changed the title
Profiles: anki: allow mpv and mplayer
profiles: anki: allow mpv and mplayer
Nov 12, 2024
kmk3
approved these changes
Nov 12, 2024
5 tasks
@kmk3 I pushed some commits, but Github is not displaying them for some reason. |
Maybe try to pull and force-push. |
That worked. I enabled anki in firecfg, because it should now work with the default profile. Is that OK? |
Without this change, Anki fails to start. Fixes netblue30#6544.
kmk3
force-pushed
the
anki-mpv-lua
branch
2 times, most recently
from
November 19, 2024 16:53
42e96be
to
07568f5
Compare
kmk3
changed the title
profiles: anki: allow mpv and mplayer
profiles: anki: fix opening, allow media & add to firecfg
Nov 19, 2024
Anki relies on mpv/mplayer for playing audio and video files.
Anki uses mpv to play media, which requires the lua interpreter. Without this, anki displays this error in the console and falls back to mplayer: mpv: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: Permission denied Traceback (most recent call last): File "/usr/lib/python3.12/site-packages/aqt/sound.py", line 854, in setup_audio mpvManager = MpvManager(base_folder, media_folder) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/aqt/sound.py", line 408, in __init__ super().__init__(window_id=None, debug=False) File "/usr/lib/python3.12/site-packages/aqt/mpv.py", line 442, in __init__ super().__init__(*args, **kwargs) File "/usr/lib/python3.12/site-packages/aqt/mpv.py", line 104, in __init__ self._start_socket() File "/usr/lib/python3.12/site-packages/aqt/mpv.py", line 194, in _start_socket raise MPVProcessError("unable to start process") aqt.mpv.MPVProcessError: unable to start process mpv too old or failed to open, reverting to mplayer
Anki needs sound access for recording and playing media.
kmk3
added a commit
to kmk3/firejail
that referenced
this pull request
Nov 25, 2024
mpv crashes if luajit is blocked: $ firejail --quiet --noprofile \ --include=/etc/firejail/disable-interpreters.inc /usr/bin/mpv /usr/bin/mpv: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: Permission denied So make sure that allow-lua.inc is always included when mpv paths (such as ~/.config/mpv) are allowed. Environment: luajit 2.1.1727870382-1, mpv 1:0.39.0-3 on Artix Linux. Related commits: * db2bdaa ("add lua support for mpv (netblue30#3243)", 2020-02-24) / PR netblue30#3243 * d6a6fb9 ("Allow Lua for mpv in dolphin.profile", 2020-04-18) / issue netblue30#3363 * f3585e5 ("fixes, closes, enhances, improvements, and so on", 2020-11-09) / issue netblue30#3686 * 3ec523f ("profiles: anki: allow lua", 2024-11-14) / PR netblue30#6545
kmk3
added a commit
that referenced
this pull request
Nov 29, 2024
mpv crashes if luajit is blocked: $ firejail --quiet --noprofile \ --include=/etc/firejail/disable-interpreters.inc /usr/bin/mpv /usr/bin/mpv: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: Permission denied So make sure that allow-lua.inc is always included when mpv paths (such as ~/.config/mpv) are allowed. Environment: luajit 2.1.1727870382-1, mpv 1:0.39.0-3 on Artix Linux. Related commits: * db2bdaa ("add lua support for mpv (#3243)", 2020-02-24) / PR #3243 * d6a6fb9 ("Allow Lua for mpv in dolphin.profile", 2020-04-18) / issue #3363 * f3585e5 ("fixes, closes, enhances, improvements, and so on", 2020-11-09) / issue #3686 * 3ec523f ("profiles: anki: allow lua", 2024-11-14) / PR #6545
kmk3
added a commit
that referenced
this pull request
Nov 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Anki relies on mpv and mplayer for playing audio and video files.
If mpv is present in the system but not allowed in firejail then Anki fails to start because mpv permissions won't allow for execution.
Fixes #6544.