Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The maximum playback duration has been reached #1272

Closed
denybear opened this issue Aug 29, 2023 · 4 comments
Closed

The maximum playback duration has been reached #1272

denybear opened this issue Aug 29, 2023 · 4 comments
Labels
Milestone

Comments

@denybear
Copy link

FluidSynth version

FluidSynth executable version 2.3.3
Sample type=double

Describe the bug

Playing a midi song, then stopping it, then playing it again cause the following message: fluidsynth: error: The maximum playback duration has been reached. Terminating player!

Expected behavior

message should not display, and song should be played again

Steps to reproduce

Please refer to code below

Additional context

code snippet

/* includes */
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <signal.h>
#include <dirent.h>
#include <time.h>
#ifndef WIN32
#include <unistd.h>
#endif

#include <fluidsynth.h>


int main ( int argc, char *argv[] )
{
// FLUIDSYNTH player
fluid_player_t* player;
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_audio_driver_t* adriver;
int sf2_id;		// id of sf2 file currently loaded

// init fluidsynth
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
// jack as audio driver
// sample rate as the one defined in jack
fluid_settings_setstr(settings, "audio.driver", "jack");

// start the synthesizer thread
adriver = new_fluid_audio_driver(settings, synth);

// load sound font				
sf2_id = fluid_synth_sfload(synth, "./soundfonts/00_FluidR3_GM.sf2", TRUE);

// create new player
player = new_fluid_player(synth);

// load midi file
fluid_player_add(player, "./songs/5B_Rock1.mid");
// set endless looping of current file
fluid_player_set_loop (player, -1);

// play the midi file
fluid_player_seek (player, 0);
fluid_player_play (player);
sleep (10);

fluid_player_stop (player);
sleep (5);

// play the midi file
// error pops up here !
fluid_player_seek (player, 0);
fluid_player_play (player);

while (1);
}

5B_Rock1.mid.zip

@Snoucher
Copy link

Snoucher commented Sep 1, 2023

I tested fluidsynth-2.3.0-2-x86_64 dating 22-Sep-2022 10:34 on the arch linux archive, It works wonderfully. This is probably a regression.

@denybear
Copy link
Author

denybear commented Sep 1, 2023

Hi, indeed this is likely a regression.
I have tried with previous Fluidsynth version 2.3.2 (Apr 2), and it works fine. Issue occurs with Fluidsynth 2.3.3.

@derselbst
Copy link
Member

Thanks for the report. Yes, there have been a couple of improvements to the player recently, yet we don't have any tests for it though, so things are likely to break sadly.

@derselbst
Copy link
Member

A fix for this was merged to master and will be part of 2.3.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants