mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
nusb/audio: name audio device as audioUxxxx/volumeUxxxx (thanks arne)
This allows having multiple audio devices.
This commit is contained in:
parent
5e370061e0
commit
dc593372bf
2 changed files with 10 additions and 5 deletions
|
@ -272,8 +272,12 @@ and
|
|||
configures and manages a USB audio device.
|
||||
It implements a file system (normally seen under
|
||||
.BR /dev ),
|
||||
compatible with
|
||||
.IR audio (3).
|
||||
exporting
|
||||
.BN audioU N
|
||||
and
|
||||
.BI volumeU N
|
||||
files that have the same semantics as
|
||||
.IR audio (1)).
|
||||
.SS Camera devices
|
||||
.I Cam
|
||||
configures and exposes a USB camera device's capabilities,
|
||||
|
|
|
@ -395,9 +395,9 @@ Foundaltc:
|
|||
devctl(d, "sampledelay %d", audiodelay);
|
||||
devctl(d, "hz %d", speed);
|
||||
if(e->dir==Ein)
|
||||
devctl(d, "name audioin");
|
||||
devctl(d, "name audioinU%s", audiodev->hname);
|
||||
else
|
||||
devctl(d, "name audio");
|
||||
devctl(d, "name audioU%s", audiodev->hname);
|
||||
return d;
|
||||
}
|
||||
|
||||
|
@ -549,7 +549,8 @@ main(int argc, char *argv[])
|
|||
sysfatal("no output stream found");
|
||||
|
||||
fs.tree = alloctree(user, "usb", DMDIR|0555, nil);
|
||||
createfile(fs.tree->root, "volume", user, 0666, nil);
|
||||
snprint(buf, sizeof buf, "volumeU%s", audiodev->hname);
|
||||
createfile(fs.tree->root, buf, user, 0666, nil);
|
||||
|
||||
snprint(buf, sizeof buf, "%d.audio", audiodev->id);
|
||||
postsharesrv(&fs, nil, "usb", buf);
|
||||
|
|
Loading…
Reference in a new issue