Date: Mon, 28 Feb 2022 19:36:11 +0000 From: Marco Devesas Campos <devesas.campos@gmail.com> To: Ronald Klop <ronald-lists@klop.ws> Cc: Warner Losh <imp@bsdimp.com>, "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org> Subject: Re: [PATCH] Experimental vchiq and bcm2835_audio support for arm64 Message-ID: <87A63A19-5807-4BA9-9821-D3378129CDB5@gmail.com> In-Reply-To: <op.1ibeyzzokndu52@joepie> References: <A0775CDC-7382-4A15-8131-482572032308@gmail.com> <a02d8dd2-020a-3125-3418-08f0a069aa5e@klop.ws> <8EC05647-00D9-455B-98A9-B83A33DDFC5D@gmail.com> <48190d6a-fc5d-7da9-ddfd-fded48d429db@klop.ws> <106195874.50.1644310150579@localhost> <E7561C63-D0DF-4F38-9101-12B0D473982E@gmail.com> <CANCZdfoS0TaGkBWSkbzdisr_MJt6chZts2xBRJ5GQXjXoVaENA@mail.gmail.com> <op.1ibeyzzokndu52@joepie>
next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_6390B139-EA65-43CA-B7BA-C9C88ABEB429 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Entirely right, Ronald =E2=80=94 thanks for catching it! Warner, can I send you a consolidated patch later in the week? What=E2=80=99= s the best way to submit it? Best, Marco > On 28 Feb 2022, at 19:26, Ronald Klop <ronald-lists@klop.ws> wrote: >=20 > On Sun, 27 Feb 2022 17:41:25 +0100, Warner Losh <imp@bsdimp.com> = wrote: >=20 >=20 >=20 > On Sun, Feb 27, 2022 at 8:44 AM Marco Devesas Campos = <devesas.campos@gmail.com <mailto:devesas.campos@gmail.com>> wrote: > Hi, List >=20 > On the back of Ronald Klop's comments (thanks!), I went and got myself = an > RPI 4 and it turns out all that was need was adding the right dtb > reference and it all works (seemingly) fine (incremental patch = attached). >=20 > I've committed the patch below. If it turns out we need more, we can = always augment. >=20 >=20 > Hi Marco, Warner, >=20 > Isn't the patch from = https://lists.freebsd.org/archives/freebsd-arm/2022-February/000949.html = needed also? > As you mention the patch below is an incremental patch? >=20 > Regards, > Ronald. >=20 >=20 >=20 >=20 >=20 >=20 >=20 > Warner > =20 > One of the potential projects highlighted in the latest call for = proposals > was exactly to get hdmi audio output in 64 bit Pis, viz. the 400-s. If > anyone who voted for that reads this list, wd be nice to get some = input on > the patches. >=20 > Best, > Marco >=20 >=20 >=20 > diff --git a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c = b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c > index dc18678b99a3..344267ff0c1c 100644 > --- a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c > +++ b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c > @@ -83,6 +83,7 @@ static struct bcm_vchiq_softc *bcm_vchiq_sc =3D = NULL; > static struct ofw_compat_data compat_data[] =3D { > {"broadcom,bcm2835-vchiq", BSD_DTB}, > {"brcm,bcm2835-vchiq", UPSTREAM_DTB}, > + {"brcm,bcm2711-vchiq", UPSTREAM_DTB}, > {NULL, 0} > }; >=20 >=20 >=20 > > On 8 Feb 2022, at 08:49, Ronald Klop <ronald-lists@klop.ws = <mailto:ronald-lists@klop.ws>> wrote: > >=20 > > Van: Ronald Klop <ronald-lists@klop.ws = <mailto:ronald-lists@klop.ws>> > > Datum: maandag, 7 februari 2022 21:05 > > Aan: Marco Devesas Campos <devesas.campos@gmail.com = <mailto:devesas.campos@gmail.com>>, freebsd-arm@freebsd.org = <mailto:freebsd-arm@freebsd.org> > > Onderwerp: Re: [PATCH] Experimental vchiq and bcm2835_audio support = for arm64 > >=20 > > On 2/6/22 14:46, Marco Devesas Campos wrote: > > > Hi Ronald, > > > > > > Thanks so much for trying out the patch out. > > > > > >> On 6 Feb 2022, at 13:05, Ronald Klop <ronald-lists@klop.ws = <mailto:ronald-lists@klop.ws>> wrote: > > >> > > >> Hi, > > >> > > >> I compiled this on a RPI4 + 14-CURRENT. It boots, but I see no = difference in available devices. > > >> I can try to boot it on a RPI3B+ on another time. > > > > > > I *think* the GPU/VC in RPI-4 is a very different beast from the = others. I'll > > > look into it, but if you could give it a try on the 3+ I'd be much = obliged. > > > > > >> > > >> What would be the expected outcome? Where should I look at (or = listen to)? > > >> > > > > > > You should see something like > > > > > > vchiq0: <BCM2835 VCHIQ> mem 0x7e00b840-0x7e00b87b irq 54 on = simplebus0 > > > vchiq: local ver 8 (min 3), remote ver 8. > > > pcm0: <VCHIQ audio> on vchiq0 > > > > > > in your dmesg output. > > > > > > The file /dev/vchiq should exist, as well as the following = sysctl-s (I'm > > > assuming no other audio devices are attached) > > > > > > % sysctl dev.pcm > > > dev.pcm.0.trace: 0 > > > ... > > > dev.pcm.0.dest: 0 > > > ... > > > dev.pcm.0.%parent: vchiq0 > > > ... > > > dev.pcm.0.%driver: pcm > > > dev.pcm.0.%desc: VCHIQ audio > > > =E2=80=A6 > > > > > > Then if you `cat < /dev/random > /dev/dsp` you should hear some = static coming > > > out of whatever is connected to hdmi (maybe headphones too? = otherwise try > > > setting `sysctl dev.pcm.0.dest=3D1`) > > > > > > Best, > > > Marco > >=20 > >=20 > > Hi, > >=20 > > Booted the patched 14-CURRENT on the RPI3B+. > >=20 > > dmesg diff: > > +vchiq0: <BCM2835 VCHIQ> mem 0x7e00b840-0x7e00b87b irq 54 on = simplebus0 > > +vchiq: local ver 8 (min 3), remote ver 8. > > +pcm0: <VCHIQ audio> on vchiq0 > >=20 > > [root@rpi3 ~]# cat /dev/sndstat > > Installed devices: > > pcm0: <VCHIQ audio> (play) default > > No devices installed from userspace. > >=20 > > [root@rpi3 ~]# sysctl dev.pcm > > dev.pcm.0.trace: 0 > > dev.pcm.0.starved: 0 > > dev.pcm.0.freebuffer: 40000 > > dev.pcm.0.underruns: 0 > > dev.pcm.0.retrieved: 0 > > dev.pcm.0.submitted: 0 > > dev.pcm.0.callbacks: 0 > > dev.pcm.0.dest: 0 > > dev.pcm.0.mode: 3 > > dev.pcm.0.bitperfect: 0 > > dev.pcm.0.buffersize: 0 > > dev.pcm.0.play.vchanformat: s16le:2.0 > > dev.pcm.0.play.vchanrate: 48000 > > dev.pcm.0.play.vchanmode: fixed > > dev.pcm.0.play.vchans: 1 > > dev.pcm.0.%parent: vchiq0 > > dev.pcm.0.%pnpinfo: > > dev.pcm.0.%location: > > dev.pcm.0.%driver: pcm > > dev.pcm.0.%desc: VCHIQ audio > > dev.pcm.%parent: > >=20 > >=20 > > To play some audio I need to search some headphones first. :-) > >=20 > > Ronald. > > =20 > >=20 > >=20 > > Good morning, > >=20 > > Found headphones with a cable on the attic. Plugged it into the = audio jack and played an mp3. Amazing! > >=20 > > Regards, > > Ronald. > > =20 >=20 >=20 >=20 >=20 >=20 --Apple-Mail=_6390B139-EA65-43CA-B7BA-C9C88ABEB429 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><span= style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: = GillSans-Light; font-size: 14px;" class=3D"">Entirely right, Ronald =E2=80= =94 thanks for catching it!</span><br style=3D"caret-color: rgb(0, 0, = 0); color: rgb(0, 0, 0); font-family: GillSans-Light; font-size: 14px;" = class=3D""><br style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); = font-family: GillSans-Light; font-size: 14px;" class=3D""><span = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: = GillSans-Light; font-size: 14px;" class=3D"">Warner, can I send you a = consolidated patch later in the week? What=E2=80=99s the best way to = submit it?</span><br style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, = 0, 0); font-family: GillSans-Light; font-size: 14px;" class=3D""><br = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: = GillSans-Light; font-size: 14px;" class=3D""><span style=3D"caret-color: = rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: GillSans-Light; = font-size: 14px;" class=3D"">Best,</span><br style=3D"caret-color: = rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: GillSans-Light; = font-size: 14px;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); = color: rgb(0, 0, 0); font-family: GillSans-Light; font-size: 14px;" = class=3D"">Marco</span><br class=3D""><div><br class=3D""><blockquote = type=3D"cite" class=3D""><div class=3D"">On 28 Feb 2022, at 19:26, = Ronald Klop <<a href=3D"mailto:ronald-lists@klop.ws" = class=3D"">ronald-lists@klop.ws</a>> wrote:</div><br = class=3D"Apple-interchange-newline"><div class=3D""> <style type=3D"text/css" class=3D"">body { font-family:'Calibri'; = font-size:13px}</style> <div class=3D"">On Sun, 27 Feb 2022 17:41:25 +0100, Warner Losh <<a = href=3D"mailto:imp@bsdimp.com" class=3D"">imp@bsdimp.com</a>> = wrote:<br class=3D""><br class=3D""><blockquote style=3D"margin: 0 0 = 0.80ex; border-left: #0000FF 2px solid; padding-left: 1ex" class=3D""><div= dir=3D"ltr" class=3D""><div dir=3D"ltr" class=3D""><br = class=3D""></div><br class=3D""><div class=3D"gmail_quote"><div = dir=3D"ltr" class=3D"gmail_attr">On Sun, Feb 27, 2022 at 8:44 AM Marco = Devesas Campos <<a href=3D"mailto:devesas.campos@gmail.com" = class=3D"">devesas.campos@gmail.com</a>> wrote:<br = class=3D""></div><blockquote class=3D"gmail_quote" style=3D"margin:0px = 0px 0px 0.8ex;border-left:1px solid = rgb(204,204,204);padding-left:1ex">Hi, List<br class=3D""> <br class=3D""> On the back of Ronald Klop's comments (thanks!), I went and got myself = an<br class=3D""> RPI 4 and it turns out all that was need was adding the right dtb<br = class=3D""> reference and it all works (seemingly) fine (incremental patch = attached).<br class=3D""></blockquote><div class=3D""><br = class=3D""></div><div class=3D"">I've committed the patch below. If it = turns out we need more, we can always = augment.</div></div></div></blockquote><div class=3D""><br = class=3D""></div><div class=3D""><br class=3D""></div><div class=3D"">Hi = Marco, Warner,</div><div class=3D""><br class=3D""></div><div = class=3D"">Isn't the patch from <a = href=3D"https://lists.freebsd.org/archives/freebsd-arm/2022-February/00094= 9.html" = class=3D"">https://lists.freebsd.org/archives/freebsd-arm/2022-February/00= 0949.html</a> needed also?</div><div class=3D"">As you mention the patch = below is an incremental patch?</div><div class=3D""><br = class=3D""></div><div class=3D"">Regards,</div><div = class=3D"">Ronald.</div><div class=3D""><br class=3D""></div><div = class=3D""><br class=3D""></div><div class=3D""><br class=3D""></div><div = class=3D""><br class=3D""></div><div class=3D""><br class=3D""></div><div = class=3D""><br class=3D""></div><blockquote style=3D"margin: 0 0 0.80ex; = border-left: #0000FF 2px solid; padding-left: 1ex" class=3D""><div = dir=3D"ltr" class=3D""><div class=3D"gmail_quote"><div class=3D""><br = class=3D""></div><div class=3D"">Warner</div><div = class=3D""> </div><blockquote class=3D"gmail_quote" = style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid = rgb(204,204,204);padding-left:1ex"> One of the potential projects highlighted in the latest call for = proposals<br class=3D""> was exactly to get hdmi audio output in 64 bit Pis, viz. the 400-s. = If<br class=3D""> anyone who voted for that reads this list, wd be nice to get some input = on<br class=3D""> the patches.<br class=3D""> <br class=3D""> Best,<br class=3D""> Marco<br class=3D""> <br class=3D""> <br class=3D""> <br class=3D""> diff --git a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c = b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c<br class=3D""> index dc18678b99a3..344267ff0c1c 100644<br class=3D""> --- a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c<br class=3D""> +++ b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c<br class=3D""> @@ -83,6 +83,7 @@ static struct bcm_vchiq_softc *bcm_vchiq_sc =3D = NULL;<br class=3D""> static struct ofw_compat_data compat_data[] =3D {<br class=3D""> {"broadcom,bcm2835-vchiq", = BSD_DTB},<br class=3D""> {"brcm,bcm2835-vchiq", = UPSTREAM_DTB},<br class=3D""> + {"brcm,bcm2711-vchiq", = UPSTREAM_DTB},<br class=3D""> {NULL, = 0}<br class=3D""> };<br class=3D""> <br class=3D""> <br class=3D""> <br class=3D""> > On 8 Feb 2022, at 08:49, Ronald Klop <<a = href=3D"mailto:ronald-lists@klop.ws" target=3D"_blank" = class=3D"">ronald-lists@klop.ws</a>> wrote:<br class=3D""> > <br class=3D""> > Van: Ronald Klop <<a href=3D"mailto:ronald-lists@klop.ws" = target=3D"_blank" class=3D"">ronald-lists@klop.ws</a>><br class=3D""> > Datum: maandag, 7 februari 2022 21:05<br class=3D""> > Aan: Marco Devesas Campos <<a = href=3D"mailto:devesas.campos@gmail.com" target=3D"_blank" = class=3D"">devesas.campos@gmail.com</a>>, <a = href=3D"mailto:freebsd-arm@freebsd.org" target=3D"_blank" = class=3D"">freebsd-arm@freebsd.org</a><br class=3D""> > Onderwerp: Re: [PATCH] Experimental vchiq and bcm2835_audio support = for arm64<br class=3D""> > <br class=3D""> > On 2/6/22 14:46, Marco Devesas Campos wrote:<br class=3D""> > > Hi Ronald,<br class=3D""> > ><br class=3D""> > > Thanks so much for trying out the patch out.<br class=3D""> > ><br class=3D""> > >> On 6 Feb 2022, at 13:05, Ronald Klop <<a = href=3D"mailto:ronald-lists@klop.ws" target=3D"_blank" = class=3D"">ronald-lists@klop.ws</a>> wrote:<br class=3D""> > >><br class=3D""> > >> Hi,<br class=3D""> > >><br class=3D""> > >> I compiled this on a RPI4 + 14-CURRENT. It boots, but I = see no difference in available devices.<br class=3D""> > >> I can try to boot it on a RPI3B+ on another time.<br = class=3D""> > ><br class=3D""> > > I *think* the GPU/VC in RPI-4 is a very different beast from = the others. I'll<br class=3D""> > > look into it, but if you could give it a try on the 3+ I'd be = much obliged.<br class=3D""> > ><br class=3D""> > >><br class=3D""> > >> What would be the expected outcome? Where should I look at = (or listen to)?<br class=3D""> > >><br class=3D""> > ><br class=3D""> > > You should see something like<br class=3D""> > ><br class=3D""> > > vchiq0: <BCM2835 VCHIQ> mem = 0x7e00b840-0x7e00b87b irq 54 on simplebus0<br class=3D""> > > vchiq: local ver 8 (min 3), remote ver 8.<br = class=3D""> > > pcm0: <VCHIQ audio> on vchiq0<br class=3D""> > ><br class=3D""> > > in your dmesg output.<br class=3D""> > ><br class=3D""> > > The file /dev/vchiq should exist, as well as the following = sysctl-s (I'm<br class=3D""> > > assuming no other audio devices are attached)<br class=3D""> > ><br class=3D""> > > % sysctl dev.pcm<br class=3D""> > > dev.pcm.0.trace: 0<br class=3D""> > > ...<br class=3D""> > > dev.pcm.0.dest: 0<br class=3D""> > > ...<br class=3D""> > > dev.pcm.0.%parent: vchiq0<br class=3D""> > > ...<br class=3D""> > > dev.pcm.0.%driver: pcm<br class=3D""> > > dev.pcm.0.%desc: VCHIQ audio<br class=3D""> > > =E2=80=A6<br class=3D""> > ><br class=3D""> > > Then if you `cat < /dev/random > /dev/dsp` you should = hear some static coming<br class=3D""> > > out of whatever is connected to hdmi (maybe headphones too? = otherwise try<br class=3D""> > > setting `sysctl dev.pcm.0.dest=3D1`)<br class=3D""> > ><br class=3D""> > > Best,<br class=3D""> > > Marco<br class=3D""> > <br class=3D""> > <br class=3D""> > Hi,<br class=3D""> > <br class=3D""> > Booted the patched 14-CURRENT on the RPI3B+.<br class=3D""> > <br class=3D""> > dmesg diff:<br class=3D""> > +vchiq0: <BCM2835 VCHIQ> mem 0x7e00b840-0x7e00b87b irq 54 on = simplebus0<br class=3D""> > +vchiq: local ver 8 (min 3), remote ver 8.<br class=3D""> > +pcm0: <VCHIQ audio> on vchiq0<br class=3D""> > <br class=3D""> > [root@rpi3 ~]# cat /dev/sndstat<br class=3D""> > Installed devices:<br class=3D""> > pcm0: <VCHIQ audio> (play) default<br class=3D""> > No devices installed from userspace.<br class=3D""> > <br class=3D""> > [root@rpi3 ~]# sysctl dev.pcm<br class=3D""> > dev.pcm.0.trace: 0<br class=3D""> > dev.pcm.0.starved: 0<br class=3D""> > dev.pcm.0.freebuffer: 40000<br class=3D""> > dev.pcm.0.underruns: 0<br class=3D""> > dev.pcm.0.retrieved: 0<br class=3D""> > dev.pcm.0.submitted: 0<br class=3D""> > dev.pcm.0.callbacks: 0<br class=3D""> > dev.pcm.0.dest: 0<br class=3D""> > dev.pcm.0.mode: 3<br class=3D""> > dev.pcm.0.bitperfect: 0<br class=3D""> > dev.pcm.0.buffersize: 0<br class=3D""> > dev.pcm.0.play.vchanformat: s16le:2.0<br class=3D""> > dev.pcm.0.play.vchanrate: 48000<br class=3D""> > dev.pcm.0.play.vchanmode: fixed<br class=3D""> > dev.pcm.0.play.vchans: 1<br class=3D""> > dev.pcm.0.%parent: vchiq0<br class=3D""> > dev.pcm.0.%pnpinfo:<br class=3D""> > dev.pcm.0.%location:<br class=3D""> > dev.pcm.0.%driver: pcm<br class=3D""> > dev.pcm.0.%desc: VCHIQ audio<br class=3D""> > dev.pcm.%parent:<br class=3D""> > <br class=3D""> > <br class=3D""> > To play some audio I need to search some headphones first. :-)<br = class=3D""> > <br class=3D""> > Ronald.<br class=3D""> > <br class=3D""> > <br class=3D""> > <br class=3D""> > Good morning,<br class=3D""> > <br class=3D""> > Found headphones with a cable on the attic. Plugged it into the = audio jack and played an mp3. Amazing!<br class=3D""> > <br class=3D""> > Regards,<br class=3D""> > Ronald.<br class=3D""> > <br class=3D""> <br class=3D""> <br class=3D""> </blockquote></div></div> </blockquote><br class=3D""><br class=3D""><br = class=3D""></div></div></blockquote></div><br class=3D""></body></html>= --Apple-Mail=_6390B139-EA65-43CA-B7BA-C9C88ABEB429--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87A63A19-5807-4BA9-9821-D3378129CDB5>