NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PR/57436 CVS commit: src/sys/dev/pad



The following reply was made to PR kern/57436; it has been noted by GNATS.

From: Bruno Melo <bmelo%protonmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: nat%netbsd.org@localhost, gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Subject: Re: PR/57436 CVS commit: src/sys/dev/pad
Date: Mon, 29 May 2023 00:29:20 +0000

 I confirm: this works!
 
 Thanks guys.
 
 
 
 Sent from ProtonMail, Swiss-based encrypted email.
 
 
 ------- Original Message -------
 Em domingo, 28 de maio de 2023 =C3=A0s 3:40 AM, mlelstv%serpens.de@localhost <mlelstv=
 @serpens.de> escreveu:
 
 
 > The following reply was made to PR kern/57436; it has been noted by GNATS=
 .
 >=20
 > From: mlelstv%serpens.de@localhost (Michael van Elst)
 > To: gnats-bugs%netbsd.org@localhost
 > Cc:
 > Subject: Re: PR/57436 CVS commit: src/sys/dev/pad
 > Date: Sun, 28 May 2023 06:35:32 -0000 (UTC)
 >=20
 > bmelo%protonmail.com@localhost (Bruno Melo) writes:
 >=20
 > > The following reply was made to PR kern/57436; it has been noted by GNA=
 TS.
 >=20
 > > From: Bruno Melo bmelo%protonmail.com@localhost
 >=20
 > > To: gnats-bugs%netbsd.org@localhost
 >=20
 > > Cc: nat%netbsd.org@localhost, gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
 >=20
 > > Subject: Re: PR/57436 CVS commit: src/sys/dev/pad
 >=20
 > > Date: Sat, 27 May 2023 18:09:52 +0000
 >=20
 > > Hi nat,
 >=20
 > > I'm reporting this PR/57443 too related to uaudio bug. If you can check=
  the=3D
 >=20
 > > n I can test both fixes at once.
 >=20
 >=20
 >=20
 > Replacing the single read in bta2dpd with a read loop (to collect
 > data from partial reads) should restore the old behaviour.
 >=20
 > http://ftp.netbsd.org/pub/NetBSD/misc/mlelstv/bta2dpd.diff
 >=20
 > Index: usr.sbin/bta2dpd/bta2dpd/sbc_encode.c
 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 > RCS file: /cvsroot/src/usr.sbin/bta2dpd/bta2dpd/sbc_encode.c,v
 > retrieving revision 1.10
 > diff -p -u -r1.10 sbc_encode.c
 > --- usr.sbin/bta2dpd/bta2dpd/sbc_encode.c 21 Sep 2019 00:01:33 -0000 1.10
 > +++ usr.sbin/bta2dpd/bta2dpd/sbc_encode.c 28 May 2023 06:32:56 -0000
 > @@ -813,6 +813,29 @@ make_frame(uint8_t *frame, int16_t *inpu
 > return frame - frameStart;
 > }
 >=20
 > +static ssize_t
 > +readloop(int fd, void *buf, size_t nbytes)
 > +{
 > + size_t count;
 > + ssize_t ret;
 > +
 > + count =3D 0;
 > + while (nbytes > 0) {
 >=20
 > + ret =3D read(fd, ((char *)buf) + count, nbytes);
 > + if (ret < 0) {
 > + if (count =3D=3D 0)
 > + return ret;
 > + break;
 > + }
 > + if (ret =3D=3D 0)
 > + break;
 > + count +=3D (size_t)ret;
 > + nbytes -=3D (size_t)ret;
 > + }
 > +
 > + return (ssize_t) count;
 > +}
 > +
 > ssize_t
 > stream(int in, int outfd, uint8_t mode, uint8_t freq, uint8_t bands, uint=
 8_t
 > blocks, uint8_t alloc_method, uint8_t bitpool, size_t mtu, int volume)
 > @@ -891,7 +914,7 @@ stream(int in, int outfd, uint8_t mode,
 > pkt_len =3D 80;
 > while (totalSize + ((size_t)pkt_len * 2) <=3D mtu) {
 >=20
 > - len =3D read(in, music, readsize);
 > + len =3D readloop(in, music, readsize);
 > if (len < (int)readsize)
 > break;
 >=20
 >=20
 >=20
 > Greetings,
 



Home | Main Index | Thread Index | Old Index