9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] usb/usbaudio and output speed?
@ 2002-10-23 20:12 Russ Cox
  2002-10-23 21:40 ` Dan Cross
  2002-10-24 13:49 ` Dan Cross
  0 siblings, 2 replies; 16+ messages in thread
From: Russ Cox @ 2002-10-23 20:12 UTC (permalink / raw)
  To: 9fans

> at home today (hey, that thing's heavy!).  I'll see if I can get
> it to crash again, and figure out where it's dying.  btw- I
> accidentally started two copies of usbaudio last night, and
> afterwards, `ps' started hanging.  It was a bummer.

If you can reliably make ps hang, please tell me how.
I've seen it happen only three times in the last three
months, and there's never enough information to figure
out exactly how it got into the state.

Russ



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] usb/usbaudio and output speed?
  2002-10-23 20:12 [9fans] usb/usbaudio and output speed? Russ Cox
@ 2002-10-23 21:40 ` Dan Cross
  2002-10-24 13:49 ` Dan Cross
  1 sibling, 0 replies; 16+ messages in thread
From: Dan Cross @ 2002-10-23 21:40 UTC (permalink / raw)
  To: 9fans

> If you can reliably make ps hang, please tell me how.
> I've seen it happen only three times in the last three
> months, and there's never enough information to figure
> out exactly how it got into the state.

I've only seen it one other time in the last year, and suspected
it was a subtle race condition that only got tickled occasionally.
I'll see if I can get it to happen again, and let you know.

	- Dan C.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] usb/usbaudio and output speed?
  2002-10-23 20:12 [9fans] usb/usbaudio and output speed? Russ Cox
  2002-10-23 21:40 ` Dan Cross
@ 2002-10-24 13:49 ` Dan Cross
  2002-10-24 14:27   ` Boyd Roberts
  1 sibling, 1 reply; 16+ messages in thread
From: Dan Cross @ 2002-10-24 13:49 UTC (permalink / raw)
  To: 9fans

> If you can reliably make ps hang, please tell me how.
> I've seen it happen only three times in the last three
> months, and there's never enough information to figure
> out exactly how it got into the state.

Okay, I can reliably (sic) make ps et al hang.  This is on an IBM
Thinkpad T21 aquired circa December, 2000.  The only USB device
connected to it at the time was a Xitel HiFi-LINK (USB audio).  It was
plugged into City power, and there was an audio CD (Rachmaninoff piano
concertos, I believe; I doubt that's relevant, but you never know) in
the CD-ROM drive at the time.  Here's what I did:

I booted up and logged in as none to minimize potential problems due to
my local environment; hopefully this should make this repeatable for
others.  My termrc is more or less what's in the distrubtion, modulo
some minor changes setting environment variables and the like, and one
``if ...'' that detects what network I'm using (and invokes ipconfig
accordingly) based on plan9.ini, so that should add minimal noise to
the mix.  I did an ``aux/vga -l $vgasize'' and started rio.  I swept
out a window and executed the following:

	term% usb/usbd
	term% usb/usbaudio
	term% usb/usbaudio	#  Note, invoking usb/usbaudio twice.
	term% kill usbaudio | rc

...And the last command hung.  I then swept out another window, tried
to run ps, but it also hung.  I then swept a third window, halted KFS,
and rebooted.  I repeated the experiment a couple of times to make sure
it wasn't a fluke, but each time got the same result.  I didn't have
time last night to investigate further (neither do I have time at the
moment, unfortunately).

Anyway, it seems that ps hangs pretty consistently when I do this.  Russ,
can you duplicate it?

	- Dan C.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] usb/usbaudio and output speed?
  2002-10-24 13:49 ` Dan Cross
@ 2002-10-24 14:27   ` Boyd Roberts
  2002-10-24 15:52     ` Aharon Robbins
                       ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Boyd Roberts @ 2002-10-24 14:27 UTC (permalink / raw)
  To: 9fans

Dan Cross wrote:

> .... and there was an audio CD (Rachmaninoff piano concertos,
> I believe; I doubt that's relevant, but you never know)

I'd say it was the Rachmaninoff.  Haven't I told you to stick to Van Halen,
when the coding gets serious?




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] usb/usbaudio and output speed?
  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
  2 siblings, 1 reply; 16+ messages in thread
From: Aharon Robbins @ 2002-10-24 15:52 UTC (permalink / raw)
  To: 9fans

In article <3DB80361.9070403@strakt.com>,
Boyd Roberts <9fans@cse.psu.edu> wrote:
>Dan Cross wrote:
>
>> .... and there was an audio CD (Rachmaninoff piano concertos,
>> I believe; I doubt that's relevant, but you never know)
>
>I'd say it was the Rachmaninoff.  Haven't I told you to stick to Van Halen,
>when the coding gets serious?

Nah, Fleetwood Mac is better.
--
Aharon (Arnold) Robbins --- Pioneer Consulting Ltd.	arnold@skeeve.com
P.O. Box 354		Home Phone: +972  8 979-0381	Fax: +1 928 569 9018
Nof Ayalon		Cell Phone: +972 51  297-545
D.N. Shimshon 99785	ISRAEL


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] usb/usbaudio and output speed?
  2002-10-24 14:27   ` Boyd Roberts
  2002-10-24 15:52     ` Aharon Robbins
@ 2002-10-24 17:07     ` Dan Cross
  2002-10-25  9:04     ` Anthony Mandic
  2 siblings, 0 replies; 16+ messages in thread
From: Dan Cross @ 2002-10-24 17:07 UTC (permalink / raw)
  To: 9fans

Van Halen?  Oh man; you've got to get back to Bondi and hang with Bruce
some more.

	- Dan C.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] usb/usbaudio and output speed?
  2002-10-24 15:52     ` Aharon Robbins
