Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Mar 2022 15:50:10 +0300
From:      Mehmet Erol Sanliturk <m.e.sanliturk@gmail.com>
To:        Robert Clausecker <fuz@fuz.su>
Cc:        Emanuel Haupt <ehaupt@freebsd.org>, FreeBSD Ports <ports@freebsd.org>
Subject:   Re: SDL audio issue with hivelytracker (porting attempt)
Message-ID:  <CAOgwaMvJGKX2ARg0EHJNeG9fQbxCLRqLCr_DihRnaUy9gHB3xg@mail.gmail.com>
In-Reply-To: <YjCIgm/yYeJcZe6v@fuz.su>
References:  <20220315124908.205a07fc8dec2d0c5d6c6e92@FreeBSD.org> <YjCIgm/yYeJcZe6v@fuz.su>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000e446d005da413e8b
Content-Type: text/plain; charset="UTF-8"

On Tue, Mar 15, 2022 at 3:37 PM Robert Clausecker <fuz@fuz.su> wrote:

> Hi Emanuel,
>
> This is a common issue I had with multiple ports (the latest being
> emulators/fceux).  The fragment size must be patched to be a power of 2
> and the buffer for the fragments must be resized to be at least as large
> as the fragment size (iirc).  This might be the reason why you get a
> signal.
>
> The fragment size is set in the SDL_AudioSpec structure member samples
> passed to SDL_OpenAudio().
>
> Try to find this call and patch it.
>
> Yours,
> Robert Clausecker
>


I was just thinking about this a little ago .

When the audio is patched , it may be required to fill it  a value
( I do not know what it is , but
you may generate it by a "silent" record conforming to your audio file
specifications ,
or , by using an audio editor  , copy paste a silent part of your file to
the end
in sufficient length  ( please consider stereo )  )
to produce a "silent"  sound  , OR ,
give length of play to ( by considering exact size of your audio file ) use
it
( this should be possible because file size to load and length of the part
to be played are different concepts ) .



With my best wishes ,


Mehmet Erol Sanliturk








>
> Am Tue, Mar 15, 2022 at 12:49:08PM +0100 schrieb Emanuel Haupt:
> > I've been trying to port the hivelytracker to FreeBSD. After a lot of
> > patching I was finally able to start it with:
> >
> > SDL_AUDIODRIVER=disk
> >
> > with dsp (default) I would always get:
> >
> > Fragment size must be a power of two
> >
> > when
> >
> > SDL_OpenAudio(...)
> >
> > was called.
> >
> > I did some further digging and found some useful references in:
> >
> >
> https://cgit.freebsd.org/ports/tree/audio/faudio/files/patch-src_FAudio__platform__sdl2.c
> >
> > With this patch I was able to get the player to launch without the above
> > error:
> >
> >
> https://github.com/ehaupt/ports-wip/blob/master/ports/audio/hivelytracker/files/patch-replay.c
> >
> > The player now starts:
> >
> > I can click on 'Load Mod', load a sample mod but as soon as I get 'Play
> > Song' I get:
> >
> > Abort trap (core dumped)
> >
> > I've been trying to get some sense by running it with truss but haven't
> > been very successful so far.
> >
> > The work in progress port can be found here:
> >
> https://github.com/ehaupt/ports-wip/tree/master/ports/audio/hivelytracker
> >
> > The port still needs some TLC (hardcoded paths, etc...). I'll fix that
> > before adding the port.
> >
> > Could someone with SDL audio experience please have a look? I'd
> > appreciate the help.
> >
> > Emanuel
> >
> >
> > [1] https://github.com/pete-gordon/hivelytracker
> >
>
> --
> ()  ascii ribbon campaign - for an 8-bit clean world
> /\  - against html email  - against proprietary attachments
>
>

--000000000000e446d005da413e8b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon=
t-family:tahoma,sans-serif;font-size:large"><br></div></div><br><div class=
=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Mar 15, 2022=
 at 3:37 PM Robert Clausecker &lt;<a href=3D"mailto:fuz@fuz.su">fuz@fuz.su<=
/a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0=
px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">H=
i Emanuel,<br>
<br>
This is a common issue I had with multiple ports (the latest being<br>
emulators/fceux).=C2=A0 The fragment size must be patched to be a power of =
2<br>
and the buffer for the fragments must be resized to be at least as large<br=
>
as the fragment size (iirc).=C2=A0 This might be the reason why you get a<b=
r>
signal.<br>
<br>
The fragment size is set in the SDL_AudioSpec structure member samples<br>
passed to SDL_OpenAudio(). <br>
<br>
Try to find this call and patch it.<br>
<br>
Yours,<br>
Robert Clausecker<br></blockquote><div><br></div><div><br></div><div><div s=
tyle=3D"font-family:tahoma,sans-serif;font-size:large" class=3D"gmail_defau=
lt">I was just thinking about this a little ago .</div><div style=3D"font-f=
amily:tahoma,sans-serif;font-size:large" class=3D"gmail_default"><br></div>=
<div style=3D"font-family:tahoma,sans-serif;font-size:large" class=3D"gmail=
_default">When the audio is patched , it may be required to fill it=C2=A0 a=
 value</div><div style=3D"font-family:tahoma,sans-serif;font-size:large" cl=
