[tim-janik/beast] BSE: driver-alsa.cc: fix crash in retrigger code (#127)

I was playing a bit with the new alsa driver, and I found that for my first hw device, it crashed like this:

stefan@quadcorn:~/src/3rd-tree/ghbeast (master *% u=)$ LANG=C beast
beast: unable to acquire soft realtime priority: Permission denied
beast-0.15.0: bse/bseengineutils.cc:632: bse_engine_const_zeros: assertion failed: smaller_than_BSE_STREAM_MAX_VALUES <= (1024 )
beast-0.15.0: pcm.c:1424: snd_pcm_writei: Assertion `size == 0 || buffer' failed.

The problem is that bseengineutils.cc imposes a limit on how big a const zeros float block can be, and on my device, the amount of zero data for the retrigger was larger than 1024 floats, so the driver ended up trying to write a null pointer.

I fixed this crash, and I think I also found another mistake here: n_channels was not taken into account by your original code (buffer_length / 2 would be wrong), so in the fixed version it uses n_channels * sizeof (int16) bytes per frame.

You can view, comment on, or merge this pull request online at:


Commit Summary

File Changes

Patch Links:

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]