From nobody Sun Oct 6 22:14:41 2024 X-Original-To: freebsd-stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XMGmc0tzhz5YbrC for ; Sun, 06 Oct 2024 22:14:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XMGmb5WcTz42qx for ; Sun, 6 Oct 2024 22:14:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-7ea06275ef2so331842a12.0 for ; Sun, 06 Oct 2024 15:14:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1728252894; x=1728857694; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=b08zqj7zSzqNApIe1wIDbyLNq+bEyTSVGntmFyH02wc=; b=zQfq+3am7kDpiquXEL6LLGTDw8r+aSNIzWo2FJk+xb69e10jN2ctppP96PRiNGLJf7 OH7VGj+qxlLw2M97iehyOuVM5tbppFkAvcns8N3HykV2CRHBPsY9F7UZgMgzxbOCwISw YK4UpD6MV0Ni9DINkZPWV8kf4UDpUx6OhDKLfeHy2nx6LpAGtjoQeAbnKhDodKqRbLIg +TjHz0ZIiO8FQwyaVGFjz2MFdY2f/e2TEUyjtYcuy/d4pgqlj/igsdgKNIg97ndGc7F5 oJfMu58aOSFFnqyQmzga0pkW5+LXoQ8ejlHFf3WBDtckyrHxHMuPTe+XsrbgBvWG4mNW qo5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728252894; x=1728857694; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=b08zqj7zSzqNApIe1wIDbyLNq+bEyTSVGntmFyH02wc=; b=X4f2XEydwNYZ9k36Nu8t5MkdQZ+6FGII4FRTfSr1fgdz3kiomSJffC1WmnVED7jAO2 vd3h9Z/rCzvKZfK9Qf/upynxMxLPpS04iMGmmYYEUo3x8eJJ93Cf7VQRAQ6RR0MC8HGb PiKYnH2K5b0gyvbSNCG+6NkxS/x0jbAzJJ+Z+6elcskq4uhXBmU5nPExbn0K880bm+zu tvsEbkXoBIr/o4Bh2M5s4kR2arcZiw1geL4JhbKVYLDnvuHNJp+pZ746F2H9OCFxF/Yg zC/BzN4XLMxeN2Qc1LKNaauQKt0eiYweNS097ryirIdFuC+uCGbN34uC1yxTfTPn56tG MoaA== X-Forwarded-Encrypted: i=1; AJvYcCWxo9PgiI88Mf/sSi7gUstVsrUgba8KnoYgVeXBgoALekTPu7esxXOwDxvw5NOHmaBPxTuYIKEByuSewy+6xw==@freebsd.org X-Gm-Message-State: AOJu0YyxHF2AAd2yuVvEBlKTl02hYiGEhY+lw9IgN/aW1HpdbP3SuUIu yWf8pOeWD4DPVsFBKUoVzNtZLDcEpbsUDsVpRMy62MNfCUXceGRM6BO65an2MoASxcd+mfhRDk9 cLsD04Wow8AOYidx6dp1wUo9nOzfP5m39oyoszw== X-Google-Smtp-Source: AGHT+IGiTnkOH1TGYHW879TSC0Ux2rHXetWrgp/j4Dv6O6BHfbHpZ+QGdLk0wLD0TWSpYBzHdVbyW0SNEGTwk6mdcD8= X-Received: by 2002:a17:90a:c2c8:b0:2e0:9a63:9017 with SMTP id 98e67ed59e1d1-2e1e62a4136mr12502808a91.23.1728252894577; Sun, 06 Oct 2024 15:14:54 -0700 (PDT) List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-stable@freebsd.org Sender: owner-freebsd-stable@FreeBSD.org MIME-Version: 1.0 References: <86ploiwxw8.fsf@ltc.des.dev> <8745F9FB-9CC1-476C-9445-DC0A7A76165F@gmail.com> <8F8158B8-4D78-4A17-90B7-659ECB9988B5@gmail.com> <86v7y5vce8.fsf@ltc.des.dev> In-Reply-To: <86v7y5vce8.fsf@ltc.des.dev> From: Warner Losh Date: Sun, 6 Oct 2024 16:14:41 -0600 Message-ID: Subject: Re: uaudio device re-attach and persisting dev.pcm.$pcm.bitperfect sysctl To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: Alban Hertroys , Christos Margiolis , freebsd-stable@freebsd.org Content-Type: multipart/alternative; boundary="000000000000dd29580623d63bf6" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XMGmb5WcTz42qx X-Spamd-Bar: ---- --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 wrote: > Alban Hertroys 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


=
On Sun, Oct 6, 2024 at 2:55=E2=80=AFA= M Dag-Erling Sm=C3=B8rgrav <des@freeb= sd.org> wrote:
Alban Hertroys <haramrae@gmail.com> writes:
> Originally I tried checking for the device using:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0test "`sysctl -n dev.pcm.${PCM}.%desc`&= quot; =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 th= e advantage of knowing which device(s) were involved, so it
could= be parameterized rather than being hard-coded to something that's usua= lly true but
might fail if you, for example, start playing with b= luetooth headphones that may or may not
be present at boot...

Warner=C2=A0
--000000000000dd29580623d63bf6--