Depending on system configuration, play <soundfile> sometimes ends with floating point exception. This bug is hard to reproduce. For me, it works only in mock sandbox.
is for. Together with the previous line, the code snippet looks like well-known pattern for size alignment, so I replace *= for += (but maybe *= was there for some reason, it is hard to guess with no comments).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is AO the default output on Fedora?
If not, how ecatly do you send the output to AO?
Does the FPE always occur when playing the above files via AO?
Have you tried on other systems that use AO as their output?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just tried on OpenBSD with only AO compiled in (--with-ao), --disabling all other outputs, including the native sndio. I can confirm that play segfaults on both of your examples.
i.e. it will compile and then simply not have the device, without any kind of error message.
That is to say: with a buffer size being something else then what AO expects, we don't even have the device.
The >> 3 is easy: a fancy division by eight, which might not work as intended, e,g, for signed;
The bits_per_sample is defined in sox.h as follows:
Surely an unsigned int won't be < 0, but even such basics are unclear.
As an example, if bits_per_sample is 16, which is typical, then 16 >> 3 is 2 (i.e. two bytes hold the 16 bits),
so sox_globals.bufsiz % (ft->encoding.bits_per_sample >> 3) is sox_globals.bufsiz % 2,
so ao->buf_size = sox_globals.bufsiz - 0 or ... - 1; I have no idea what it is supposed to do,
but that is the line that causes the SIGFPE (says gdb).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After adding a few naive printfs: with any audio file whatsoever,
the ft->encoding.bits_per_sample in these lines is zero.
Setting the buf_size is just where it shows.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sample audio file #1.
Sample audio file #2.
To the patch: In the original version of
src/ao.c, I tried to figure out what the*=inis for. Together with the previous line, the code snippet looks like well-known pattern for size alignment, so I replace
*=for+=(but maybe*=was there for some reason, it is hard to guess with no comments).Is AO the default output on Fedora?
If not, how ecatly do you send the output to AO?
Does the FPE always occur when playing the above files via AO?
Have you tried on other systems that use AO as their output?
I just tried on OpenBSD with only AO compiled in (--with-ao), --disabling all other outputs, including the native sndio. I can confirm that play segfaults on both of your examples.
I don't understand the
buf_sizedance either. In commit 3d4cdf3d163b9d8c6a4241ff412b785178af4865 it was changed fromto
Apparently, something like what the first line does needs to be there, because with a simple
this is what happens:
i.e. it will compile and then simply not have the device, without any kind of error message.
That is to say: with a buffer size being something else then what AO expects, we don't even have the device.
The
>> 3is easy: a fancy division by eight, which might not work as intended, e,g, for signed;The
bits_per_sampleis defined in sox.h as follows:Surely an unsigned int won't be < 0, but even such basics are unclear.
As an example, if
bits_per_sampleis 16, which is typical, then 16 >> 3 is 2 (i.e. two bytes hold the 16 bits),so
sox_globals.bufsiz % (ft->encoding.bits_per_sample >> 3)issox_globals.bufsiz % 2,so
ao->buf_size = sox_globals.bufsiz - 0or... - 1; I have no idea what it is supposed to do,but that is the line that causes the SIGFPE (says gdb).
Also, using AO as an output makes play crash with a SIGFPE on any file whatsoever,
not just on those example files.
Which makes me believe that
1. AO support is broken
2. Nobody's been using it for a long time
Are there any systrems that use AO as their default/native sound playing system?
After adding a few naive printfs: with any audio file whatsoever,
the
ft->encoding.bits_per_samplein these lines is zero.Setting the
buf_sizeis just where it shows.https://codeberg.org/sox_ng/sox_ng/issues/537