ass=3D"gmail_default">( I do not know what it is , but <br></div><div style=
=3D"font-family:tahoma,sans-serif;font-size:large" class=3D"gmail_default">=
you may generate it by a &quot;silent&quot; record conforming to your audio=
 file specifications ,</div><div style=3D"font-family:tahoma,sans-serif;fon=
t-size:large" class=3D"gmail_default">or , by using an audio editor=C2=A0 ,=
 copy paste a silent part of your file to the end <br></div><div style=3D"f=
ont-family:tahoma,sans-serif;font-size:large" class=3D"gmail_default">in su=
fficient length=C2=A0 ( please consider stereo )=C2=A0 ) <br></div><div sty=
le=3D"font-family:tahoma,sans-serif;font-size:large" class=3D"gmail_default=
">to produce a &quot;silent&quot;=C2=A0 sound=C2=A0 , OR ,</div><div style=
=3D"font-family:tahoma,sans-serif;font-size:large" class=3D"gmail_default">=
give length of play to ( by considering exact size of your audio file ) use=
 it <br></div><div style=3D"font-family:tahoma,sans-serif;font-size:large" =
class=3D"gmail_default">( this should be possible because file size to load=
 and length of the part</div><div style=3D"font-family:tahoma,sans-serif;fo=
nt-size:large" class=3D"gmail_default">to be played are different concepts =
) .</div><div style=3D"font-family:tahoma,sans-serif;font-size:large" class=
=3D"gmail_default"><br></div><div style=3D"font-family:tahoma,sans-serif;fo=
nt-size:large" class=3D"gmail_default"><br></div><div style=3D"font-family:=
tahoma,sans-serif;font-size:large" class=3D"gmail_default"><br></div><div s=
tyle=3D"font-family:tahoma,sans-serif;font-size:large" class=3D"gmail_defau=
lt">With my best wishes ,<br></div><div style=3D"font-family:tahoma,sans-se=
rif;font-size:large" class=3D"gmail_default"><br></div><div style=3D"font-f=
amily:tahoma,sans-serif;font-size:large" class=3D"gmail_default"><br></div>=
<div style=3D"font-family:tahoma,sans-serif;font-size:large" class=3D"gmail=
_default">Mehmet Erol Sanliturk<br></div><div style=3D"font-family:tahoma,s=
ans-serif;font-size:large" class=3D"gmail_default"><br></div><div style=3D"=
font-family:tahoma,sans-serif;font-size:large" class=3D"gmail_default"><br>=
</div><br></div><div><br></div><div><br></div><div><br></div><div>=C2=A0</d=
iv><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bord=
er-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Am Tue, Mar 15, 2022 at 12:49:08PM +0100 schrieb Emanuel Haupt:<br>
&gt; I&#39;ve been trying to port the hivelytracker to FreeBSD. After a lot=
 of<br>
&gt; patching I was finally able to start it with:<br>
&gt; <br>
&gt; SDL_AUDIODRIVER=3Ddisk<br>
&gt; <br>
&gt; with dsp (default) I would always get:<br>
&gt; <br>
&gt; Fragment size must be a power of two<br>
&gt; <br>
&gt; when<br>
&gt; <br>
&gt; SDL_OpenAudio(...)<br>
&gt; <br>
&gt; was called.<br>
&gt; <br>
&gt; I did some further digging and found some useful references in:<br>
&gt; <br>
&gt; <a href=3D"https://cgit.freebsd.org/ports/tree/audio/faudio/files/patc=
h-src_FAudio__platform__sdl2.c" rel=3D"noreferrer" target=3D"_blank">https:=
//cgit.freebsd.org/ports/tree/audio/faudio/files/patch-src_FAudio__platform=
__sdl2.c</a><br>
&gt; <br>
&gt; With this patch I was able to get the player to launch without the abo=
ve<br>
&gt; error:<br>
&gt; <br>
&gt; <a href=3D"https://github.com/ehaupt/ports-wip/blob/master/ports/audio=
/hivelytracker/files/patch-replay.c" rel=3D"noreferrer" target=3D"_blank">h=
ttps://github.com/ehaupt/ports-wip/blob/master/ports/audio/hivelytracker/fi=
les/patch-replay.c</a><br>
&gt; <br>
&gt; The player now starts:<br>
&gt; <br>
&gt; I can click on &#39;Load Mod&#39;, load a sample mod but as soon as I =
get &#39;Play<br>
&gt; Song&#39; I get:<br>
&gt; <br>
&gt; Abort trap (core dumped)<br>
&gt; <br>
&gt; I&#39;ve been trying to get some sense by running it with truss but ha=
ven&#39;t<br>
&gt; been very successful so far.<br>
&gt; <br>
&gt; The work in progress port can be found here:<br>
&gt; <a href=3D"https://github.com/ehaupt/ports-wip/tree/master/ports/audio=
/hivelytracker" rel=3D"noreferrer" target=3D"_blank">https://github.com/eha=
upt/ports-wip/tree/master/ports/audio/hivelytracker</a><br>
&gt; <br>
&gt; The port still needs some TLC (hardcoded paths, etc...). I&#39;ll fix =
that<br>
&gt; before adding the port.<br>
&gt; <br>
&gt; Could someone with SDL audio experience please have a look? I&#39;d<br=
>
&gt; appreciate the help.<br>
&gt; <br>
&gt; Emanuel<br>
&gt; <br>
&gt; <br>
&gt; [1] <a href=3D"https://github.com/pete-gordon/hivelytracker" rel=3D"no=
referrer" target=3D"_blank">https://github.com/pete-gordon/hivelytracker</a=
><br>
&gt; <br>
<br>
-- <br>
()=C2=A0 ascii ribbon campaign - for an 8-bit clean world <br>
/\=C2=A0 - against html email=C2=A0 - against proprietary attachments<br>
<br>
</blockquote></div></div>

--000000000000e446d005da413e8b--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOgwaMvJGKX2ARg0EHJNeG9fQbxCLRqLCr_DihRnaUy9gHB3xg>