[SRU] Players terminate after stopping and restarting

Bug #2047656 reported by Michael Mehl
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
fluidsynth (Ubuntu)
Fix Released
Undecided
Unassigned
Mantic
Fix Released
Medium
Erich Eickmeyer
Noble
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

Fluidsynth 2.3.3 has an issue where it will terminate upon start/stop of playback of a midi song, causing issues for a multitude of players including EasyABC. This will cause said player to be unable to playback again and perhaps even crash. See https://github.com/FluidSynth/fluidsynth/issues/1272, fix in https://github.com/FluidSynth/fluidsynth/commit/377ab9db2f87bc407eeb940e0361edc77da77055. This is the included patch with the upload of 2.3.3-2.1ubuntu-0.23.10.1

[ Test Case ]

* To reproduce the bug:

# download sample midi file from wikiepdia:

wget https://upload.wikimedia.org/wikipedia/commons/5/55/MIDI_sample.mid

# play it with fluidsynth

fluidsynth MIDI_sample.mid

# at this point, you will actually be at a prompt. Wait for the song to play for a few seconds, then issue a stop command at that prompt:

player_stop

# And this is where the bug happens. Issue a continuation:

player_cont

And this is where things break:

> player_cont
> fluidsynth: error: The maximum playback duration has been reached. Terminating player!

* With the fixed package, the audio resumes playback.

[ What could go wrong ]

This is actually a fix for a regression that was found in version 2.3.3 of fluidsynth and fixed for 2.3.4, which can be found in noble. I think the only thing that can go wrong here is that this patch is not the actual fix and we need to find more solutions within.

I have tested this in my PPA and it *seems* to fix it, but it would be nice if the original reporter could verify once this lands in proposed.

[ Other information ]

Included below is the original report, in which case the reporter deduces that the problem is the binary being spat-out is the 2.3.2 version from the 2.3.3 sources. This is not the case, as it appears to be confusion due to the -2.1 Debian revision number. I assure, this is definitely the 2.3.3, and the bug, per the github link in the Impact section, is pertinent to this version.

---

The latest package of fluidsynth should include the sources from version 2.3.3 but the binary includes only version 2.3.2

