Date: Sun, 6 Oct 2024 16:14:41 -0600 From: Warner Losh <imp@bsdimp.com> To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= <des@freebsd.org> Cc: Alban Hertroys <haramrae@gmail.com>, Christos Margiolis <christos@freebsd.org>, freebsd-stable@freebsd.org Subject: Re: uaudio device re-attach and persisting dev.pcm.$pcm.bitperfect sysctl Message-ID: <CANCZdfrz4-_-%2Bxcd8P-5d29Z4BSCk2h=b4oMQ1XKoK6rQEFivA@mail.gmail.com> In-Reply-To: <86v7y5vce8.fsf@ltc.des.dev> References: <F61ECC96-6FCB-4A4E-9EEC-8D6AF31A8A62@gmail.com> <86ploiwxw8.fsf@ltc.des.dev> <8745F9FB-9CC1-476C-9445-DC0A7A76165F@gmail.com> <fgpuue37atkszq5hbty2ec47c47nd3dpokrdhl4g4b3qlh4po2@luayn4ocxtpw> <8F8158B8-4D78-4A17-90B7-659ECB9988B5@gmail.com> <86v7y5vce8.fsf@ltc.des.dev>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000dd29580623d63bf6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Oct 6, 2024 at 2:55=E2=80=AFAM Dag-Erling Sm=C3=B8rgrav <des@freebs= d.org> wrote: > Alban Hertroys <haramrae@gmail.com> writes: > > Originally I tried checking for the device using: > > test "`sysctl -n dev.pcm.${PCM}.%desc`" =3D 'Topping D90SE=E2=80= =99 > > , but that statement seems to require the double-quotes for test to > > accept it, which conflict with the double-quotes of the action > > string. I couldn=E2=80=99t find a way to escape those inner quotes. So = that=E2=80=99s > > another issue I ran into, although approaches to use the USB attach > > event for matching the dsp device to the usb device are clearly > > superior to reading out a sysctl that=E2=80=99s an effect of it. > > You realize you can just put everything in a shell script which devd > invokes, right? > That would also have the advantage of knowing which device(s) were involved, so it could be parameterized rather than being hard-coded to something that's usually true but might fail if you, for example, start playing with bluetooth headphones that may or may not be present at boot... Warner --000000000000dd29580623d63bf6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <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, Oct 6, 2024 at 2:55=E2=80=AFA= M Dag-Erling Sm=C3=B8rgrav <<a href=3D"mailto:des@freebsd.org">des@freeb= sd.org</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"m= argin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left= :1ex">Alban Hertroys <<a href=3D"mailto:haramrae@gmail.com" target=3D"_b= lank">haramrae@gmail.com</a>> writes:<br> > Originally I tried checking for the device using:<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0test "`sysctl -n dev.pcm.${PCM}.%desc`&= quot; =3D 'Topping D90SE=E2=80=99<br> > , but that statement seems to require the double-quotes for test to<br= > > accept it, which conflict with the double-quotes of the action<br> > string. I couldn=E2=80=99t find a way to escape those inner quotes. So= that=E2=80=99s<br> > another issue I ran into, although approaches to use the USB attach<br= > > event for matching the dsp device to the usb device are clearly<br> > superior to reading out a sysctl that=E2=80=99s an effect of it.<br> <br> You realize you can just put everything in a shell script which devd<br> invokes, right?<br></blockquote><div><br></div><div>That would also have th= e advantage of knowing which device(s) were involved, so it</div><div>could= be parameterized rather than being hard-coded to something that's usua= lly true but</div><div>might fail if you, for example, start playing with b= luetooth headphones that may or may not</div><div>be present at boot...</di= v><div><br></div><div>Warner=C2=A0</div></div></div> --000000000000dd29580623d63bf6--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrz4-_-%2Bxcd8P-5d29Z4BSCk2h=b4oMQ1XKoK6rQEFivA>