-
Notifications
You must be signed in to change notification settings - Fork 3
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
WFDB psf_fseek
bug happening again
#72
Comments
Unfortunately not a bug in soundfile/libsndfile, this looks like a bug in libFLAC.
rdsamp -r wavetest -f s76075827 # OK flac -df -o /dev/null wavetest.dat --skip=76075826 # OK |
Oof. As I unfortunately suspected, it looks like libFLAC is hitting a false sync code (that occurs by chance within the encoded data.) This is something I worried about when I was studying the FLAC format some years ago, but I tried and wasn't able to cause such an error even intentionally. And... guess what? The problem here doesn't seem to occur with libFLAC 1.3.3. Apparently there were some changes to the sync algorithm in libFLAC 1.4.0, and where the old version correctly ignored the spurious sync code, the new version throws an error. :( (Seeking to sample 76079510 jumps to byte 274485255; seeking to sample 76079511 jumps to byte 274485260. The false sync code is at byte 274485259.) Running a test now but I suspect the problem won't happen with libFLAC 1.3.3. One way we could work around this is to add a seektable (which increases the file size slightly, and should also improve random I/O performance.) This can be done using the |
FWIW, waveform_benchmark passes with libFLAC 1.3.3-2+deb11u2 (and libsndfile 1.0.31-2), but it also gives different and less efficient compression (397M bytes versus 362M), so not really conclusive. |
Thanks @bemoody . It seems reasonable to me to use your work-around for now given that we'd like to run benchmarking on FLAC compressed WFDB files soon. Could you explain how to update the files / system / env for this work-around? |
It seems like the bug might be fixed in the latest libFLAC. Tested: "can we perform random seeks to every sample number between 76075000 and 76079600?"
Compare MIT-LCP/wfdb-python#486 where I found that:
So it looks like we have two separate problems, but hopefully both are now fixed in libFLAC upstream, and should be fixed in the next version of For now I've installed the Debian unstable package (1.4.3) on the wavebench server. |
The WFDB compressed format is running without error on all of the files in the benchmarking waveform suite when using the updated package mentioned in the post above. For the purposes of this project, I will close this issue. It is being tracked in MIT-LCP/wfdb-python#488 . |
In #63 the
soundfile
version was changed in an attempt to get around apsf_fseek
error. This error is occurring again. This time is happening with a WFDB file from a GE ICU monitor (withsoundfile==0.11.0
orsoundfile==0.10.2
):The text was updated successfully, but these errors were encountered: