-
Notifications
You must be signed in to change notification settings - Fork 27
fix(nix): add GStreamer & PipeWire to build inputs #44
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
Conversation
strange, Ignis doesn't require gst-python, it access GStreamer through GObject introspection using pygobject |
Well, this is what I get, and when I add the gst-python bindings, the namespace "Gst" becomes available
config file supplied is
I can close this PR and add a issue, if this is not the right fix. |
Does recording itsekf work (start/stop)?
I am not nix user, so probably will not fix it |
No, actually the config errors out saying GStreamer not found.
The underlying error is Gst namespace is not available.
This was my mistake, gst-python is not needed, but the namespace Gst only becomes available when Gstreamer is present (pkgs.gst_all_1.gstreamer) in the buildInputs. After reading through the packaging section on nixpkgs, I see that there is no attribute in mkDerivation called "runtimeInputs", (it only exists of writeShellApplicaition), the buildInputs attribute is what is used to supply runtime dependencies to the package. I would like to keep this PR open, so that after I fix other issues ( pipewire gst plugin not visible ), I could contribute. |
@linkfrg These dependencies seems to solve the dependency issues for me.
Even after solving this dep issue, the recorder seems to hang for me. The XDG portal opens to share the screen and after accepting that ignis becomes unresponsive. I had to kill the process to stop it. so nothing is being saved. But this may be related to another issue You can test this build by using
|
I get error when trying to record internal audio or audio from microphone: from ignis.services.recorder import RecorderService
recorder = RecorderService.get_default()
recorder.start_recording(record_internal_audio=True) 2024-11-27 20:58:40 [ERROR] TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Traceback (most recent call last):
File "/nix/store/zlx58nx4jrl0klnq42ah5n5c2j2x531n-ignis-0.3+date=20241126_173e4ca/bin/.ignis-wrapped", line 5, in <module>
main()
└ <function main at 0x78e336dacf40>
File "/nix/store/zlx58nx4jrl0klnq42ah5n5c2j2x531n-ignis-0.3+date=20241126_173e4ca/lib/python3.12/site-packages/ignis/main.py", line 12, in main
cli(prog_name="ignis")
└ <OrderedGroup cli>
File "/nix/store/qb0p0c4l4rj3lh1dc2j74y2s37g1ghn7-python3.12-click-8.1.7/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
│ │ │ └ {'prog_name': 'ignis'}
│ │ └ ()
│ └ <function BaseCommand.main at 0x78e334dff060>
└ <OrderedGroup cli>
File "/nix/store/qb0p0c4l4rj3lh1dc2j74y2s37g1ghn7-python3.12-click-8.1.7/lib/python3.12/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
│ │ └ <click.core.Context object at 0x78e332d2b0e0>
│ └ <function MultiCommand.invoke at 0x78e334c102c0>
└ <OrderedGroup cli>
File "/nix/store/qb0p0c4l4rj3lh1dc2j74y2s37g1ghn7-python3.12-click-8.1.7/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
│ │ │ │ └ <click.core.Context object at 0x78e332ea0c20>
│ │ │ └ <function Command.invoke at 0x78e334dffc40>
│ │ └ <Command init>
│ └ <click.core.Context object at 0x78e332ea0c20>
└ <function MultiCommand.invoke.<locals>._process_result at 0x78e33786d6c0>
File "/nix/store/qb0p0c4l4rj3lh1dc2j74y2s37g1ghn7-python3.12-click-8.1.7/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
│ │ │ │ │ └ {'config': '/home/link/Documents/asd.py', 'debug': False}
│ │ │ │ └ <click.core.Context object at 0x78e332ea0c20>
│ │ │ └ <function init at 0x78e332d64220>
│ │ └ <Command init>
│ └ <function Context.invoke at 0x78e334dfe5c0>
└ <click.core.Context object at 0x78e332ea0c20>
File "/nix/store/qb0p0c4l4rj3lh1dc2j74y2s37g1ghn7-python3.12-click-8.1.7/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
│ └ {'config': '/home/link/Documents/asd.py', 'debug': False}
└ ()
File "/nix/store/zlx58nx4jrl0klnq42ah5n5c2j2x531n-ignis-0.3+date=20241126_173e4ca/lib/python3.12/site-packages/ignis/cli.py", line 90, in init
run_app(config_path, debug)
│ │ └ False
│ └ '/home/link/Documents/asd.py'
└ <function run_app at 0x78e332d66c00>
File "/nix/store/zlx58nx4jrl0klnq42ah5n5c2j2x531n-ignis-0.3+date=20241126_173e4ca/lib/python3.12/site-packages/ignis/app.py", line 454, in run_app
app.run(None)
│ └ <function Application.run at 0x78e334c2c680>
└ <app.IgnisApp object at 0x78e332b4fe00 (ignis+app+IgnisApp at 0x2dfb0410)>
File "/nix/store/44n7v64jbkar47zk7nm8mbx36cqxh7y9-python3.12-pygobject-3.48.2/lib/python3.12/site-packages/gi/overrides/Gio.py", line 42, in run
return Gio.Application.run(self, *args, **kwargs)
│ │ │ │ │ └ {}
│ │ │ │ └ (None,)
│ │ │ └ <app.IgnisApp object at 0x78e332b4fe00 (ignis+app+IgnisApp at 0x2dfb0410)>
│ │ └ gi.FunctionInfo(run, bound=None)
│ └ <class 'gi.repository.Gio.Application'>
└ <IntrospectionModule 'Gio' from '/nix/store/fxnchbq09sq279ssqdsgzigsyvp6hz06-glib-2.80.4/lib/girepository-1.0/Gio-2.0.typelib'>
> File "/nix/store/zlx58nx4jrl0klnq42ah5n5c2j2x531n-ignis-0.3+date=20241126_173e4ca/lib/python3.12/site-packages/ignis/app.py", line 292, in do_activate
__import__(config_filename)
└ 'asd'
File "/home/link/Documents/asd.py", line 5, in <module>
recorder.start_recording(record_internal_audio=True)
│ └ <function RecorderService.start_recording at 0x78e331112200>
└ <service.RecorderService object at 0x78e332b67980 (ignis+services+recorder+service+RecorderService at 0x2e38a830)>
File "/nix/store/zlx58nx4jrl0klnq42ah5n5c2j2x531n-ignis-0.3+date=20241126_173e4ca/lib/python3.12/site-packages/ignis/services/recorder/service.py", line 207, in start_recording
audio_pipeline, self._audio.speaker.name + ".monitor"
│ │ │ │ └ 'speaker'
│ │ │ └ <GObject Property speaker (PyObject)>
│ │ └ <service.AudioService object at 0x78e33110f300 (ignis+services+audio+service+AudioService at 0x2e0a3630)>
│ └ <service.RecorderService object at 0x78e332b67980 (ignis+services+recorder+service+RecorderService at 0x2e38a830)>
└ ''
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' Looks like there is some problem with AudioService... |
I'm having a hard time debugging this. I have no experience working with PyGObject. @linkfrg any idea where to start? |
Looks like AudioService doesn't work properly on Nix, probably some issue with Gvc, it doesn't detect any audio devices e.g.: from ignis.services.audio import AudioService
audio = AudioService.get_default()
print(audio.speakers) Returns an empty list:
|
Okay, I will merge this anyway, the issue with AudioService and Gvc should be fixed separately |
Currently the recorder service is not working (atleast for me), because python bindings for GStreamer are not included in build-inputs. so this commit adds that