9front - general discussion about 9front
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] [patch] nusb/audio /dev entries fix v2
Date: Fri, 29 Dec 2023 18:10:06 +0100	[thread overview]
Message-ID: <AA087FE63A6B60E0A4B0145EC6665CE5@felloff.net> (raw)
In-Reply-To: <1787115101.3760397.1703865648791@comcenter.netcologne.de>

>	int dir = e->dir;
> 	Aconf *c;
> 	Range *f;
>+	char buf[32];
> 
> 	for(;e != nil; e = e->next){
> 		c = e->iface->aux;
>@@ -395,9 +396,12 @@
> 	devctl(d, "sampledelay %d", audiodelay);
> 	devctl(d, "hz %d", speed);
> 	if(e->dir==Ein)
>-		devctl(d, "name audioin");
>+		snprint(buf, sizeof buf, "name audioinU%s", audiodev->hname); 
> 	else
>-		devctl(d, "name audio");
>+		snprint(buf, sizeof buf, "name audioU%s", audiodev->hname);
>+	
>+	devctl(d, buf);
>+

devctl() takes a format string, so the temporary buffer is not needed.
(also avoiding format string injection from hname).

the idea is good tho.

one catch i can see is what happens when you dont have a built-in
soundcard (#A) at all?

then you have no place to bind it to :(

maybe a solution could be to have this handled by mixfs?

like we could add an argument to mixfs to pass the name of
the audio device (defaulting to /dev/audio).

or even have mixfs being able to switch output devices with
a volue message by reading /dev/audio*.

if you don't want to use mixfs, you can use aux/stub
to the rescue.

let me look into mixfs solution...

--
cinap

  reply	other threads:[~2023-12-29 17:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-29 16:00 Arne Meyer
2023-12-29 17:10 ` cinap_lenrek [this message]
2023-12-29 17:34   ` Arne Meyer
2023-12-29 21:54     ` cinap_lenrek
2023-12-30  1:53       ` hiro
2023-12-30 13:25       ` Arne Meyer
2024-01-06 16:04         ` Arne Meyer
2024-01-06 19:43           ` cinap_lenrek
2024-01-06 20:41             ` Arne Meyer
2024-01-06 19:58           ` cinap_lenrek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AA087FE63A6B60E0A4B0145EC6665CE5@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).