9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Dan Cross <cross@math.psu.edu>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] usb/usbaudio and output speed?
Date: Tue, 22 Oct 2002 20:28:07 -0400	[thread overview]
Message-ID: <200210230028.g9N0S7i13853@augusta.math.psu.edu> (raw)
In-Reply-To: Your message of "Tue, 22 Oct 2002 20:00:05 EDT." <3f47facc132f0d555da3f4979abf15fb@plan9.bell-labs.com>

> you use what gets displayed.  /dev/volume
> shows speed in hz so you use hz.   the volume
> levels are in fact percentages.
>
> /dev/volume speaks the language it understands.
> echo -n speed 22050 >/dev/volume does
> what you were trying to do.
>
> the behavior you are seeing are very weird,
> but probably just bugs in untested code paths.

Hmm.  That was what I tried at first, but it didn't work.  I got
to thinking about this percentage business later.  Anyway, here's
what happens when I try to specify the speed in Hz:

term% grep speed /dev/volume
speed out 44100
term% echo -n speed out 22050 > /dev/volume
term% grep speed /dev/volume
speed out 55010
term% kill usbaudio | rc

After that, I decided it might be good to try to run usbaudio in
debugging mode, but that didn't work, either; it tries to dereference
a nil pointer somewhere:

term% usb/usbaudio -d
usbaudio 1034: suicide: sys: trap: fault read addr=0x0 pc=0x00008f5b
term%

Okay, a short acid trip showed me that I have to specify an integer to
along with the -d argument.  I guess I could have seen that by looking
at the code and seeing the ARGF() macro, but hey.  Anyway, running with
``-d9'' shows me:

term% echo -n speed 22050 > /dev/volume
line: speed 22050
rwrite: speed playback '11034400'
controlproc: setcontrol play speed 11034400
Configuring play endpoint for 55010 Hz
sent `ep 4 1 w 4 55010' to /dev/usb0/1/ctl
term%

11034400 is pretty dang close to like 22050 times 500, but I don't know
if that means anything.  Anyway:

term% echo -n speed out 34 > /dev/volume
line: speed out 34
rwrite: speed playback '21996'
controlproc: setcontrol play speed 21996
Configuring play endpoint for 21996 Hz
sent `ep 4 1 w 4 21996' to /dev/usb0/1/ctl
term%

Looks closer to reality, but I'm still kind of confused as to what's
going on (and I'm afraid I've got too much to do for tomorrow to really
dig much more tonight).

	- Dan C.



  reply	other threads:[~2002-10-23  0:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-23  0:00 Russ Cox
2002-10-23  0:28 ` Dan Cross [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-10-25 15:56 Russ Cox
2002-10-24 17:31 nigel
2002-10-24 17:37 ` Dan Cross
2002-10-23 20:12 Russ Cox
2002-10-23 21:40 ` Dan Cross
2002-10-24 13:49 ` Dan Cross
2002-10-24 14:27   ` Boyd Roberts
2002-10-24 15:52     ` Aharon Robbins
2002-10-25  4:58       ` Jim Choate
2002-10-24 17:07     ` Dan Cross
2002-10-25  9:04     ` Anthony Mandic
2002-10-23  0:40 Russ Cox
2002-10-23 18:38 ` Dan Cross
2002-10-22 19:21 Dan Cross

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=200210230028.g9N0S7i13853@augusta.math.psu.edu \
    --to=cross@math.psu.edu \
    --cc=9fans@cse.psu.edu \
    /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).