<br><div class="gmail_quote">Fabian Greffrath <span dir="ltr">&lt;<a href="mailto:fabian@greffrath.com">fabian@greffrath.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Am 01.12.2010 12:09, schrieb Sergio:<div class="im"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&quot;File larger than allowed for WAV files, may play truncated!&quot;<br>
So it seems like to be a WAV format limitation...<br>
</blockquote></div>
[...]<div class="im"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
So duration is about 2/3 of real length for 6GiB and 1/3 for 12GiB,<br>
looks like wav headers use uint32 to store data stream size counted in<br>
bytes.<br>
</blockquote>
<br></div>
The question is, what shall we do with this bug report then, if the cause is really simply a limitation in the WAV header format?</blockquote><div>š</div><div>Yes, I&#39;ve searched the web for info on wav format - it is a well known problem with WAVes (among other numerous problems). Wav&#39;s size is limited twice, as both RIFF container&#39;s size field and RIFF-WAV data-chunk size field are uint32. More over, people say due to number of badly implemented software, real limitation often is half of theoretical - near 2GiB due to mistakenly used by programmers signed int for data size variables.<br>
So this bug (or feature) is the global problem with WAVes - and common sound processing problem as long as WAVes are used as universal interchange sound format. There are known alternatives like BWF and RF64, &quot;partially compatible&quot; with original WAVs, but the first uses &quot;linked&quot; files, the second uses one big file with chunked data. I think, until some wav-replacement format is commonly accepted, the easiest solution would be just allow sound processing programs to ignore datasize specified in header on user request - this definitely means &quot;to use broken RIFF-WAV files&quot;.  (Or use raw datastream of course, though this requires to pass format information by hand.)<br>
Anyway, it is not suitable place to discuss the so wide problem.<br>Bug with size may be renamed to feature, but warning somewhere in manpage or stderr output is desireable of course.<br><br>Some words about mplayer: when it has finished to write too large file, it prints warning; if file is randomly-accessable, mplayer rewinds and puts &quot;almost maximum&quot; (a bit smaller than 4GiB) value into RIFF and WAV-data headers; if file is not (output sent to pipe), mplayer prints another additional warining and the file rests with &quot;initial default values&quot; those are &quot;almost safe-maximum&quot; (a bit smaller than 2GiB).<br>
š<br>Here we can see, WAVes are really wrong choice for &quot;universal sound format&quot;, as the format originally was not designed for streaming and sending data through pipes. &quot;Datastream size&quot; has to be written to file header but it is often unknown at time of writing, WAV specs allows formatspec-chunk and data-chunk go in any order and so on...<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 š š š šIn addition to this one, there is error with output-error<br>
 š š š šhandling:<br>
 š š š šin case of running out of disk space (that is very possible with<br>
 š š š šso giant WAVs) no error reported, no error status returned, and<br>
 š š š šdecoding process continues to nowhere.<br>
<br>
 š šAlright, that&#39;s a completely different issue (and certainly worth<br>
 š šits own bug report) and I&#39;ll try to have a look at it sooner or later.<br>
</blockquote>
<br></div>
Regarding this &quot;bug&quot;... IIRC dcadec just blabbers to stdout and this is redirected to some file via the &quot;&gt;&quot; operator by the shell. Isn&#39;t it then the shell&#39;s duty to handle the file operator (so there isn&#39;t much dcadec can do) or am I missing something?<br>
<font color="#888888">
<br></font></blockquote><div><br>As far as I know, shell forks, sets up file handles as needed and execs program, program uses these &quot;inherited&quot; redirected filehandles directly. It may check file type, rewind it if it is of randomly-accessable type, close and so on, output is not &quot;piped to target file through shell process&quot;. So it is the program&#39;s business to check for success with file ops.<br>
<br>$ dcadec -o wavall audio-rus-mvo-6ch.dtsš &gt; dummy-6ch.wavš 2&gt; /dev/nullš &amp;š # push to background<br>[1] 666<br>$ ps<br>š PID TTYššššššššš TIME CMD<br>š 666 pts/1ššš 00:00:02 dcadec<br>š 667 pts/1ššš 00:00:00 ps<br>
š3093 pts/1ššš 00:00:00 bash<br>$ ls -l /proc/666/fd/1<br>l-wx------ 1 sergio sergio 64 äÅËš 6 17:27 /proc/666/fd/1 -&gt; /mnt/data/dummy-6ch.wav<br>$<br><br>I made a look into sources, operation return code or stream state are simply not checked after calls to fwrite in libao/audio_out_wav.c in wav_play and wav_close functions.<br>
<br>š</div>And by the way one more minor-minor-minor problem:<br><br>sergio@bagira:~/wrk/dcadec/libdca-0.0.5$ LC_ALL=enš iconv -t UTF32LE AUTHORSš &gt; /dev/null<br>iconv: illegal input sequence at position 899<br></div><br>
- Latin1 non-ASCII character stays in sources&#39; AUTHORS file since the Dark Ages I suppose. ;-) Common problem for various Debian &quot;description&quot; textfiles. It&#39;s not a bug, but - really to perform distro-wide cleaning of such artefacts would be good action. :-)<br>
<br>