Kooha icon indicating copy to clipboard operation
Kooha copied to clipboard

Element failed to change its state

Open Timmmm opened this issue 2 years ago • 22 comments

System Info

  • io.github.seadve.Kooha 2.2.3

  • Flatpak: true

  • Experimental: false

  • Distribution: GNOME 43 (Flatpak runtime)

  • Desktop Session: gnome-xorg

  • Display Server: x11

  • GTK 4.8.3

  • Libadwaita 1.2.4

  • GStreamer 1.20.6

  • Pipewire 0.3.69

Bug

  1. Click Record
  2. Dialog to choose a monitor appears, select it and click Share
  3. Kooha freezes for a while and then shows this error:
Failed to start recording

Caused by:
    0: Make sure that the saving location exists and is accessible.
    1: Failed to initialize pipeline state to playing
    2: Element failed to change its state

Additional context This is in X11.

2023-07-11T18:52:00.350832Z  INFO kooha::application: Kooha (io.github.seadve.Kooha)
2023-07-11T18:52:00.350849Z  INFO kooha::application: Version: 2.2.3 ()
2023-07-11T18:52:00.350850Z  INFO kooha::application: Datadir: /app/share/kooha
2023-07-11T18:52:01.845066Z DEBUG kooha::screencast_session: Waiting request response for method `CreateSession`
2023-07-11T18:52:01.845362Z DEBUG kooha::screencast_session: Request response received for method `CreateSession`
2023-07-11T18:52:01.845377Z DEBUG kooha::screencast_session: Created screencast session response=Variant { ptr: 0x7f26d0002a00, type: VariantTy { inner: "a{sv}" }, value: "{'session_handle': <'/org/freedesktop/portal/desktop/session/1_161/kooha_0'>}" }
2023-07-11T18:52:01.845401Z DEBUG kooha::recording: ScreenCast portal version: Ok(3)
2023-07-11T18:52:01.845404Z DEBUG kooha::recording: Available cursor modes: Ok(HIDDEN | EMBEDDED | METADATA)
2023-07-11T18:52:01.845407Z DEBUG kooha::recording: Available source types: Ok(MONITOR | WINDOW)
2023-07-11T18:52:01.846402Z DEBUG kooha::screencast_session: Waiting request response for method `SelectSources`
2023-07-11T18:52:01.846732Z DEBUG kooha::screencast_session: Request response received for method `SelectSources`
2023-07-11T18:52:01.846758Z DEBUG kooha::screencast_session: Selected sources response=Variant { ptr: 0x55e13ff4cb00, type: VariantTy { inner: "a{sv}" }, value: "@a{sv} {}" }
2023-07-11T18:52:01.847581Z DEBUG kooha::screencast_session: Waiting request response for method `Start`
2023-07-11T18:52:03.582289Z DEBUG kooha::screencast_session: Request response received for method `Start`
2023-07-11T18:52:03.582315Z DEBUG kooha::screencast_session: Started screencast session response=Variant { ptr: 0x7f26d8007a00, type: VariantTy { inner: "a{sv}" }, value: "{'streams': <[(uint32 90, {'source_type': <uint32 1>, 'position': <(0, 0)>, 'size': <(3840, 1600)>})]>}" }
2023-07-11T18:52:03.583787Z DEBUG kooha::screencast_session: Opened pipe wire remote response=(handle 0,) fd_list=[14]
[I][08236.028454] pw.context   | [      pipewire.c:  647 pw_init()] version 0.3.69
[I][08236.030434] pw.conf      | [          conf.c:  403 conf_load()] 0x7f26e40b7430: loaded config '/usr/share/pipewire/client.conf' with 5 items
[I][08236.030452] pw.conf      | [          conf.c:  950 pw_context_conf_section_for_each()] handle config '/usr/share/pipewire/client.conf' section 'context.properties'
[I][08236.030459] pw.context   | [       context.c:  241 pw_context_new()] 0x7f26e4025800: parsed 1 context.properties items
[I][08236.030619] pw.conf      | [          conf.c:  950 pw_context_conf_section_for_each()] handle config '/usr/share/pipewire/client.conf' section 'context.spa-libs'
[I][08236.030638] pw.context   | [       context.c:  342 pw_context_new()] 0x7f26e4025800: parsed 2 context.spa-libs items
[I][08236.030643] pw.conf      | [          conf.c:  950 pw_context_conf_section_for_each()] handle config '/usr/share/pipewire/client.conf' section 'context.modules'
[I][08236.030649] pw.module    | [   impl-module.c:  162 pw_context_load_module()] 0x7f26e4025800: name:libpipewire-module-protocol-native args:(null)
[I][08236.030809] pw.conf      | [          conf.c:  582 load_module()] 0x7f26e4025800: loaded module libpipewire-module-protocol-native
[I][08236.030816] pw.module    | [   impl-module.c:  162 pw_context_load_module()] 0x7f26e4025800: name:libpipewire-module-client-node args:(null)
[I][08236.030970] pw.conf      | [          conf.c:  582 load_module()] 0x7f26e4025800: loaded module libpipewire-module-client-node
[I][08236.030976] pw.module    | [   impl-module.c:  162 pw_context_load_module()] 0x7f26e4025800: name:libpipewire-module-client-device args:(null)
[I][08236.031055] pw.conf      | [          conf.c:  582 load_module()] 0x7f26e4025800: loaded module libpipewire-module-client-device
[I][08236.031060] pw.module    | [   impl-module.c:  162 pw_context_load_module()] 0x7f26e4025800: name:libpipewire-module-adapter args:(null)
[I][08236.031150] pw.conf      | [          conf.c:  582 load_module()] 0x7f26e4025800: loaded module libpipewire-module-adapter
[I][08236.031155] pw.module    | [   impl-module.c:  162 pw_context_load_module()] 0x7f26e4025800: name:libpipewire-module-metadata args:(null)
[I][08236.031236] pw.conf      | [          conf.c:  582 load_module()] 0x7f26e4025800: loaded module libpipewire-module-metadata
[I][08236.031241] pw.module    | [   impl-module.c:  162 pw_context_load_module()] 0x7f26e4025800: name:libpipewire-module-session-manager args:(null)
[I][08236.031336] pw.conf      | [          conf.c:  582 load_module()] 0x7f26e4025800: loaded module libpipewire-module-session-manager
[I][08236.031341] pw.context   | [       context.c:  346 pw_context_new()] 0x7f26e4025800: parsed 6 context.modules items
[I][08236.031346] pw.context   | [       context.c:  351 pw_context_new()] 0x7f26e4025800: parsed 0 context.objects items
[I][08236.031350] pw.context   | [       context.c:  354 pw_context_new()] 0x7f26e4025800: parsed 0 context.exec items
[W][08236.031372] default      | [        thread.c:  101 impl_acquire_rt()] acquire_rt thread:0x7f26f1ffb640 prio:-1 not implemented
[I][08236.031382] pw.metadata  | [ impl-metadata.c:  185 impl_set_property()] 0x7f26e40152d0: add id:0 key:log.level type: value:0
[I][08236.031387] pw.metadata  | [ impl-metadata.c:  185 impl_set_property()] 0x7f26e40152d0: add id:0 key:clock.rate type: value:48000
[I][08236.031392] pw.metadata  | [ impl-metadata.c:  185 impl_set_property()] 0x7f26e40152d0: add id:0 key:clock.allowed-rates type: value:[ 48000 ]
[I][08236.031397] pw.metadata  | [ impl-metadata.c:  185 impl_set_property()] 0x7f26e40152d0: add id:0 key:clock.quantum type: value:1024
[I][08236.031401] pw.metadata  | [ impl-metadata.c:  185 impl_set_property()] 0x7f26e40152d0: add id:0 key:clock.min-quantum type: value:32
[I][08236.031406] pw.metadata  | [ impl-metadata.c:  185 impl_set_property()] 0x7f26e40152d0: add id:0 key:clock.max-quantum type: value:2048
[I][08236.031410] pw.metadata  | [ impl-metadata.c:  185 impl_set_property()] 0x7f26e40152d0: add id:0 key:clock.force-quantum type: value:0
[I][08236.031414] pw.metadata  | [ impl-metadata.c:  185 impl_set_property()] 0x7f26e40152d0: add id:0 key:clock.force-rate type: value:0
[I][08236.031462] mod.protocol-native | [  local-socket.c:   70 try_connect()] connecting to 'pipewire-0' runtime_dir:/run/user/529202523
[I][08236.031474] mod.protocol-native | [  local-socket.c:   70 try_connect()] connecting to 'pipewire-0' runtime_dir:/run/pipewire
0:00:03.250728733     2 0x55e13dc59360 ERROR                default gstpipewirecore.c:91:make_core: (null)
0:00:03.250935465     2 0x55e13dc59360 WARN                 default gstpipewirecore.c:134:gst_pipewire_core_get: could not create core
0:00:03.250949851     2 0x55e13dc59360 ERROR               pipewire gstpipewiredeviceprovider.c:625:gst_pipewire_device_provider_start:<pipewiredeviceprovider0> Failed to connect
0:00:03.395083743     2 0x55e13dc59360 WARN                    alsa conf.c:5545:parse_args: alsalib error: Parameter DEV must be an integer
0:00:03.395140313     2 0x55e13dc59360 WARN                    alsa conf.c:5687:snd_config_expand: alsalib error: Parse arguments error: Invalid argument
0:00:03.395154479     2 0x55e13dc59360 WARN                    alsa pcm.c:2664:snd_pcm_open_noupdate: alsalib error: Unknown PCM hw:1,0:{AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
0:00:03.409481675     2 0x55e13dc59360 WARN                    alsa conf.c:5545:parse_args: alsalib error: Parameter DEV must be an integer
0:00:03.409530466     2 0x55e13dc59360 WARN                    alsa conf.c:5687:snd_config_expand: alsalib error: Parse arguments error: Invalid argument
0:00:03.409544933     2 0x55e13dc59360 WARN                    alsa pcm.c:2664:snd_pcm_open_noupdate: alsalib error: Unknown PCM hw:1,3:{AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
0:00:03.410502347     2 0x55e13dc59360 WARN                    alsa conf.c:5545:parse_args: alsalib error: Parameter DEV must be an integer
0:00:03.410522760     2 0x55e13dc59360 WARN                    alsa conf.c:5687:snd_config_expand: alsalib error: Parse arguments error: Invalid argument
0:00:03.410534048     2 0x55e13dc59360 WARN                    alsa pcm.c:2664:snd_pcm_open_noupdate: alsalib error: Unknown PCM hw:1,7:{AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
0:00:03.411160475     2 0x55e13dc59360 WARN                    alsa conf.c:5545:parse_args: alsalib error: Parameter DEV must be an integer
0:00:03.411176917     2 0x55e13dc59360 WARN                    alsa conf.c:5687:snd_config_expand: alsalib error: Parse arguments error: Invalid argument
0:00:03.411187022     2 0x55e13dc59360 WARN                    alsa pcm.c:2664:snd_pcm_open_noupdate: alsalib error: Unknown PCM hw:1,8:{AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
0:00:03.411826332     2 0x55e13dc59360 WARN                    alsa conf.c:5545:parse_args: alsalib error: Parameter DEV must be an integer
0:00:03.411841885     2 0x55e13dc59360 WARN                    alsa conf.c:5687:snd_config_expand: alsalib error: Parse arguments error: Invalid argument
0:00:03.411853047     2 0x55e13dc59360 WARN                    alsa pcm.c:2664:snd_pcm_open_noupdate: alsalib error: Unknown PCM hw:1,9:{AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
0:00:03.412155235     2 0x55e13dc59360 WARN                    alsa conf.c:5545:parse_args: alsalib error: Parameter DEV must be an integer
0:00:03.412171399     2 0x55e13dc59360 WARN                    alsa conf.c:5687:snd_config_expand: alsalib error: Parse arguments error: Invalid argument
0:00:03.412182069     2 0x55e13dc59360 WARN                    alsa pcm.c:2664:snd_pcm_open_noupdate: alsalib error: Unknown PCM hw:2,0:{AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
2023-07-11T18:52:03.758387Z DEBUG kooha::audio_device: Finding device name for class `Sink`
2023-07-11T18:52:03.758465Z  WARN kooha::audio_device: Skipping device `pulsedevice5` as it has no node.name property. FieldNotFound { name: "node.name" }
2023-07-11T18:52:03.758506Z DEBUG kooha::audio_device: Skipping device `pulsedevice6` as it is not the default
2023-07-11T18:52:03.758715Z  WARN kooha::audio_device: Failed to find default name using gstreamer: Failed to find a default device
2023-07-11T18:52:03.758757Z DEBUG kooha::audio_device: Manually using libpulse instead
2023-07-11T18:52:03.759155Z DEBUG kooha::audio_device::pa: Waiting for context server connection
2023-07-11T18:52:03.760055Z DEBUG kooha::audio_device::pa: Connected context to server
2023-07-11T18:52:03.762973Z DEBUG kooha::pipeline: file_path=/home/codasip.com/timothy.hutt/Videos/Kooha/Kooha-2023-07-11-19-52-03.webm framerate=30 profile=WebMProfile stream_len=1 streams=[Stream { node_id: 90, id: None, position: Some((0, 0)), size: Some((3840, 1600)), source_type: Some(MONITOR) }] speaker_source=Some("alsa_output.usb-Blue_Microphones_Yeti_Stereo_Microphone_REV8-00.analog-stereo.monitor") mic_source=None select_area_data=None
2023-07-11T18:52:03.765299Z DEBUG kooha::pipeline: pipewiresrc needs copy: false
2023-07-11T18:52:03.771751Z DEBUG kooha::profile: encodebin_elements=["audioconvert", "audioresample", "audioconvert", "audiorate", "ANY", "opusenc", "queue", "streamsplitter1", "streamcombiner1", "audio/x-opus", "queue", "videorate", "videoconvert", "videoscale", "videoconvert", "ANY", "vp8enc", "queue", "streamsplitter0", "streamcombiner0", "video/x-vp8, profile=(string){ 0, 1, 2, 3 }", "queue", "webmmux"]
[I][08236.207197] pw.conf      | [          conf.c:  403 conf_load()] 0x55e1400a01c0: loaded config '/usr/share/pipewire/client.conf' with 5 items
[I][08236.207226] pw.conf      | [          conf.c:  950 pw_context_conf_section_for_each()] handle config '/usr/share/pipewire/client.conf' section 'context.properties'
[I][08236.207232] pw.context   | [       context.c:  241 pw_context_new()] 0x55e14009fce0: parsed 1 context.properties items
[I][08236.207405] pw.conf      | [          conf.c:  950 pw_context_conf_section_for_each()] handle config '/usr/share/pipewire/client.conf' section 'context.spa-libs'
[I][08236.207423] pw.context   | [       context.c:  342 pw_context_new()] 0x55e14009fce0: parsed 2 context.spa-libs items
[I][08236.207427] pw.conf      | [          conf.c:  950 pw_context_conf_section_for_each()] handle config '/usr/share/pipewire/client.conf' section 'context.modules'
[I][08236.207433] pw.module    | [   impl-module.c:  162 pw_context_load_module()] 0x55e14009fce0: name:libpipewire-module-protocol-native args:(null)
[I][08236.207603] pw.conf      | [          conf.c:  582 load_module()] 0x55e14009fce0: loaded module libpipewire-module-protocol-native
[I][08236.207611] pw.module    | [   impl-module.c:  162 pw_context_load_module()] 0x55e14009fce0: name:libpipewire-module-client-node args:(null)
[I][08236.207797] pw.conf      | [          conf.c:  582 load_module()] 0x55e14009fce0: loaded module libpipewire-module-client-node
[I][08236.207804] pw.module    | [   impl-module.c:  162 pw_context_load_module()] 0x55e14009fce0: name:libpipewire-module-client-device args:(null)
[I][08236.207886] pw.conf      | [          conf.c:  582 load_module()] 0x55e14009fce0: loaded module libpipewire-module-client-device
[I][08236.207891] pw.module    | [   impl-module.c:  162 pw_context_load_module()] 0x55e14009fce0: name:libpipewire-module-adapter args:(null)
[I][08236.207983] pw.conf      | [          conf.c:  582 load_module()] 0x55e14009fce0: loaded module libpipewire-module-adapter
[I][08236.207988] pw.module    | [   impl-module.c:  162 pw_context_load_module()] 0x55e14009fce0: name:libpipewire-module-metadata args:(null)
[I][08236.208073] pw.conf      | [          conf.c:  582 load_module()] 0x55e14009fce0: loaded module libpipewire-module-metadata
[I][08236.208078] pw.module    | [   impl-module.c:  162 pw_context_load_module()] 0x55e14009fce0: name:libpipewire-module-session-manager args:(null)
[I][08236.208171] pw.conf      | [          conf.c:  582 load_module()] 0x55e14009fce0: loaded module libpipewire-module-session-manager
[I][08236.208176] pw.context   | [       context.c:  346 pw_context_new()] 0x55e14009fce0: parsed 6 context.modules items
[I][08236.208180] pw.context   | [       context.c:  351 pw_context_new()] 0x55e14009fce0: parsed 0 context.objects items
[I][08236.208184] pw.context   | [       context.c:  354 pw_context_new()] 0x55e14009fce0: parsed 0 context.exec items
[W][08236.208213] default      | [        thread.c:  101 impl_acquire_rt()] acquire_rt thread:0x7f26f0ff9640 prio:-1 not implemented
[I][08236.208221] pw.metadata  | [ impl-metadata.c:  185 impl_set_property()] 0x55e14009f630: add id:0 key:log.level type: value:0
[I][08236.208226] pw.metadata  | [ impl-metadata.c:  185 impl_set_property()] 0x55e14009f630: add id:0 key:clock.rate type: value:48000
[I][08236.208231] pw.metadata  | [ impl-metadata.c:  185 impl_set_property()] 0x55e14009f630: add id:0 key:clock.allowed-rates type: value:[ 48000 ]
[I][08236.208235] pw.metadata  | [ impl-metadata.c:  185 impl_set_property()] 0x55e14009f630: add id:0 key:clock.quantum type: value:1024
[I][08236.208239] pw.metadata  | [ impl-metadata.c:  185 impl_set_property()] 0x55e14009f630: add id:0 key:clock.min-quantum type: value:32
[I][08236.208243] pw.metadata  | [ impl-metadata.c:  185 impl_set_property()] 0x55e14009f630: add id:0 key:clock.max-quantum type: value:2048
[I][08236.208247] pw.metadata  | [ impl-metadata.c:  185 impl_set_property()] 0x55e14009f630: add id:0 key:clock.force-quantum type: value:0
[I][08236.208250] pw.metadata  | [ impl-metadata.c:  185 impl_set_property()] 0x55e14009f630: add id:0 key:clock.force-rate type: value:0
[I][08236.208317] pw.conf      | [          conf.c:  950 pw_context_conf_section_for_each()] handle config '/usr/share/pipewire/client.conf' section 'stream.properties'
0:00:03.428368956     2 0x7f26e40a1460 FIXME                default gstutils.c:4025:gst_pad_create_stream_id_internal:<pipewiresrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
[E][08236.210420] pw.stream    | [        stream.c:  368 stream_set_state()] 0x55e1400d0bf0: error wrong resource type/version
0:00:03.429689738     2 0x7f26a0010ed0 WARN             pipewiresrc gstpipewiresrc.c:682:on_state_changed:<pipewiresrc0> error: stream error: wrong resource type/version
0:00:03.429720138     2 0x7f26a0010ed0 WARN             pipewiresrc gstpipewiresrc.c:682:on_state_changed:<pipewiresrc0> error: stream error: wrong resource type/version
[W][08236.210498] default      | [gstpipewirecore.:   22 on_core_error()] error id:2 seq:2 res:-71 (Protocol error): wrong resource type/version
[W][08236.210530] pw.node      | [     impl-node.c:  431 suspend_node()] 0x7f26a00047b0: error unset format input: Input/output error
[I][08236.210542] pw.stream    | [        stream.c:  603 impl_send_command()] 0x55e1400d0bf0: command Spa:Pod:Object:Command:Node:Suspend
[I][08236.210557] pw.node      | [     impl-node.c:  388 node_update_state()] (kooha-0) creating -> suspended
[W][08236.210571] default      | [gstpipewirecore.:   22 on_core_error()] error id:0 seq:3 res:-22 (Invalid argument): unknown resource 2 op:2
[W][08236.210582] default      | [gstpipewirecore.:   22 on_core_error()] error id:0 seq:4 res:-22 (Invalid argument): unknown resource 2 op:3
0:00:33.429747492     2 0x7f26e40a1460 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<pipewiresrc0> error: Internal data stream error.
0:00:33.429810090     2 0x7f26e40a1460 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<pipewiresrc0> error: streaming stopped, reason not-negotiated (-4)
2023-07-11T18:52:33.777460Z ERROR kooha::window: Failed to start recording

Caused by:
    0: Make sure that the saving location exists and is accessible.
    1: Failed to initialize pipeline state to playing
    2: Element failed to change its state
[I][08266.241265] pw.node      | [     impl-node.c: 1904 pw_impl_node_destroy()] (kooha-0) destroy
2023-07-11T18:52:33.838403Z DEBUG kooha::screencast_session: Closed screencast session response=()

Timmmm avatar Jul 11 '23 18:07 Timmmm

There appear to be two errors in that log. One related to some kind of ALSA type error. The second is:

 error wrong resource type/version

I think the second is what is causing everything to fail. If I disable desktop audio then the ALSA error goes away yet I still get the same Failed to start recording.

Btw you might want to run all this in a background thread since it freezes the whole app while it is failing to start recording... :-/

Timmmm avatar Jul 11 '23 18:07 Timmmm

Same error:

log
2023-09-24T15:51:16.347191Z  INFO kooha::application: Kooha (io.github.seadve.Kooha)
2023-09-24T15:51:16.347209Z  INFO kooha::application: Version: 2.2.3 ()
2023-09-24T15:51:16.347213Z  INFO kooha::application: Datadir: /usr/share/kooha
2023-09-24T15:51:18.646154Z ERROR kooha::window: Element failed to change its state
2023-09-24T15:51:23.276302Z ERROR kooha::window: Failed to start recording

Caused by:
    0: Make sure that the saving location exists and is accessible.
    1: Failed to initialize pipeline state to playing
    2: Element failed to change its state
2023-09-24T15:51:32.189094Z ERROR kooha::window: Element failed to change its state

(kooha:125497): Gtk-WARNING **: 17:51:38.667: Failed to measure available space: The specified location is not supported
2023-09-24T15:51:46.188970Z ERROR kooha::window: Element failed to change its state

cvanelteren avatar Sep 24 '23 15:09 cvanelteren

Same error: log

2023-09-24T15:51:16.347191Z  INFO kooha::application: Kooha (io.github.seadve.Kooha)
2023-09-24T15:51:16.347209Z  INFO kooha::application: Version: 2.2.3 ()
2023-09-24T15:51:16.347213Z  INFO kooha::application: Datadir: /usr/share/kooha
2023-09-24T15:51:18.646154Z ERROR kooha::window: Element failed to change its state
2023-09-24T15:51:23.276302Z ERROR kooha::window: Failed to start recording

Caused by:
    0: Make sure that the saving location exists and is accessible.
    1: Failed to initialize pipeline state to playing
    2: Element failed to change its state
2023-09-24T15:51:32.189094Z ERROR kooha::window: Element failed to change its state

(kooha:125497): Gtk-WARNING **: 17:51:38.667: Failed to measure available space: The specified location is not supported
2023-09-24T15:51:46.188970Z ERROR kooha::window: Element failed to change its state

Try replacing your saving location from the preferences

SeaDve avatar Sep 24 '23 16:09 SeaDve

Tried that. Same error still. Just for reference there is over 350 gigs left on the drive I targeted. Could this be a permission thing from kooha?

cvanelteren avatar Sep 24 '23 16:09 cvanelteren

I think this may be caused by https://github.com/SeaDve/Kooha/commit/a8f6b7ecf4e313b0f33933e24ebe445b611d581e

SeaDve avatar Feb 08 '24 13:02 SeaDve