@ 2002-10-25  4:58       ` Jim Choate
  0 siblings, 0 replies; 16+ messages in thread
From: Jim Choate @ 2002-10-25  4:58 UTC (permalink / raw)
  To: 9fans


On Thu, 24 Oct 2002, Aharon Robbins wrote:

> In article <3DB80361.9070403@strakt.com>,
> Boyd Roberts <9fans@cse.psu.edu> wrote:
> >Dan Cross wrote:
> >
> >> .... and there was an audio CD (Rachmaninoff piano concertos,
> >> I believe; I doubt that's relevant, but you never know)
> >
> >I'd say it was the Rachmaninoff.  Haven't I told you to stick to Van Halen,
> >when the coding gets serious?
>
> Nah, Fleetwood Mac is better.

Skinny Puppy (!!!!)
The Cult (The Cure suck)
Social D
Ramones
T. Rex
Hanoi Rocks
Kidney Thieves
Rasputina
FLA
Front 242
Shonen Knife
Scraping Foetus Off The Wheel
Throbbing Gristle
Einsterzende Neubauten
Chemlab
NIN
Ministry
Nirvana
STP
AC/DC
Led Zep
Black Sabbath
Blue Cheer
Cream
Yardbirds
Doors
Red Hot Chili Peppers
PIL
Gorillaz
The White Stripes
The Vines
Lords of the New Church
Tool
Electric Frankenstein
GWAR
The Muffs
Man or Astroman (!!!!)
...


 --
    ____________________________________________________________________

    We don't see things as they are,                      ravage@ssz.com
    we see them as we are.                                   www.ssz.com
                                                  jchoate@open-forge.org
    Anais Nin                                         www.open-forge.org

    --------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] usb/usbaudio and output speed?
  2002-10-24 14:27   ` Boyd Roberts
  2002-10-24 15:52     ` Aharon Robbins
  2002-10-24 17:07     ` Dan Cross
@ 2002-10-25  9:04     ` Anthony Mandic
  2 siblings, 0 replies; 16+ messages in thread
From: Anthony Mandic @ 2002-10-25  9:04 UTC (permalink / raw)
  To: 9fans

Boyd Roberts wrote:
>
> Dan Cross wrote:
>
> > .... and there was an audio CD (Rachmaninoff piano concertos,
> > I believe; I doubt that's relevant, but you never know)
>
> I'd say it was the Rachmaninoff.  Haven't I told you to stick to Van Halen,
> when the coding gets serious?

	I was just listening to Iron Butterfly. Amazing what you can
	get done during 17 minutes of In-A-Gadda-Da-Vida (Vita?).

-am	� 2002


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] usb/usbaudio and output speed?
@ 2002-10-25 15:56 Russ Cox
  0 siblings, 0 replies; 16+ messages in thread
From: Russ Cox @ 2002-10-25 15:56 UTC (permalink / raw)
  To: 9fans

	term% usb/usbd
	term% usb/usbaudio
	term% usb/usbaudio	#  Note, invoking usb/usbaudio twice.
	term% kill usbaudio | rc

This is a problem in the usb driver.

It still doesn't the explain the other
ps hangs I've seen.  In general, ps hangs
because some proc's p->debug gets locked
and never unlocked.  Then opening that
proc's status file hangs.

In this case, postnote got confused because
a rendez structure got freed while a process
was still sleeping on it.  The result was that
postnote just keeps looping staring at this
freed memory, which will never again look like
an available lock.  Postnote is sitting on p->debug
while doing this.  Usually the looping doesn't
happen or loops once just to deal with transient
lock ordering problems.  It can't really do much
when it's been pointed at bad memory.

If anyone has any other reliable recipes for
making ps hang, I'm still all ears.  The
hangs I've seen had nothing to do with usb.

Russ


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] usb/usbaudio and output speed?
  2002-10-24 17:31 nigel
@ 2002-10-24 17:37 ` Dan Cross
  0 siblings, 0 replies; 16+ messages in thread
