Skip to content

Commit

Permalink
- Finetuned ALSA driver for better MIDI timing accuracy when used wit…
Browse files Browse the repository at this point in the history
…h ALSA-Pulse configurations
  • Loading branch information
sergm committed Sep 3, 2013
1 parent 4d98dde commit 56d9e5f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mt32emu_alsadrv/src/alsadrv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ snd_seq_t *seq_handle = NULL;


/* Buffer infomation */
#define FRAGMENT_SIZE 1024
//#define PERIOD_SIZE 1024
#define PERIOD_SIZE 512
#define FRAGMENT_SIZE 256 // 2 milliseconds
#define PERIOD_SIZE 128 // 1 millisecond
int buffermsec = 100;
int minimum_msec = 40;
int maximum_msec = 1500;
Expand Down Expand Up @@ -268,7 +267,7 @@ int alsa_init_pcm(unsigned int rate, int channels)
return -1;
}

/* allow the transfer when at least FRAGMENT_SIZE samples can be processed */
/* allow the transfer when at least PERIOD_SIZE samples can be processed */
err = snd_pcm_sw_params_set_avail_min(pcm_handle, swparams, PERIOD_SIZE >> 2);
if (err < 0) {
printf("Unable to set avail min for playback: %s\n", snd_strerror(err));
Expand Down

0 comments on commit 56d9e5f

Please sign in to comment.