Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Feb 2022 12:42:24 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Marco Devesas Campos <devesas.campos@gmail.com>
Cc:        Ronald Klop <ronald-lists@klop.ws>,  "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>
Subject:   Re: [PATCH] Experimental vchiq and bcm2835_audio support for arm64
Message-ID:  <CANCZdfpvUcmOu9KmpdXMOhmqabt1iS9wEKfqg%2B3JMHQVQNtOXA@mail.gmail.com>
In-Reply-To: <87A63A19-5807-4BA9-9821-D3378129CDB5@gmail.com>
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> <87A63A19-5807-4BA9-9821-D3378129CDB5@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000203d1605d9194013
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Feb 28, 2022, 12:36 PM Marco Devesas Campos <
devesas.campos@gmail.com> wrote:

> Entirely right, Ronald =E2=80=94 thanks for catching it!
>

Oops

Warner, can I send you a consolidated patch later in the week? What=E2=80=
=99s the
> best way to submit it?
>

Git format-patch is likely best.

Warner


> Best,
> Marco
>
> On 28 Feb 2022, at 19:26, Ronald Klop <ronald-lists@klop.ws> wrote:
>
> On Sun, 27 Feb 2022 17:41:25 +0100, Warner Losh <imp@bsdimp.com> wrote:
>
>
>
> On Sun, Feb 27, 2022 at 8:44 AM Marco Devesas Campos <
> devesas.campos@gmail.com> wrote:
>
>> Hi, List
>>
>> On the back of Ronald Klop's comments (thanks!), I went and got myself a=
n
>> 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)=
.
>>
>
> I've committed the patch below. If it turns out we need more, we can
> always augment.
>
>
>
> Hi Marco, Warner,
>
> 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?
>
> Regards,
> Ronald.
>
>
>
>
>
>
>
> Warner
>
>
>> One of the potential projects highlighted in the latest call for proposa=
ls
>> 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.
>>
>> Best,
>> Marco
>>
>>
>>
>> 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}
>>  };
>>
>>
>>
>> > On 8 Feb 2022, at 08:49, Ronald Klop <ronald-lists@klop.ws> wrote:
>> >
>> > Van: Ronald Klop <ronald-lists@klop.ws>
>> > Datum: maandag, 7 februari 2022 21:05
>> > Aan: Marco Devesas Campos <devesas.campos@gmail.com>,
>> freebsd-arm@freebsd.org
>> > Onderwerp: Re: [PATCH] Experimental vchiq and bcm2835_audio support fo=
r
>> arm64
>> >
>> > 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> 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? otherwis=
e
>> try
>> > > setting `sysctl dev.pcm.0.dest=3D1`)
>> > >
>> > > Best,
>> > > Marco
>> >
>> >
>> > Hi,
>> >
>> > Booted the patched 14-CURRENT on the RPI3B+.
>> >
>> > dmesg diff:
>> > +vchiq0: <BCM2835 VCHIQ> mem 0x7e00b840-0x7e00b87b irq 54 on simplebus=
0
>> > +vchiq: local ver 8 (min 3), remote ver 8.
>> > +pcm0: <VCHIQ audio> on vchiq0
>> >
>> > [root@rpi3 ~]# cat /dev/sndstat
>> > Installed devices:
>> > pcm0: <VCHIQ audio> (play) default
>> > No devices installed from userspace.
>> >
>> > [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:
>> >
>> >
>> > To play some audio I need to search some headphones first. :-)
>> >
>> > Ronald.
>> >
>> >
>> >
>> > Good morning,
>> >
>> > Found headphones with a cable on the attic. Plugged it into the audio
>> jack and played an mp3. Amazing!
>> >
>> > Regards,
>> > Ronald.
>> >
>>
>>
>>
>
>
>
>

