Bug 490264 - Vt102Emulation: Audio data from OSC attribute 1337 and inlineMedia=1 parameter is stuck in QMediaPlayer::BufferingMedia state
Summary: Vt102Emulation: Audio data from OSC attribute 1337 and inlineMedia=1 paramete...
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: emulation (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-14 15:07 UTC by ratijas
Modified: 2024-07-16 17:59 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ratijas 2024-07-14 15:07:57 UTC
SUMMARY
Audio data is not being played, and the QMediaPlayer object is left lingering for eternity in a QMediaPlayer::BufferingMedia state. I added some relevant debug prints, and observed that when buffer data is assigned this happens:

> player status changed to QMediaPlayer::LoadingMedia
> [mp3 @ 0x6ffddc001440] Estimating duration from bitrate, this may be inaccurate
> player status changed to QMediaPlayer::LoadedMedia

and after the player->play() slot is called, additional last event happens:

> player status changed to QMediaPlayer::BufferingMedia


STEPS TO REPRODUCE
1. Download script from https://iterm2.com/documentation-images.html
2. Add `printf ";inlineMedia=1"` line somewhere in the middle of its print_image function — this tells Konsole to take the `if (inlineMedia) { player = new QMediaPlayer(this); }` code path.
3. Run your modified imgcat script with some mp3 file as an argument.

OBSERVED RESULT
No audio is played.

EXPECTED RESULT
Audio should play.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: git/master
KDE Frameworks Version: git/master
Qt Version: 6.7.2
Kernel Version: 6.9.8-arch1-1 (64-bit)
Graphics Platform: X11
Comment 1 Bug Janitor Service 2024-07-14 15:31:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/1014
Comment 2 ratijas 2024-07-16 17:59:44 UTC
Git commit 256c1b18fb06eea3630a0c224d345e81a39815da by ivan tkachenko.
Committed on 14/07/2024 at 15:33.
Pushed by hindenburg into branch 'master'.

Fix playing audio for OSC attribute 1337 and inlineMedia=1 parameter

The player was basically stuck in the QMediaPlayer::BufferingMedia
state, never playing or deleting itself. I guess this still could
happen on systems without valid audio outputs.

M  +2    -0    src/Vt102Emulation.cpp

https://invent.kde.org/utilities/konsole/-/commit/256c1b18fb06eea3630a0c224d345e81a39815da