This version has a bug (see https://github.com/FluidSynth/fluidsynth/issues/1272), which leads to problems in EasyABC.

Please include the latest version 2.3.3 from upstream in the ubuntu package.

--

Description: Ubuntu 23.10
Release: 23.10
Codename: mantic

$ apt-cache policy libfluidsynth3
libfluidsynth3:
  Installiert: 2.3.3-2.1
  Installationskandidat: 2.3.3-2.1
  Versionstabelle:
 *** 2.3.3-2.1 500
        500 http://de.archive.ubuntu.com/ubuntu mantic/universe amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Erich Eickmeyer (eeickmeyer) wrote :

I'm on break until Jan 2, but I'll try to fix this as an SRU.

Changed in fluidsynth (Ubuntu):
importance: Undecided → Medium
milestone: none → mantic-updates
status: New → Triaged
Changed in fluidsynth (Ubuntu Mantic):
status: New → Triaged
Changed in fluidsynth (Ubuntu Noble):
status: Triaged → Fix Released
Changed in fluidsynth (Ubuntu Mantic):
importance: Undecided → Medium
Changed in fluidsynth (Ubuntu Noble):
importance: Medium → Undecided
milestone: mantic-updates → none
Changed in fluidsynth (Ubuntu Mantic):
milestone: none → mantic-updates
assignee: nobody → Erich Eickmeyer (eeickmeyer)
Revision history for this message
Erich Eickmeyer (eeickmeyer) wrote :

Just going to add: the Ubuntu version *is* 2.3.3, don't let the -2 fool you, that's the Debian revision in the packaging. Looks like it just needs the patch you are referring to which got added between 2.3.3 and 2.3.4, so I can do that, but as I said in my previous comment, it won't be until after January 2 since I'm on break until then.

Changed in fluidsynth (Ubuntu Mantic):
status: Triaged → In Progress
summary: - libfluidsynth3 2.3.3-2.1 does not contain the version 2.3.3 but only
- version 2.3.2
+ [SRU] Players terminate after stopping and restarting
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote :

> * Begin midi playback in any midi player using fluidsynth from the terminal

This is not a reproducible test case that can be actioned by someone just reading the bug. Please provide a specific test case showing how to reproduce the failure.

If possible, it would be best to also provide a reference midi file to use.

Changed in fluidsynth (Ubuntu Mantic):
status: In Progress → Incomplete
Revision history for this message
Michael Mehl (mmehl) wrote :

Here is the test in python (you can chooses any midifile and adapt the variable midifile accordingly).
You can also adapt the lib variable.

--

from ctypes import c_int, c_double, c_char_p, byref, CDLL
import logging
import time

lib="./libfluidsynth.so.3.2.2"
fluidsynth = CDLL(lib)
def b(s):
    return s.encode("latin-1")

midifile="airwolf.mid"
settings = fluidsynth.new_fluid_settings()
fluidsynth.fluid_settings_setnum(settings, c_char_p(b('synth.gain')), c_double(0.2))

synth = fluidsynth.new_fluid_synth(settings)
filename="/usr/share/sounds/sf2/FluidR3_GM.sf2"
soundfont = fluidsynth.fluid_synth_sfload(synth, c_char_p(b(filename)), 0)

player = fluidsynth.new_fluid_player(synth)

fluidsynth.fluid_settings_setstr(settings, c_char_p(b('audio.driver')), c_char_p(b('pulseaudio')))

audio_driver = fluidsynth.new_fluid_audio_driver(settings, synth)

errcode = fluidsynth.fluid_player_add(player, c_char_p(b(midifile)))
if (errcode!=0): logging.warning("add midi failed")

errcode = fluidsynth.fluid_player_seek(player, 0)
if (errcode!=0): logging.warning("seek failed")

total_ticks = fluidsynth.fluid_player_get_total_ticks(player)

errcode = fluidsynth.fluid_player_play(player)
if (errcode!=0): logging.warning("play failed")

total_ticks = fluidsynth.fluid_player_get_total_ticks(player)

time.sleep(1)

errcode = fluidsynth.fluid_player_stop(player)
if (errcode!=0): logging.warning("stop failed")

current_tick = fluidsynth.fluid_player_get_current_tick(player)
total_ticks = fluidsynth.fluid_player_get_total_ticks(player)

errcode = fluidsynth.fluid_player_play(player)
if (errcode!=0): logging.warning("continue failed")

description: updated
description: updated
Changed in fluidsynth (Ubuntu Mantic):
status: Incomplete → In Progress
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Here is a better test case in my opinion. If you (reporter, or uploader, or Eric) agree, could you please update the test plan in the description?

To reproduce the bug:

# download sample midi file from wikiepdia:

wget https://upload.wikimedia.org/wikipedia/commons/5/55/MIDI_sample.mid

# play it with fluidsynth

fluidsynth MIDI_sample.mid

# at this point, you will actually be at a prompt. Wait for the song to play for a few seconds, then issue a stop command at that prompt:

player_stop

# And this is where the bug happens. Issue a continuation:

player_cont

And this is where things break:

> player_cont
> fluidsynth: error: The maximum playback duration has been reached. Terminating player!

With the fixed package, the audio resumes playback.

Revision history for this message
Erich Eickmeyer (eeickmeyer) wrote :

Andreas, I fully support this. I can update the description with that as it's a much simpler reproduction than a python script. :)

description: updated
Revision history for this message
Andreas Hasenack (ahasenack) wrote : Please test proposed package

Hello Michael, or anyone else affected,

Accepted fluidsynth into mantic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/fluidsynth/2.3.3-2.1ubuntu0.23.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-mantic to verification-done-mantic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-mantic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in fluidsynth (Ubuntu Mantic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-mantic
Revision history for this message
Michael Mehl (mmehl) wrote (last edit ):

I've tested the proposed package and EasyABC now works as expected.
It is possible to play and pause the song and it is possible to freely select a random position in the song.

Thanks for the fix

Version »2.3.3-2.1ubuntu0.23.10.1« (Ubuntu:23.10/mantic-proposed [amd64]) für »fluidsynth«

Michael Mehl (mmehl)
Changed in fluidsynth (Ubuntu Mantic):
status: Fix Committed → New
Revision history for this message
Erich Eickmeyer (eeickmeyer) wrote :

Hi Michael,

Per the instructions, don't change the status to "New", but keep as "Fix Committed". You simply needed to change the tags to "verification-done-mantic" and "verification-done", which I have done for you.

Just for future reference. Thanks!

Changed in fluidsynth (Ubuntu Mantic):
status: New → Fix Committed
tags: added: verification-done verification-done-mantic
removed: verification-needed verification-needed-mantic
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for fluidsynth has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package fluidsynth - 2.3.3-2.1ubuntu0.23.10.1

---------------
fluidsynth (2.3.3-2.1ubuntu0.23.10.1) mantic; urgency=medium

  * Patch to fix player termination after stopping and restarting (LP: #2047656)

 -- Erich Eickmeyer <email address hidden> Wed, 03 Jan 2024 09:39:14 -0800

Changed in fluidsynth (Ubuntu Mantic):
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.