--000000000000203d1605d9194013
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">On Mon, Feb 28, 2022, 12:36 PM Marco Devesas Campos &l=
t;<a href=3D"mailto:devesas.campos@gmail.com">devesas.campos@gmail.com</a>&=
gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style=3D"word-wrap:=
break-word;line-break:after-white-space"><span style=3D"color:rgb(0,0,0);fo=
nt-family:GillSans-Light;font-size:14px">Entirely right, Ronald =E2=80=94 t=
hanks for catching it!</span></div></blockquote></div></div><div dir=3D"aut=
o"><br></div><div dir=3D"auto">Oops</div><div dir=3D"auto"><br></div><div d=
ir=3D"auto"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div =
style=3D"word-wrap:break-word;line-break:after-white-space"><span style=3D"=
color:rgb(0,0,0);font-family:GillSans-Light;font-size:14px">Warner, can I s=
end you a consolidated patch later in the week? What=E2=80=99s the best way=
 to submit it?</span></div></blockquote></div></div><div dir=3D"auto"><br><=
/div><div dir=3D"auto">Git format-patch is likely best.</div><div dir=3D"au=
to"><br></div><div dir=3D"auto">Warner=C2=A0</div><div dir=3D"auto"><br></d=
iv><div dir=3D"auto"><div class=3D"gmail_quote"><blockquote class=3D"gmail_=
quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1=
ex"><div style=3D"word-wrap:break-word;line-break:after-white-space"><br st=
yle=3D"color:rgb(0,0,0);font-family:GillSans-Light;font-size:14px"><span st=
yle=3D"color:rgb(0,0,0);font-family:GillSans-Light;font-size:14px">Best,</s=
pan><br style=3D"color:rgb(0,0,0);font-family:GillSans-Light;font-size:14px=
"><span style=3D"color:rgb(0,0,0);font-family:GillSans-Light;font-size:14px=
">Marco</span><br><div><br><blockquote type=3D"cite"><div>On 28 Feb 2022, a=
t 19:26, Ronald Klop &lt;<a href=3D"mailto:ronald-lists@klop.ws" target=3D"=
_blank" rel=3D"noreferrer">ronald-lists@klop.ws</a>&gt; wrote:</div><br><di=
v>


<div>On Sun, 27 Feb 2022 17:41:25 +0100, Warner Losh &lt;<a href=3D"mailto:=
imp@bsdimp.com" target=3D"_blank" rel=3D"noreferrer">imp@bsdimp.com</a>&gt;=
 wrote:<br><br><blockquote style=3D"margin:0 0 0.80ex;border-left:#0000ff 2=
