From owner-svn-ports-all@freebsd.org Tue Mar 28 14:46:00 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5B88D1F640; Tue, 28 Mar 2017 14:46:00 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B0FE1893; Tue, 28 Mar 2017 14:46:00 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2SEjxQ7028834; Tue, 28 Mar 2017 14:45:59 GMT (envelope-from tobik@FreeBSD.org) Received: (from tobik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SEjxEd028832; Tue, 28 Mar 2017 14:45:59 GMT (envelope-from tobik@FreeBSD.org) Message-Id: <201703281445.v2SEjxEd028832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tobik set sender to tobik@FreeBSD.org using -f From: Tobias Kortkamp Date: Tue, 28 Mar 2017 14:45:59 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r437130 - in head/audio/sndio: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 14:46:00 -0000 Author: tobik Date: Tue Mar 28 14:45:59 2017 New Revision: 437130 URL: https://svnweb.freebsd.org/changeset/ports/437130 Log: With incompletely specified parameters the OSS backend will always fallback to s16le for no good reason. Replace them with default values, so the format table lookup can work. This should fix playback of 24-bit/32-bit files in e.g. cmus without a running sndiod. Approved by: mat (mentor) Differential Revision: https://reviews.freebsd.org/D10164 Modified: head/audio/sndio/Makefile head/audio/sndio/files/patch-libsndio_sio__oss.c Modified: head/audio/sndio/Makefile ============================================================================== --- head/audio/sndio/Makefile Tue Mar 28 13:49:55 2017 (r437129) +++ head/audio/sndio/Makefile Tue Mar 28 14:45:59 2017 (r437130) @@ -3,7 +3,7 @@ PORTNAME= sndio PORTVERSION= 1.2.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= audio MASTER_SITES= http://www.sndio.org/ Modified: head/audio/sndio/files/patch-libsndio_sio__oss.c ============================================================================== --- head/audio/sndio/files/patch-libsndio_sio__oss.c Tue Mar 28 13:49:55 2017 (r437129) +++ head/audio/sndio/files/patch-libsndio_sio__oss.c Tue Mar 28 14:45:59 2017 (r437130) @@ -1,6 +1,6 @@ --- libsndio/sio_oss.c.orig 2016-11-06 11:21:59 UTC +++ libsndio/sio_oss.c -@@ -108,6 +108,8 @@ static int sio_oss_xrun(struct sio_oss_h +@@ -108,6 +108,8 @@ static int sio_oss_xrun(struct sio_oss_hdl *); static size_t sio_oss_read(struct sio_hdl *, void *, size_t); static size_t sio_oss_write(struct sio_hdl *, const void *, size_t); static void sio_oss_close(struct sio_hdl *); @@ -20,7 +20,7 @@ }; /* -@@ -228,12 +230,10 @@ sio_oss_getcap(struct sio_hdl *sh, struc +@@ -228,12 +230,10 @@ sio_oss_getcap(struct sio_hdl *sh, struct sio_cap *cap } static int @@ -34,7 +34,7 @@ p = _sndio_parsetype(str, "rsnd"); if (p == NULL) { -@@ -253,7 +253,24 @@ sio_oss_getfd(const char *str, unsigned +@@ -253,7 +253,24 @@ sio_oss_getfd(const char *str, unsigned int mode, int DPRINTF("sio_oss_getfd: %s: number expected after '/'\n", str); return -1; } @@ -60,7 +60,7 @@ if (mode == (SIO_PLAY | SIO_REC)) flags = O_RDWR; else -@@ -264,6 +281,19 @@ sio_oss_getfd(const char *str, unsigned +@@ -264,6 +281,19 @@ sio_oss_getfd(const char *str, unsigned int mode, int DPERROR(path); return -1; } @@ -80,10 +80,41 @@ val = 1; if (ioctl(fd, SNDCTL_DSP_LOW_WATER, &val) < 0) { DPERROR("sio_oss_start: LOW_WATER"); -@@ -736,4 +766,40 @@ sio_oss_revents(struct sio_hdl *sh, stru - return revents; - } +@@ -383,13 +413,25 @@ sio_oss_setpar(struct sio_hdl *sh, struct sio_par *par + struct sio_oss_hdl *hdl = (struct sio_oss_hdl *)sh; + unsigned int i, round, bufsz; + int frag_max, frag_shift, frag_count, frag; ++ unsigned int le, sig, msb; ++ le = par->le; ++ sig = par->sig; ++ msb = par->msb; ++ ++ if (le == ~0U) ++ le = 0; ++ if (sig == ~0U) ++ sig = 0; ++ if (msb == ~0U) ++ msb = 0; ++ + hdl->fmt = AFMT_S16_LE; + for (i = 0; i < sizeof(formats)/sizeof(formats[0]); i++) { + if (formats[i].bits == par->bits && +- formats[i].le == par->le && +- formats[i].sig == par->sig && +- formats[i].msb == par->msb) { ++ formats[i].le == le && ++ formats[i].sig == sig && ++ formats[i].msb == msb) { + hdl->fmt = formats[i].fmt; + break; + } +@@ -734,6 +776,42 @@ sio_oss_revents(struct sio_hdl *sh, struct pollfd *pfd + hdl->odelta -= delta; + } + return revents; ++} ++ +static int +sio_oss_setvol(struct sio_hdl *sh, unsigned int vol) +{ @@ -118,6 +149,6 @@ + /* Use left channel volume and scale to SIO_MAXVOL */ + vol = SIO_MAXVOL * 1.0 * (vol & 0x7f) / 100; + _sio_onvol_cb(&hdl->sio, vol); -+} -+ + } + #endif /* defined USE_OSS */