Skip to content

Commit

Permalink
fix alsa hw params constraints
Browse files Browse the repository at this point in the history
Current pcm plugin code results in very strange buffer and period size
selections if the application sets period size before buffer size. This
simple fix corrects that issue. There does not appear to be any clue in
the ALSA docs as to why the period size max needs to be so high, but
looking at other io plugin examples they all appear to set the max
period to at least 1MB and in testing this change always gives sensible
values for both period and bufffer sizes.
  • Loading branch information
borine committed Jun 11, 2021
1 parent be1d3bb commit e89a71a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/asound/bluealsa-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ static int bluealsa_set_hw_constraint(struct bluealsa_pcm *pcm) {
snd_pcm_format_physical_width(get_snd_pcm_format(pcm->ba_pcm.format)) / 8;

if ((err = snd_pcm_ioplug_set_param_minmax(io, SND_PCM_IOPLUG_HW_PERIOD_BYTES,
min_p, 1024 * 16)) < 0)
min_p, 1024 * 1024)) < 0)
return err;

if ((err = snd_pcm_ioplug_set_param_minmax(io, SND_PCM_IOPLUG_HW_CHANNELS,
Expand Down

0 comments on commit e89a71a

Please sign in to comment.