Opened 9 years ago

Closed 9 years ago

#9031 closed defect (Fixed)

Pulse audio assert failure

Reported by: markk Owned by: JYA
Priority: blocker Milestone: 0.24
Component: MythTV - General Version: Unspecified
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Mythfrontend is repeatedly crashing on video playback startup. Backtrace and log attached.

Attachments (3)

pulse-audio-assert-failure-1.txt.tar.gz (10.2 KB) - added by markk 9 years ago.
pulse-audio-assert-failure-2.txt.tar.gz (8.1 KB) - added by markk 9 years ago.
Slightly different assertion
new-pulse-handler.diff (12.8 KB) - added by markk 9 years ago.
Complete re-write of the suspend code

Download all attachments as: .zip

Change History (13)

Changed 9 years ago by markk

Changed 9 years ago by markk

Slightly different assertion

comment:1 Changed 9 years ago by beirdo

Owner: set to JYA
Status: newassigned

comment:2 Changed 9 years ago by beirdo

Priority: minorblocker

Changed 9 years ago by markk

Attachment: new-pulse-handler.diff added

Complete re-write of the suspend code

comment:3 Changed 9 years ago by anonymous

I've attached a patch with a complete re-think of the suspend code. It uses a global singleton that should:-

  • be thread safe and entirely serialised
  • handle wildly asynchronous callbacks gracefully
  • be faster as we don't need to re-connect each time.
  • work

My only real concern is unexpected server behaviour over long periods and, as noted in the code, it's not entirely clear whether we need to 'drain' the connection at any point.

comment:4 Changed 9 years ago by markk

On one test system here, using the myth_system call (IsPulseAudioRunning?) to check whether the server is present takes around 0.13 seconds. If I disable that call and just let the PulseAudio? connection fail takes around 0.02 seconds - a saving of around 1/10th second each time we start the frontend and start playback.

comment:5 Changed 9 years ago by markk

(In [26702]) Add a new PulseHandler? class that will be used to suspend/resume the PulseAudio? server. Refs #9031

comment:6 Changed 9 years ago by markk

(In [26703]) Switch over to using the new PulseHandler? class.

The PulseAudio? suspend/resume code now uses a global singleton to interact with the sound server. It should be entirely thread safe, handle unexpected callbacks from the server in a graceful manner, be faster in operation (we no longer connect each time) and it does not require an additional thread to operate.

A couple of items still need cleaning up:-

is not compiled in and warn the user when PulseAudio? is running (once on startup)

  • really need to cleanup the connection on exit

(Suspend(PulseHandler::kPulseCleanup)) to ensure we don't leak connections in the server.

Refs #9031

comment:7 Changed 9 years ago by markk

(In [26704]) Remove the old PulseAudio? suspend code. Refs #9031

comment:8 Changed 9 years ago by markk

(In [26705]) Re-instate the PulseAudio? warning on systems that are not compiled with PulseAudio? support. This is a once only warning the first time the audio device is opened. Refs #9031

comment:9 Changed 9 years ago by markk

(In [26706]) Small fix to the PulseHandler? suspend code to ensure we return when asked to cleanup and no object exists. Refs #9031

comment:10 Changed 9 years ago by markk

Resolution: Fixed
Status: assignedclosed

(In [26707]) Cleanup the PulseAudio? suspend/resume object when exiting MythFrontend. This ensures we don't leak connections in the PulseAudio? lib/server.

Closes #9031

Note: See TracTickets for help on using tickets.