Ticket #2261 (closed bug: obsolete)

Opened 10 years ago

Last modified 8 years ago

media-on-windows-makes-sophie-uresponsive - When media is played on windows Sophie stops responding.

Reported by: todor Owned by:
Priority: major Milestone: X3
Component: uncategorized Version: 2.0
Keywords: Cc:
Category: unknown Effort:
Importance: 93 Ticket_group:
Estimated Number of Hours: 0 Add Hours to Ticket: 0
Billable?: yes Total Hours: 0
Analysis_owners: todor Design_owners: milo, stefan
Imp._owners: milo, stefan Test_owners:
Analysis_reviewers: stefan Changelog:
Design_reviewers: meddle, pap Imp._reviewers: deyan, todor
Test_reviewers: Analysis_score: 3
Design_score: 3.5 Imp._score: 3.5
Test_score: 0

Description (last modified by todor) (diff)

  • Create book.
  • Insert media.
  • Open preview.
  • Try to play the media.
  • Sophie stops responding.

For some files Sophie crashes even before the user try to play the media.


win_media.patch (92.0 KB) - added by stefan 10 years ago.

Change History

comment:1 Changed 10 years ago by todor

  • Status changed from new to s1b_analysis_finished

comment:2 Changed 10 years ago by todor

  • Description modified (diff)

comment:3 Changed 10 years ago by stefan

  • Status changed from s1b_analysis_finished to s2a_design_started

comment:4 Changed 10 years ago by deyan

  • Importance set to 93

Changed 10 years ago by stefan

comment:5 Changed 10 years ago by stefan

  • Status changed from s2a_design_started to s3b_implementation_finished

We came at conclusion that the problem is in the Windows's small pipe buffers. So, the massive native and ffmpeg's library debug dumping on the native's standard error output causes filling the pipe buffer, and therefor causing both processes to block. The solution is creating a thread that will constantly read the native's stderr, and will keep the pipe buffer clean. The code is as follows:

private static class ErrorDumper extends Thread {
		private final BufferedReader nativeStderr;

		public ErrorDumper(InputStream errorStream) {
			this.nativeStderr = new BufferedReader(new InputStreamReader(errorStream));
		public void run() {
			//The read until exception pattern
			try {
				String line = null; 
				do {
					line = this.nativeStderr.readLine(); 
					SophieLog.info("[native-err] " + line);
				while(line != null);
			} catch (IOException e) {
				SophieLog.error("ErrorDumper terminated", e);
			SophieLog.info("ErrorDumper exiting");


It is important to notice that, this thread is replacement for the old methods dumpError() and dumpErrorDelayed() in the NativeBridge class. This thread class is also located in the NativeBridge class.

comment:6 Changed 10 years ago by meddle

  • Design_owners set to milo, stefan
  • Status changed from s3b_implementation_finished to s3c_implementation_ok
  • Imp._owners set to milo, stefan
  • Analysis_reviewers set to stefan
  • Analysis_score changed from 0 to 3
  • Imp._reviewers set to deyan, todor
  • Design_score changed from 0 to 3.5
  • Design_reviewers set to meddle, pap
  • Imp._score changed from 0 to 3.5

Merged to the trunk at [8574].

comment:7 Changed 8 years ago by meddle

  • Status changed from s3c_implementation_ok to closed
  • Resolution set to obsolete

Closing all the tickets before M Y1

Note: See TracTickets for help on using tickets.