zsnes sound works intermittently on multi-core systems

Bug #332794 reported by Joel Ebel
6
Affects Status Importance Assigned to Milestone
zsnes (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: zsnes

There is a bug in the threading code of zsnes which causes sound to work intermittently on multi-core systems which use libao for sound output. For me sound worked about half the time. I've attached a debdiff which fixes this problem. In the zsnes forums, this problem was first mentioned here:

http://board.zsnes.com/phpBB2/viewtopic.php?t=10918

later, zsnes unofficially released 1.51b which fixed this threading issue, as well as fixed build issues with gcc 4.3+.

http://board.zsnes.com/phpBB2/viewtopic.php?t=11513

The attached debdiff brings the code up to match what's in the 1.51b package. Alternatively, we could rebuild the package based directly on the 1.51b original package, but that would mean diverging more from debian's package.

Revision history for this message
Joel Ebel (jbebel) wrote :
Revision history for this message
Joel Ebel (jbebel) wrote :

The changes in this debdiff are as follows:
* Support building with gcc 4.3+. This was previously handled by a dpatch, but this update removes that dpatch. Now this matches how it is done in upstream version 1.51, which is strangely different from the 1.51 orig.tar.gz currently in the zsnes source package.
* Fixes a sound threading bug which breaks sound on multi-core systems.

Since sound being broken on multi-core systems seems like a significant bug, I'm nominating this patch for a feature freeze exception. I have built and tested this package and it works as expected.

Since 1.51b was an unofficial release, there is no upstream changelog for the new version. in addition, there appears to be no changelog between the 1.51 released in the ubuntu source package vs the 1.51 currently available for download on zsnes website.

This seems to be more of a bug fix patch than a feature change, but I'm subscribing motu-release for advice.

Revision history for this message
Joel Ebel (jbebel) wrote :

Actually, there's one more change I'd like to sneak in here. The desktop file is currently configured to run zsnes with -ad sdl which sets the sound ouput driver to sdl. I'll never use the desktop file, so this honestly doesn't affect me, but it bugs me as the wrong way to do this. It was probably put in because someone found that sdl worked well for them, but that's not the best solution for everyone, and it shouldn't be forced. Sound is zsnes finicky, and may require any of a variety of settings. A user can set the sound configuration the way he wants in ~/.zsnes/zsnesl.cfg, but the next time he runs zsnes with the provided desktop file, his config file will get *overwritten* with the sdl driver as specified in this .desktop file. I updated the debdiff to remove the -ad sdl from the .desktop file included in this package so users can configure the sound as they see fit in their personal config and not have it overwritten the next time they run zsnes with the .desktop file.

Revision history for this message
Joel Ebel (jbebel) wrote :

one more thing to add about the .desktop change and why it relates to this bug. One possible reason the -ad sdl option was originally added to the .desktop file was to work around the sound threading issue. It's my understanding that it only affects libao for sound output. Not sdl. If this patch gets applied, the need for "suggesting" sdl is no longer present.

Revision history for this message
Nathan Handler (nhandler) wrote :

I have tested this patch, and it builds/installs/runs fine. It also fixes the sound issue that is present in the jaunty version of zsnes. I am ACK'ing this Feature Freeze Exception request.

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 332794] Re: zsnes sound works intermittently on multi-core systems

bug fixes don't need FFe.

Revision history for this message
Luca Falavigna (dktrkranz) wrote :

Subscribing u-u-s to receive sponsorship.

Changed in zsnes:
importance: Undecided → Medium
status: New → Confirmed
Changed in zsnes:
assignee: nobody → quadrispro
status: Confirmed → In Progress
Revision history for this message
Alessio Treglia (quadrispro) wrote :

Uploaded.

Changed in zsnes:
assignee: quadrispro → nobody
status: In Progress → Fix Committed
Revision history for this message
Alessio Treglia (quadrispro) wrote :

zsnes (1.510-2.2ubuntu2) jaunty; urgency=low

  * Bring source code up to version 1.51b
    * Removes the need for gcc-4.3-ftbfs and replace_crc32 patches.
    * Fixes a threading issue which broke sound on multi-core systems.
  * Remove -ad sdl from the .desktop file. It should not be forced on users.

Changed in zsnes:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.