Charlene Wendling:

> - It doesn't build with ports-gcc (macppc [0], sparc64 [1])
>   
>   The problem here is again a macro vs function issue. I've applied
>   the same thing upstream still does on audacious proper [2]:
>   undef'ing feof(3).

That part is fine.

> - At least on macppc, it does some white noise during playback
> 
>   After poking around, i've found out it was a bit depth issue when
>   the related audio setting is on "automatic". Setting manually to
>   16 bit fixed the issue, but it's supposed to work... automatically.
> 
>   mpv does things differently [3] and i have no sound issues (excepted
>   for CDDA) on macppc. So after comparing their work, and reading
>   the sio_open(3) manpage, i've changed some parameters to make it
>   work ootb.

I object.  This cannot be correct.  fdata->bytes can't be wrong,
we're getting it from our own table, and otherwise you're nailing
everything to signed native endian, no matter what the actual input
format is.  You are hiding the actual bug.

Since the output format in "automatic" always appears to be 32-bit
signed native endian (after falling back from float), I'm surprised
that your change actually changes any behavior.

> +     par.bits = fdata->bits;
> +-    par.bps = fdata->bytes;
> +-    par.sig = fdata->sign;
> +-    par.le = fdata->le;
> ++    par.bps = SIO_BPS(par.bits);
> ++    par.sig = 1;
> ++    par.le = SIO_LE_NATIVE;

Can you try audacious -VV with the patch below and tell us the
messages from [setup_output] and [open_audio]?

--- src/sndio/sndio.cc.orig     Fri May 24 03:14:01 2019
+++ src/sndio/sndio.cc  Fri May 24 04:27:30 2019
@@ -168,6 +168,7 @@
 
 bool SndioPlugin::open_audio (int format, int rate, int channels, String & 
error)
 {
+    AUDDBG("format=%d\n", format);
     const FormatData * fdata = nullptr;
 
     for (const FormatData & f : format_table)
@@ -181,6 +182,8 @@
         error = String (str_printf (_("Sndio error: Unsupported audio format 
(%d)"), format));
         return false;
     }
+    AUDDBG("bits=%d bytes=%d sign=%d le=%d\n",
+       fdata->bits, fdata->bytes, fdata->sign, fdata->le);
 
     String device = aud_get_str ("sndio", "device");
     const char * device2 = device[0] ? (const char *) device : SIO_DEVANY;
-- 
Christian "naddy" Weisgerber                          na...@mips.inka.de

Reply via email to