From: Dan Cross @ 2002-10-24 17:37 UTC (permalink / raw)
  To: 9fans

(Wrong Bruce, Nigel.)

	- Dan C.

:-)


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] usb/usbaudio and output speed?
@ 2002-10-24 17:31 nigel
  2002-10-24 17:37 ` Dan Cross
  0 siblings, 1 reply; 16+ messages in thread
From: nigel @ 2002-10-24 17:31 UTC (permalink / raw)
  To: 9fans

> Van Halen?  Oh man; you've got to get back to Bondi and hang with Bruce
> some more.
>
> 	- Dan C.

Asbury Park surely?



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] usb/usbaudio and output speed?
  2002-10-23  0:40 Russ Cox
@ 2002-10-23 18:38 ` Dan Cross
  0 siblings, 0 replies; 16+ messages in thread
From: Dan Cross @ 2002-10-23 18:38 UTC (permalink / raw)
  To: 9fans

> usb/usbaudio is just simulating /dev/volume for you.
> the real settings are accesssed via /dev/audioctl.
> it's entirely likely that usbaudio gets the speed simulation
> in /dev/volume wrong, since we tend to use only 44100.
> the volume file is really a crutch.  it doesn't work well.

Good to know.  However, when I tried to write things into
/dev/audioctl, the machine paniced.  I'm afraid I left my laptop
at home today (hey, that thing's heavy!).  I'll see if I can get
it to crash again, and figure out where it's dying.  btw- I
accidentally started two copies of usbaudio last night, and
afterwards, `ps' started hanging.  It was a bummer.

	- Dan C.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] usb/usbaudio and output speed?
@ 2002-10-23  0:40 Russ Cox
  2002-10-23 18:38 ` Dan Cross
  0 siblings, 1 reply; 16+ messages in thread
From: Russ Cox @ 2002-10-23  0:40 UTC (permalink / raw)
  To: 9fans

usb/usbaudio is just simulating /dev/volume for you.
the real settings are accesssed via /dev/audioctl.
it's entirely likely that usbaudio gets the speed simulation
in /dev/volume wrong, since we tend to use only 44100.
the volume file is really a crutch.  it doesn't work well.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] usb/usbaudio and output speed?
  2002-10-23  0:00 Russ Cox
@ 2002-10-23  0:28 ` Dan Cross
  0 siblings, 0 replies; 16+ messages in thread
From: Dan Cross @ 2002-10-23  0:28 UTC (permalink / raw)
  To: 9fans

> 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.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] usb/usbaudio and output speed?
@ 2002-10-23  0:00 Russ Cox
  2002-10-23  0:28 ` Dan Cross
  0 siblings, 1 reply; 16+ messages in thread
From: Russ Cox @ 2002-10-23  0:00 UTC (permalink / raw)
  To: 9fans

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.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* [9fans] usb/usbaudio and output speed?
@ 2002-10-22 19:21 Dan Cross
  0 siblings, 0 replies; 16+ messages in thread
From: Dan Cross @ 2002-10-22 19:21 UTC (permalink / raw)
  To: 9fans

Hmm, this is weird.

term% grep speed /dev/volume
speed out 44100
term% echo -n speed out 50 > /dev/volume
term% grep speed /dev/volume
speed out 30000
term% echo -n speed out 100 > /dev/volume
term% grep speed /dev/volume
speed out 55010
term%

I was under the impression that, when setting things like output speed,
one should use percentages of values.  However, 50% of 44100 in real
space certainly isn't 30000.  Is this a bug, or am I just not
understanding how the USB audio device works?  Thanks!

	- Dan C.



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2002-10-25 15:56 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-23 20:12 [9fans] usb/usbaudio and output speed? 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
  -- 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  0:40 Russ Cox
2002-10-23 18:38 ` Dan Cross
2002-10-23  0:00 Russ Cox
2002-10-23  0:28 ` Dan Cross
2002-10-22 19:21 Dan Cross

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).