Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Apr 2020 14:15:41 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r531426 - in head/audio/faudio: . files
Message-ID:  <202004111415.03BEFfPL012978@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Sat Apr 11 14:15:41 2020
New Revision: 531426
URL: https://svnweb.freebsd.org/changeset/ports/531426

Log:
  audio/faudio: work around OSS audio crash
  
  INFO: OpenAudioDevice failed: Fragment size must be a power of two
  
  PR:		245533
  Approved by:	tobik (maintainer)

Added:
  head/audio/faudio/files/
  head/audio/faudio/files/patch-src_FAudio__platform__sdl2.c   (contents, props changed)
Modified:
  head/audio/faudio/Makefile   (contents, props changed)

Modified: head/audio/faudio/Makefile
==============================================================================
--- head/audio/faudio/Makefile	Sat Apr 11 14:07:06 2020	(r531425)
+++ head/audio/faudio/Makefile	Sat Apr 11 14:15:41 2020	(r531426)
@@ -2,6 +2,7 @@
 
 PORTNAME=	FAudio
 DISTVERSION=	20.04
+PORTREVISION=	1
 CATEGORIES=	audio
 
 MAINTAINER=	tobik@FreeBSD.org

Added: head/audio/faudio/files/patch-src_FAudio__platform__sdl2.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/faudio/files/patch-src_FAudio__platform__sdl2.c	Sat Apr 11 14:15:41 2020	(r531426)
@@ -0,0 +1,23 @@
+https://github.com/FNA-XNA/FAudio/issues/183
+
+--- src/FAudio_platform_sdl2.c.orig	2020-04-01 14:55:30 UTC
++++ src/FAudio_platform_sdl2.c
+@@ -100,6 +100,18 @@ void FAudio_PlatformInit(
+ 		want.samples = want.freq / 100;
+ 	}
+ 
++	/* SDL audio with arts/dsp backends expect ^2, so round up.
++	 * For 48KHz this should be 512.
++	 * https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
++        */
++	want.samples--;
++	want.samples |= want.samples >> 1;
++	want.samples |= want.samples >> 2;
++	want.samples |= want.samples >> 4;
++	want.samples |= want.samples >> 8;
++	want.samples |= want.samples >> 16;
++	want.samples++;
++
+ 	/* Open the device (or at least try to) */
+ iosretry:
+ 	device = SDL_OpenAudioDevice(



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