On Sat, May 15, 2021 at 04:18:08PM +0000, Doug Moss wrote:
> On 11 May 2021, Luca wrote:
> >Thanks guys. I've ordered one, let's see if I am lucky.
> >
> >Cheers
> >Luca
>
>
> I have the same problem: OpenBSD 6.9 arm64, USB audio is not working
>
> I wrote before about this, as well as Luca
> ( https://marc.info/?l=openbsd-arm&m=159691773016835&w=2 )
>
> Thank you to Luca for showing the sndiod logs and kernel messages.
>
> To add some further data:
> I have tried multiple USB audio devices:
>
> Logitech S-150
>
> https://www.logitech.com/en-us/products/speakers/s150-usb-stereo-speakers.980-000028.html
>
> Schiit Modi
> https://www.schiit.com/products/modi-1
>
> StarTech as mentioned by other poster in this thread
> https://www.startech.com/en-us/cards-adapters/icusbaudio2d
>
> All work fine on a Powerbook running MacOS, and work fine on OpenBSD 6.9 amd64
>
> All do not work with (OpenBSD 6.9 arm64) on (Raspberry Pi 4 B, rev 1.2)
> All just create static noise which does seem to have the same envelope as the
> intended audio (when intended song is quiet, just low level static, then when
> intended song is louder, the static gets louder)
>
> I am particularly perplexed that someone else has gotten the StarTech device
> to work with OpenBSD arm64.
>
>
Hi,
Could you try the diff below? I don't have the hardware to test, this
is an attempt based on discussion with Luca and other developpers
Index: uaudio.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/uaudio.c,v
retrieving revision 1.160
diff -u -p -r1.160 uaudio.c
--- uaudio.c 11 Jun 2020 16:00:10 -0000 1.160
+++ uaudio.c 17 May 2021 16:31:59 -0000
@@ -35,6 +35,7 @@
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdivar.h>
+#include <dev/usb/usb_mem.h>
#ifdef UAUDIO_DEBUG
#define DPRINTF(...) \
@@ -3173,6 +3174,8 @@ uaudio_pdata_copy(struct uaudio_softc *s
}
s->ubuf_pos += count;
if (s->ubuf_pos == xfer->size) {
+ usb_syncmem(&xfer->usb_xfer->dmabuf, 0, xfer->size,
+ BUS_DMASYNC_PREWRITE);
s->ubuf_pos = 0;
#ifdef DIAGNOSTIC
if (s->ubuf_xfer == s->nxfers) {