px solid;padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><br></div><br>=
<div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sun, Fe=
b 27, 2022 at 8:44 AM Marco Devesas Campos &lt;<a href=3D"mailto:devesas.ca=
mpos@gmail.com" target=3D"_blank" rel=3D"noreferrer">devesas.campos@gmail.c=
om</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margi=
n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex=
">Hi, List<br>
<br>
On the back of Ronald Klop&#39;s comments (thanks!), I went and got myself =
an<br>
RPI 4 and it turns out all that was need was adding the right dtb<br>
reference and it all works (seemingly) fine (incremental patch attached).<b=
r></blockquote><div><br></div><div>I&#39;ve committed the patch below. If i=
t turns out we need more, we can always augment.</div></div></div></blockqu=
ote><div><br></div><div><br></div><div>Hi Marco, Warner,</div><div><br></di=
v><div>Isn&#39;t the patch from <a href=3D"https://lists.freebsd.org/archiv=
es/freebsd-arm/2022-February/000949.html" target=3D"_blank" rel=3D"noreferr=
er">https://lists.freebsd.org/archives/freebsd-arm/2022-February/000949.htm=
l</a> needed also?</div><div>As you mention the patch below is an increment=
al patch?</div><div><br></div><div>Regards,</div><div>Ronald.</div><div><br=
></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br=
></div><blockquote style=3D"margin:0 0 0.80ex;border-left:#0000ff 2px solid=
;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_quote"><div><br></d=
iv><div>Warner</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddin=
g-left:1ex">
One of the potential projects highlighted in the latest call for proposals<=
br>
was exactly to get hdmi audio output in 64 bit Pis, viz. the 400-s. If<br>
anyone who voted for that reads this list, wd be nice to get some input on<=
br>
the patches.<br>
<br>
Best,<br>
Marco<br>
<br>
<br>
<br>
diff --git a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c b/sys/contr=
ib/vchiq/interface/vchiq_arm/vchiq_kmod.c<br>
index dc18678b99a3..344267ff0c1c 100644<br>
--- a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c<br>
+++ b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c<br>
@@ -83,6 +83,7 @@ static struct bcm_vchiq_softc *bcm_vchiq_sc =3D NULL;<br>
=C2=A0static struct ofw_compat_data compat_data[] =3D {<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;broadcom,bcm2835-vchiq&quot;,=C2=A0 =C2=
=A0 =C2=A0 BSD_DTB},<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;brcm,bcm2835-vchiq&quot;,=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 UPSTREAM_DTB},<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0{&quot;brcm,bcm2711-vchiq&quot;,=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 UPSTREAM_DTB},<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {NULL,=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0}<br>
=C2=A0};<br>
<br>
<br>
<br>
&gt; On 8 Feb 2022, at 08:49, Ronald Klop &lt;<a href=3D"mailto:ronald-list=
s@klop.ws" target=3D"_blank" rel=3D"noreferrer">ronald-lists@klop.ws</a>&gt=
; wrote:<br>
&gt; <br>
&gt; Van: Ronald Klop &lt;<a href=3D"mailto:ronald-lists@klop.ws" target=3D=
"_blank" rel=3D"noreferrer">ronald-lists@klop.ws</a>&gt;<br>
&gt; Datum: maandag, 7 februari 2022 21:05<br>
&gt; Aan: Marco Devesas Campos &lt;<a href=3D"mailto:devesas.campos@gmail.c=
om" target=3D"_blank" rel=3D"noreferrer">devesas.campos@gmail.com</a>&gt;, =
<a href=3D"mailto:freebsd-arm@freebsd.org" target=3D"_blank" rel=3D"norefer=
rer">freebsd-arm@freebsd.org</a><br>
&gt; Onderwerp: Re: [PATCH] Experimental vchiq and bcm2835_audio support fo=
r arm64<br>
&gt; <br>
&gt; On 2/6/22 14:46, Marco Devesas Campos wrote:<br>
&gt; &gt; Hi Ronald,<br>
&gt; &gt;<br>
&gt; &gt; Thanks so much for trying out the patch out.<br>
&gt; &gt;<br>
&gt; &gt;&gt; On 6 Feb 2022, at 13:05, Ronald Klop &lt;<a href=3D"mailto:ro=
nald-lists@klop.ws" target=3D"_blank" rel=3D"noreferrer">ronald-lists@klop.=
ws</a>&gt; wrote:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Hi,<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; I compiled this on a RPI4 + 14-CURRENT. It boots, but I see n=
o difference in available devices.<br>
&gt; &gt;&gt; I can try to boot it on a RPI3B+ on another time.<br>
&gt; &gt;<br>
&gt; &gt; I *think* the GPU/VC in RPI-4 is a very different beast from the =
others. I&#39;ll<br>
&gt; &gt; look into it, but if you could give it a try on the 3+ I&#39;d be=
 much obliged.<br>
