Repository navigation
Broken with libFLAC < 1.4.0 ("internal psf_fseek() failed") #486
Copy link
Copy link
Open
Description
Activity
Okay, sorry, got it. I'm now first doing this:
base64 -d -i example.txt -o example.zip gzip -dc example.zip > example.datOn MacOS 14.6 Beta (23G5061b) M1 Max, I see the error for soundfile==0.11.0 but not for 0.12.1
soundfile==0.11.0
pip install soundfile==0.11.0Traceback (most recent call last): File "<string>", line 1, in <module> File "/Users/tompollard/projects/wfdb-python/env/lib/python3.9/site-packages/soundfile.py", line 892, in read frames = self._array_io('read', out, frames) File "/Users/tompollard/projects/wfdb-python/env/lib/python3.9/site-packages/soundfile.py", line 1341, in _array_io return self._cdata_io(action, cdata, ctype, frames) File "/Users/tompollard/projects/wfdb-python/env/lib/python3.9/site-packages/soundfile.py", line 1353, in _cdata_io self.seek(curr + frames, SEEK_SET) # Update read & write position File "/Users/tompollard/projects/wfdb-python/env/lib/python3.9/site-packages/soundfile.py", line 799, in seek _error_check(self._errorcode) File "/Users/tompollard/projects/wfdb-python/env/lib/python3.9/site-packages/soundfile.py", line 1404, in _error_check raise LibsndfileError(err, prefix=prefix) soundfile.LibsndfileError: Internal psf_fseek() failed.soundfile==0.12.1
pip install soundfile==0.12.1Runs without error.
After hammering on this a bit more, it looks like this is actually a bug in libFLAC, and not a bug in libsndfile.
For example, running
flac -df -o /dev/null bug486.dat --skip=78420fails.However, this bug is not detected by the prober I posted in #488. And as we've seen, this bug exists in libFLAC 1.3.3 but not 1.4.2, whereas the other bug exists in 1.4.2 but not 1.3.3.
1.2.0 broken
...
1.3.3 broken
1.3.4 brokenfixed by 3fc5ba46375e48009cd9428091cd2ffd242de6b9
1.4.0 working
1.4.1 working
1.4.2 working
1.4.3 workingReacted by Brian Gow- changed the title
[-]Broken with some versions of SoundFile ("internal psf_fseek() failed")[/-][+]Broken with libFLAC < 1.4.0 ("internal psf_fseek() failed")[/+]on Jul 12, 2024
Metadata
Metadata
Assignees
Labels
No labels
Some versions of the SoundFile package on PyPI, including the latest version (0.12.1), appear to be broken. It appears that something is wrong with the precompiled "libsndfile_x86_64.so". I have no idea about other platforms. I don't know if this is actually a bug in libFLAC, or in libsndfile, or in SoundFile, or a bug in how libFLAC/libsndfile was compiled.
The latest version in the libsndfile-binaries repo is possibly fixed, but there hasn't been a new release of SoundFile for a while.
Here is an example file, gzipped and base64ed:
I think this is a valid FLAC file, though I'm not sure. Running
python3 -c 'import soundfile; soundfile.SoundFile("example.dat").read(78419)'should succeed.