PM4K / PlexMod for Kodi (18, 19, 20, 21, 22+)

Can you get me a kodi debug log when you press those two Ch Pg buttons?

Edit: I’m guessing those are:

constexpr const int ACTION_PAGE_UP = 5;
constexpr const int ACTION_PAGE_DOWN = 6;

(See: xbmc/xbmc/input/actions/ActionIDs.h at master · xbmc/xbmc · GitHub)

seems to be yes! spammed pg up.

2024-07-29 19:41:49.179 T:3886    debug <general>: HandleKey: pageup (0xf084) pressed, window 13002, action is PageUp
2024-07-29 19:41:49.325 T:4230    debug <general>: Thread Timer 3271676416 terminating
2024-07-29 19:41:49.329 T:3886    debug <general>: Keyboard: scancode: 0x68, sym: 0x118, unicode: 0x00, modifier: 0x0
2024-07-29 19:41:49.376 T:3896    debug <general>: CLibInputKeyboard::ProcessKey - using delay: 500ms repeat: 33ms
2024-07-29 19:41:49.376 T:4231    debug <general>: Thread Timer start, auto delete: false
2024-07-29 19:41:49.379 T:3886    debug <general>: Keyboard: scancode: 0x68, sym: 0x118, unicode: 0x00, modifier: 0x0
2024-07-29 19:41:49.379 T:3886    debug <general>: HandleKey: pageup (0xf084) pressed, window 13002, action is PageUp
2024-07-29 19:41:49.458 T:4231    debug <general>: Thread Timer 3271676416 terminating

In coreelec, when changing audio inside the movie, it bugs the player and starts the movie again. I also notice that when changing the audio, it recreates a video connection again instead of simply changing the audio like the official plex player.
log-2024-07-29-19.50.00.zip (412.5 KB)

1 Like

Yeah that’s not normal. I currently have no idea why that happens - the kodi player fails:

2024-07-29 16:48:34.887 T:1238     info <general>: script.plex: Player: Video window closed
2024-07-29 16:48:34.888 T:1235     info <general>: script.plex: Player - STOPPED: FAILED

Maybe someone else with CoreELEC can dive into this.

1 Like

So only pg up or also pg down?

Are you on the latest nightly of Coreelec? Just tried changing audio tracks in the middle of a movie (high bitrate 4K mkv) and initially it restarted the movie, but I tried changing audio track a few more times and all worked as expected even in the middle of the movie. Also tried another movie and it switched audio tracks without restarting the movie as well.

Does it happen on every movie for you or certain files?

Oh I forgot to do pg down before but yes, it is pg up / down on android tv and here.

2024-07-30 22:07:56.672 T:3859    debug <general>: HandleKey: pagedown (0xf085) pressed, window 13001, action is PageDown
2024-07-30 22:07:56.776 T:4295    debug <general>: Thread Timer 3096363520 terminating
2024-07-30 22:07:56.788 T:3859    debug <general>: Keyboard: scancode: 0x6d, sym: 0x119, unicode: 0x00, modifier: 0x0
2024-07-30 22:07:56.858 T:3877    debug <general>: CLibInputKeyboard::ProcessKey - using delay: 500ms repeat: 33ms
2024-07-30 22:07:56.859 T:4296    debug <general>: Thread Timer start, auto delete: false
2024-07-30 22:07:56.872 T:3859    debug <general>: Keyboard: scancode: 0x6d, sym: 0x119, unicode: 0x00, modifier: 0x0
2024-07-30 22:07:56.872 T:3859    debug <general>: HandleKey: pagedown (0xf085) pressed, window 13001, action is PageDown
2024-07-30 22:07:56.966 T:4296    debug <general>: Thread Timer 3096363520 terminating
2024-07-30 22:07:56.972 T:3859    debug <general>: Keyboard: scancode: 0x6d, sym: 0x119, unicode: 0x00, modifier: 0x0
2024-07-30 22:07:57.025 T:3877    debug <general>: CLibInputKeyboard::ProcessKey - using delay: 500ms repeat: 33ms
2024-07-30 22:07:57.025 T:4297    debug <general>: Thread Timer start, auto delete: false
2024-07-30 22:07:57.038 T:3859    debug <general>: Keyboard: scancode: 0x6d, sym: 0x119, unicode: 0x00, modifier: 0x0
2024-07-30 22:07:57.039 T:3859    debug <general>: HandleKey: pagedown (0xf085) pressed, window 13001, action is PageDown
2024-07-30 22:07:57.157 T:4297    debug <general>: Thread Timer 3096363520 terminating

