Thanks for the reply Daniel. I realised that Matlab's default mode is DirectSound, so I've switched to ASIO (using pa_wavplay).
Unfortunately, the truncation problem remains, but a much shorter section of the end of the sound gets truncated with ASIO. In fact, nothing is truncated if the sound has a multiple of 256 samples. Otherwise, the sound is truncated to be a multiple of 256 samples, losing up to 255 samples at the end.
That sounds like it might be presenting all the full buffers, omitting the last partially filled buffer. Is that normal?
I've struggled to find something non-Matlab to use that definitely uses ASIO. PortAudio has a demo (http://www.portaudio.com/download.html) that plays sine waves. It ends with a loud click, but I can't be sure that's part of the same problem, because I'm not sure whether the sine waves are set up to fade out nicely in the first place. Does anyone else have a suggestion for Win7-friendly ASIO programs?
Also, is ASIO recommended for Win 7/Fireface800? Matlab can be made to work with ASIO, but using its built-in sound functions (sound, wavplay, audioplayer) seems preferable for our purposes, and I think they're always DirectSound.