&gt; &gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; What would be the expected outcome? Where should I look at (o=
r listen to)?<br>
&gt; &gt;&gt;<br>
&gt; &gt;<br>
&gt; &gt; You should see something like<br>
&gt; &gt;<br>
&gt; &gt;=C2=A0 =C2=A0 vchiq0: &lt;BCM2835 VCHIQ&gt; mem 0x7e00b840-0x7e00b=
87b irq 54 on simplebus0<br>
&gt; &gt;=C2=A0 =C2=A0 vchiq: local ver 8 (min 3), remote ver 8.<br>
&gt; &gt;=C2=A0 =C2=A0 pcm0: &lt;VCHIQ audio&gt; on vchiq0<br>
&gt; &gt;<br>
&gt; &gt; in your dmesg output.<br>
&gt; &gt;<br>
&gt; &gt; The file /dev/vchiq should exist, as well as the following sysctl=
-s (I&#39;m<br>
&gt; &gt; assuming no other audio devices are attached)<br>
&gt; &gt;<br>
&gt; &gt;=C2=A0 =C2=A0 % sysctl dev.pcm<br>
&gt; &gt;=C2=A0 =C2=A0 dev.pcm.0.trace: 0<br>
&gt; &gt;=C2=A0 =C2=A0 ...<br>
&gt; &gt;=C2=A0 =C2=A0 dev.pcm.0.dest: 0<br>
&gt; &gt;=C2=A0 =C2=A0 ...<br>
&gt; &gt;=C2=A0 =C2=A0 dev.pcm.0.%parent: vchiq0<br>
&gt; &gt;=C2=A0 =C2=A0 ...<br>
&gt; &gt;=C2=A0 =C2=A0 dev.pcm.0.%driver: pcm<br>
&gt; &gt;=C2=A0 =C2=A0 dev.pcm.0.%desc: VCHIQ audio<br>
&gt; &gt;=C2=A0 =C2=A0 =E2=80=A6<br>
&gt; &gt;<br>
&gt; &gt; Then if you `cat &lt; /dev/random &gt; /dev/dsp` you should hear =
some static coming<br>
&gt; &gt; out of whatever is connected to hdmi (maybe headphones too? other=
wise try<br>
&gt; &gt; setting `sysctl dev.pcm.0.dest=3D1`)<br>
&gt; &gt;<br>
&gt; &gt; Best,<br>
&gt; &gt; Marco<br>
&gt; <br>
&gt; <br>
&gt; Hi,<br>
&gt; <br>
&gt; Booted the patched 14-CURRENT on the RPI3B+.<br>
&gt; <br>
&gt; dmesg diff:<br>
&gt; +vchiq0: &lt;BCM2835 VCHIQ&gt; mem 0x7e00b840-0x7e00b87b irq 54 on sim=
plebus0<br>
&gt; +vchiq: local ver 8 (min 3), remote ver 8.<br>
&gt; +pcm0: &lt;VCHIQ audio&gt; on vchiq0<br>
&gt; <br>
&gt; [root@rpi3 ~]# cat /dev/sndstat<br>
&gt; Installed devices:<br>
&gt; pcm0: &lt;VCHIQ audio&gt; (play) default<br>
&gt; No devices installed from userspace.<br>
&gt; <br>
&gt; [root@rpi3 ~]# sysctl dev.pcm<br>
&gt; dev.pcm.0.trace: 0<br>
&gt; dev.pcm.0.starved: 0<br>
&gt; dev.pcm.0.freebuffer: 40000<br>
&gt; dev.pcm.0.underruns: 0<br>
&gt; dev.pcm.0.retrieved: 0<br>
&gt; dev.pcm.0.submitted: 0<br>
&gt; dev.pcm.0.callbacks: 0<br>
&gt; dev.pcm.0.dest: 0<br>
&gt; dev.pcm.0.mode: 3<br>
&gt; dev.pcm.0.bitperfect: 0<br>
&gt; dev.pcm.0.buffersize: 0<br>
&gt; dev.pcm.0.play.vchanformat: s16le:2.0<br>
&gt; dev.pcm.0.play.vchanrate: 48000<br>
&gt; dev.pcm.0.play.vchanmode: fixed<br>
&gt; dev.pcm.0.play.vchans: 1<br>
&gt; dev.pcm.0.%parent: vchiq0<br>
&gt; dev.pcm.0.%pnpinfo:<br>
&gt; dev.pcm.0.%location:<br>
&gt; dev.pcm.0.%driver: pcm<br>
&gt; dev.pcm.0.%desc: VCHIQ audio<br>
&gt; dev.pcm.%parent:<br>
&gt; <br>
&gt; <br>
&gt; To play some audio I need to search some headphones first. :-)<br>
&gt; <br>
&gt; Ronald.<br>
&gt;=C2=A0 <br>
&gt; <br>
&gt; <br>
&gt; Good morning,<br>
&gt; <br>
&gt; Found headphones with a cable on the attic. Plugged it into the audio =
jack and played an mp3. Amazing!<br>
&gt; <br>
&gt; Regards,<br>
&gt; Ronald.<br>
&gt;=C2=A0 <br>
<br>
<br>
</blockquote></div></div>
</blockquote><br><br><br></div></div></blockquote></div><br></div></blockqu=
ote></div></div></div>

--000000000000203d1605d9194013--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpvUcmOu9KmpdXMOhmqabt1iS9wEKfqg%2B3JMHQVQNtOXA>