This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#5952 - crash while recording in wavpack
Attached to Project:
Rockbox
Opened by Oliver (polluxx2006) - Wednesday, 06 September 2006, 23:06 GMT+2
Opened by Oliver (polluxx2006) - Wednesday, 06 September 2006, 23:06 GMT+2
|
Detailsi tested recording a bit. i first recorded two mp3-files without problems... approx. 1,5 minutes.
then i changed to wv and as soon i started recording, it crashed. could recover it pressing the play-button and rockbox booted again. it wrote a "0kB"-file for the crashed recording. there was some debug (?)-info on the screen but i cant remember what it was. ill wrie it down next time ;) |
This task depends upon
Closed by Thom Johansen (preglow)
Wednesday, 04 October 2006, 14:13 GMT+2
Reason for closing: Fixed
Additional comments about closing: Okiedokie
Wednesday, 04 October 2006, 14:13 GMT+2
Reason for closing: Fixed
Additional comments about closing: Okiedokie
error I05:
at <some hex number>
Rockbox recovered from the crash after pressing PLAY.
I will investigate more to write down the exact debug message.
On an unrelated subject, I tried playing Doom a few times and had crashed with I00 (in menus). It was fine before. Perhaps some recent change destablilized things somewhere.
BTW: I have been doing mostly programming and practically no running of rb of late and something really could have changed which I've been "away".
I made it to crash again after stopping the recording on the current built 060909-1036.
The message is different:
I40:PDIR1FULL
at 000000D4
I attached my settigs. I did not make it to crash with the settings cleared.
I also encountered other crashes when leaving the "Recording Settings" menu entered from the FM Radio screen.
I described it in this bug report: http://www.rockbox.org/tracker/task/5963
You shouldn't need to create a new bug report each time with related items.
- before or during recording (every 2nd try)
I40:PDIR1FULL
at 00000005
I40:PDIR1FULL
at 00000008
- after stopping the recording (once)
I40:PDIR1FULL
at 000000D3
What I don't understand here is why Mono in particular or do you just mostly record mono files? Channel mixing is done in the codec itself so DMA1 should still run.
I did not test it with stereo neither with other codecs (MP3, WAV). I will test these options too.
Do I understand it correctly that the selected codec can cause the crashes even before starting the recording (with prerecording turned off)?
This time I tested recording radio to WavPack, WAV and MP3 on iriver H120.
The builds around 060915 stopped the recording spontaneously instead of a crash (WV,WAV,MP3 320kbps). It seems that stop was more frequent with higher bitrate. With WV stereo it stopped mostly after 50 seconds of recording up to 10 minutes. With MP3 192kbps it did not stop.
The builds after the 17 Sep 18:52 change do not stop recording spontaneously anymore but there are other problems:
- Often the harddrive writing is very log with WV (I have seen 7 minutes). During the writing it behaves normally but the file size value on the display is not updated. The recorded file is often corrupted. There are lost samples during the start of HDD write or the file ends shortly after the time of beggining the HDD write. WAW does not seem to have this problem.
- With WV the first HDD write is after 18.7 MB and sometimes the following intervals are much shorter (like 5 MB). With WAV the first HDD write is after 25.9 MB!
(2) file writing after 18.7MB:
This is true, because to my understanding of the WVPACK algorithms, there is no real worst case compression rate. The encoder uses the 25MB as if there is no compression available. => Can be tweaked, if there is a worst case compression rate on wavpack. (say 1200kbit/s?)
(3) writing after like 5MB:
This is again related to the slow writing. When the recording has finally finished with writing, the buffer may be already near full again. => automatically fixed, if (1) is fixed
3) ^^
2) Would WVPACK actually produce a larger output than the pcm size? If so, the encoder doesn't take the WavpackHeader into account if the compressed data is the same size as the pcm data.
From http://www.wavpack.com/397/wavpack_doc.htm:
For "worst case" files (those with very high level, noise, or distortion) WavPack may actually create a .WV file slightly larger than the original .WAV file, and this will be indicated as "negative" compression. Some lossless compression programs (like WinZIP) detect this case and simply store the data without compression. However, since I have not actually seen a real audio file do this, I have decided not to go to the extra trouble of handling such a case and besides, even if this happens, the .WAV file will still be correctly restored.
This thread could be probably closed?
Some more comments regarding the early buffer flushing when using WavPack:
* When I record WavPack in mono it starts to write the buffer about 13 MB.
It should not be so much worse than stereo WavPack probably.
* I would like to explain you my idea how the buffer flushing should work.
Let's say that RB needs to start writing 5 seconds before filling the buffer.
- 5 seconds is 862 kB with CD Audio bitrate 1.4112 Mbps.
With WAV Rockbox starts flusing at 25.9 MB it would mean that the buffer size
is approximately 26.7 MB.
- Let's say that the WavPack's worst case is 1.6 Mbps. It is 977 kB during 5 seconds.
It means that Rockbox should start writing when the buffer is filled to 25.7 MB (26.7 MB - 977 kB).
It would still have 5 seconds to relieve the buffer in the worst case.
* It seems to me that Rockbox starts flushing the buffer according to the number of read samples
(recording time) not according to the actual fulness of the buffer with output from the codec
like in my idea I described above.