It happens in practically all files, sometimes it changes without restarting, I’m on the latest coreelec nightly 21.1 New Era

I’m able to reproduce the issue where switching audio streams restarts the video. It appears the restarting of the file is deliberate, probably because if it’s being transcoded you would have to restart the stream. When it restarts the video it also has to do a seek to get back to where the video was at when you switched audio streams. It appears that kodi is ignoring the seek request because we’re issuing it too soon after the movie starts. If I add a slight delay then it seems to work. Not exactly an ideal solution but maybe it’s good enough. I’ll upload a PR later with the change and see what @panni thinks.

It is deliberate, albeit as little unintuitive why this has to happen even in DirectPlay. It might be unnecessary, but I’ve simply kept the behaviour from the original script.plex. We restart the video to reassess whether the newly selected stream combinations are still DirectPlayable or need DirectStream/Transcoding.

For audio changes, I think we should try and avoid that. I’ll fiddle around.

1 Like

Seems like restarting the video would be unnecessary if the user has already selected what codecs apply in the settings but I guess there’s scenarios where they’ve got it wrong even though I expect most people have it right. Avoiding a restart would be great!

Well no. You might have specific settings for AC3 for example. When you start a DP session with let’s say AAC audio and switch to AC3, we need to react accordingly and might need to reevaluate whether to Transcode or not.

Edit: For most people it should be fine, though.

1 Like

0.7.9-beta16.4: script.plexmod.zip (2.8 MB)

Temporary Changelog:

  • Core: Dump all user settings into the DEBUG log if requested (private information masked)
  • Core/Settings: Add setting to System tab to dump all user settings
  • SeekDialog/Player: Don’t restart the video when changing audio or subtitles (possibly even video, not tested), if not necessary
  • SeekDialog: Re-evaluate MediaDecisionEngine decision when changing selected streams during playback; this allows switching between DirectPlay/DirectStream/Transcode, on the fly, based on the selected streams
  • SeekDialog/Player: Fix resume-on-start sometimes not working when an embedded subtitle stream was selected
  • Settings/Audio/AC3/DTS: Change setting options from 2.1+ and 5.1+ to >2.0, >2.1, >5.0, >5.1 to allow for more fine-grained control
  • SeekDialog: Allow ACTION_PAGE_DOWN and ACTION_PAGE_UP to bring up the OSD when Behave like official Plex clients is active
  • Core/Settings: Allow setting DEBUG on the fly, without restarting the addon
  • Core: Fix usage of collections.Iterable with Kodi python > 3.9

@evertonmdz @bowlingbeeg please check whether this fixes your issues.
@MediaHorder page up/down is implemented
@hbbs @Makotosan please check whether the AC3 handling is still correct

Edit: 16:10/4:3 branch not yet merged, haven’t had the time.

Edit 2: Reuploaded zip for 0.7.9-beta16.4 (killed beta16.3)

Edit 3: Reuploaded 0.7.9-beta16.4 (18:15 CEST)

8 Likes

Latest beta appears to have broken something. I’m unable to play anything at the moment. An error message pops up in the top right saying “ERROR: none” and it hangs on the show/movie’s background.

Oh. I thought I’ve fixed that. Let me check.

Edit: Can’t reproduce, please send me a log!

Of course you can’t; just my luck :sweat_smile: Is there an easier way of sharing logs these days? The last time I tried I couldn’t find where my Nvidia Shield had saved the actual log so I was unable to share it anywhere.

I’m getting an error none on all the media files I tried to play on my RPi5 (LibreELEC latest nightly build)

Send a log to your DM

@panni

1 Like

No there isn’t right now I think. It’s stored in Android/data/yourkodipackage/files/.kodi/temp/kodi.log

I don’t see a DM yet

Can confirm it’s happening in testing on my Tablet as well with all three zips you’ve provided. Will DM you a log file now as well.

Logs sent