From nobody Tue Mar 15 14:39:04 2022 X-Original-To: ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C4E261A11977 for ; Tue, 15 Mar 2022 14:40:53 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KHx0h3m8rz4Vc1; Tue, 15 Mar 2022 14:40:52 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by mail-lf1-x129.google.com with SMTP id w27so33431705lfa.5; Tue, 15 Mar 2022 07:40:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=B21Mmr0HDROdpLUKU0mDFrXGn10mkiWPR5P4Ou1QSG0=; b=aCUzbSEF1QDZJ7nDN8r1+LUqt+SL0gC52Jz4arePkZIdQiTEwOdwtCFuQfI45J2uHS ujeb4RLDitSUlziOxNKemrOMeaB85MoykMt7R6oqe57QFgVx2M0mW8gRoMbKEJ5yPY6e yZL/dVqTJ/HNfk8ZQe1O77PXV5Q38M7SCtRqnuptDb7BE6f6jy9h34heS8cuZYy770+v xbePkK43fr5MX7vxC8R7wHZ4A6nStjwNGw2e2JgVdlqkrGyHK0IJ1VEBqQL8BYiAyTTP P47G3PPb+kUdYHDuEGm/MOlrs23MZ3+vaS9OontSib38SqtZhu4KySY6LCjWPn1pmOya KIWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=B21Mmr0HDROdpLUKU0mDFrXGn10mkiWPR5P4Ou1QSG0=; b=4pJVmKhf2oEURv/8cYkWlxYHAO5r+VEkZ+yvO/jVm+prpm8eD83xbA6PtYd6rVsIkC teTgq4yt6+e1jCDIRLRFgVQ1vr5oPpx5PdA20DaekhalNPsq7G6B5zXVBNZ9lvjsZdFr VZCG67dn8biNRKEXamUwVrIoN3B6HE0wsj3RPw0FfZpu5karudDIe9ZlmayzNXmCA/yZ UPD+N1tpEjGoM7kvyDLxUCwBh8UJ7V8xEXnepKIRwCqJ/ZdaPVjleAvJSyjv8isISeZS 482GUfvWxDi/CAboDrYF9JBEcL/PGBri00EYHIjDN8D7Inhj/CqKQdXJJ9gS8qHhrMMV Bhfg== X-Gm-Message-State: AOAM532CdGcqxxHqb1lPTI7cDofUrHNTcn8Vgt0YnP9JdLfxuwHlNqN2 RhLBLW4N13TtQszpsV0FxW5LPq3trpMYqKdaVQsTt0F2JsAlIw== X-Google-Smtp-Source: ABdhPJz8EinR9mC3Q1hIPaYHkcdlefpOoqnEUeQhyTTGXYGLL1i0KIfWpbVhkjF2PujFUzmyev6DWJoH2okgCeSFwqg= X-Received: by 2002:a05:6512:2256:b0:448:2d4c:ede0 with SMTP id i22-20020a056512225600b004482d4cede0mr16193611lfu.579.1647355250966; Tue, 15 Mar 2022 07:40:50 -0700 (PDT) List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 References: <20220315124908.205a07fc8dec2d0c5d6c6e92@FreeBSD.org> <20220315150003.3bd1c699db4995dc1d3fe007@FreeBSD.org> In-Reply-To: From: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= Date: Tue, 15 Mar 2022 15:39:04 +0100 Message-ID: Subject: Re: SDL audio issue with hivelytracker (porting attempt) To: Robert Clausecker Cc: Emanuel Haupt , ports FreeBSD Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4KHx0h3m8rz4Vc1 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=aCUzbSEF; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of fernandoapesteguia@gmail.com designates 2a00:1450:4864:20::129 as permitted sender) smtp.mailfrom=fernandoapesteguia@gmail.com X-Spamd-Result: default: False [-3.86 / 15.00]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; NEURAL_HAM_MEDIUM(-0.88)[-0.876]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::129:from]; MLMMJ_DEST(0.00)[ports]; NEURAL_HAM_SHORT(-0.98)[-0.981]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N On Tue, Mar 15, 2022 at 3:29 PM Robert Clausecker wrote: > > Hi Emanual, > > It does not look like you adjust any buffer size, but that might be > handled by code not shown in the patch. > > If that's not the issue, I don't have any obvious ideas. It looks like there is a problem with a buffer indeed: 0x0000000000237024 in rp_mixchunk (at=0x802800080, samples=0, buf1=0x2ab000 , buf2=0x2ab002 , bufmod=4) at ../replay.c:3464 (gdb) p buf1 $21 = (int8 *) 0x2ab000 In this case, there are still 276 loops to perform but it seems we already wrote past the end of the buffer. Cheers. > > Yours, > Robert Clausecker > > Am Tue, Mar 15, 2022 at 03:00:03PM +0100 schrieb Emanuel Haupt: > > Robert Clausecker 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. > > > > I already did that (see also original post): > > https://github.com/ehaupt/ports-wip/blob/master/ports/audio/hivelytracker/files/patch-replay.c > > > > This solved the initial issue but now I'm having problems with the > > playback. > > > > > Yours, > > > Robert Clausecker > > > > > > 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 > > > > > > > -- > () ascii ribbon campaign - for an 8-bit clean world > /\ - against html email - against proprietary attachments >