mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* PROBLEM: OSS mixer does not work with second card.
@ 2002-03-28 16:39 Dariush Pietrzak
  2002-03-28 17:18 ` Questions about /proc/stat M. Edward (Ed) Borasky
  0 siblings, 1 reply; 6+ messages in thread
From: Dariush Pietrzak @ 2002-03-28 16:39 UTC (permalink / raw)
  To: linux-kernel

Hello,
 I have no idea whom to send/ask this.

[1.] 
mixer can be accessed only by /dev/mixer, /dev/mixer1 does not
work.
[2.] 
There are two sound cards, first accessible as /dev/dsp, second as
/dev/dsp1. Mixer for first is /dev/mixer, for second should be
/dev/mixer1.. but it doesen't work.
eyck@ghost:~$ aumix -d /dev/mixer1 -r100
aumix:  MIXER_WRITE
eyck@ghost:~$ aumix -d /dev/mixer1 -w100
aumix:  MIXER_WRITE
 At first i thought it's a problem with gus driver, which i've been told
created some problems... but then I switched cards.. now gus is /dev/dsp
and sb is /dev/dsp1. And now I can control my gus, but no longer can
control sb.
[3.] Keywords: sound mixer
[4.] Kernel version: 2.4.18-xfs
[7.] ...irrelevant, probably.
[X.] 
 Who is current SOUND maintainer? Maybe I should switch to ALSA and stop
 bugging ppl?

best regards,
-- 
Eyck, 
 I'm back! And I'm BAD!
...Obviously within certain sensible preset parameters

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

* Questions about /proc/stat
  2002-03-28 16:39 PROBLEM: OSS mixer does not work with second card Dariush Pietrzak
@ 2002-03-28 17:18 ` M. Edward (Ed) Borasky
  2002-04-01 23:14   ` Randy.Dunlap
  0 siblings, 1 reply; 6+ messages in thread
From: M. Edward (Ed) Borasky @ 2002-03-28 17:18 UTC (permalink / raw)
  To: linux-kernel

I have some questions about the "page" and "swap" entries in /proc/stat.
Here is the relevant code from 2.4.12
/usr/src/linux/fs/proc/proc_misc.c:

    292         len += sprintf(page + len,
    293                 "page %u %u\n"
    294                 "swap %u %u\n"
    295                 "intr %u",
    296                         kstat.pgpgin >> 1,
    297                         kstat.pgpgout >> 1,
    298                         kstat.pswpin,
    299                         kstat.pswpout,
    300                         sum
    301         );

1. Why are kstat.pgpgin and kstat.pgpgout shifted right / halved?

2. Are the "page" and "swap" numbers mutually exclusive? That is, if a
page is brought in from swap and counted in kstat.pswpin, is it also
counted in kstat.pgpgin? I found the places in the code where the counts
are incremented, but I couldn't tell if the swapin routine calls the
block driver or not.
--
M. Edward Borasky

znmeb@borasky-research.net

Actually, for their size, elephants don't smell all that bad.


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

* Re: Questions about /proc/stat
  2002-03-28 17:18 ` Questions about /proc/stat M. Edward (Ed) Borasky
@ 2002-04-01 23:14   ` Randy.Dunlap
  2002-04-01 23:44     ` M. Edward (Ed) Borasky
  0 siblings, 1 reply; 6+ messages in thread
From: Randy.Dunlap @ 2002-04-01 23:14 UTC (permalink / raw)
  To: M. Edward (Ed) Borasky; +Cc: linux-kernel

On Thu, 28 Mar 2002, M. Edward (Ed) Borasky wrote:

| I have some questions about the "page" and "swap" entries in /proc/stat.
| Here is the relevant code from 2.4.12
| /usr/src/linux/fs/proc/proc_misc.c:
|
|     292         len += sprintf(page + len,
|     293                 "page %u %u\n"
|     294                 "swap %u %u\n"
|     295                 "intr %u",
|     296                         kstat.pgpgin >> 1,
|     297                         kstat.pgpgout >> 1,
|     298                         kstat.pswpin,
|     299                         kstat.pswpout,
|     300                         sum
|     301         );

Of course the basic answer is something like
  Try cscope
or
  cd /usr/src/linux
  grep -r "kstat.p" * | more

Using the latter one:

| 1. Why are kstat.pgpgin and kstat.pgpgout shifted right / halved?

I had wondered that also, so you made me look.

pgpgin and pgpgout are maintained (counted) in units of 512-byte
blocks but displayed in /proc/stat in 1 KB (KiB :) blocks by
shifting right by 1.

| 2. Are the "page" and "swap" numbers mutually exclusive? That is, if a
| page is brought in from swap and counted in kstat.pswpin, is it also
| counted in kstat.pgpgin? I found the places in the code where the counts
| are incremented, but I couldn't tell if the swapin routine calls the
| block driver or not.

No, "page" and "swap" counts are not mutually exclusive.
Both paths call submit_bh().

For swap:

mm/page_io.c::rw_swap_page_base():
	/* reads or writes a swap page */
	kstat.pswpin++;
	kstat.pswpout++;
	calls brw_page();
		which calls submit_bh();

For all low-level block I/O:

drivers/block/ll_rw_blk.c::ll_rw_block():
	/* low-level access to block devices */
	calls submit_bh();

drivers/block/ll_rw_blk.c::submit_bh():
	count := is number of 512-byte blocks;
	kstat.pgpgout += count;
	kstat.pgpgin += count;
	calls generic_make_request();

-- 
~Randy


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

* Re: Questions about /proc/stat
  2002-04-01 23:14   ` Randy.Dunlap
@ 2002-04-01 23:44     ` M. Edward (Ed) Borasky
  2002-04-01 23:58       ` Randy.Dunlap
  0 siblings, 1 reply; 6+ messages in thread
From: M. Edward (Ed) Borasky @ 2002-04-01 23:44 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: linux-kernel

On Mon, 1 Apr 2002, Randy.Dunlap wrote:

> Of course the basic answer is something like
>   Try cscope

I can't find this -- does it come with Red Hat??

> or
>   cd /usr/src/linux
>   grep -r "kstat.p" * | more

This worked.

>
> Using the latter one:
>
> | 1. Why are kstat.pgpgin and kstat.pgpgout shifted right / halved?
>
> I had wondered that also, so you made me look.
>
> pgpgin and pgpgout are maintained (counted) in units of 512-byte
> blocks but displayed in /proc/stat in 1 KB (KiB :) blocks by shifting
> right by 1.

Yes ... that I managed to figure out. Seems strange that pgpgin/out are
in units of kilobytes and pswpin/out are in units of pages, though. Just
another little hole that needs plugging in the documentation.

> | 2. Are the "page" and "swap" numbers mutually exclusive? That is, if a
> | page is brought in from swap and counted in kstat.pswpin, is it also
> | counted in kstat.pgpgin? I found the places in the code where the counts
> | are incremented, but I couldn't tell if the swapin routine calls the
> | block driver or not.

> No, "page" and "swap" counts are not mutually exclusive.
> Both paths call submit_bh().
>
> For swap:
>
> mm/page_io.c::rw_swap_page_base():
> 	/* reads or writes a swap page */
> 	kstat.pswpin++;
> 	kstat.pswpout++;
> 	calls brw_page();
> 		which calls submit_bh();
>
> For all low-level block I/O:
>
> drivers/block/ll_rw_blk.c::ll_rw_block():
> 	/* low-level access to block devices */
> 	calls submit_bh();
>
> drivers/block/ll_rw_blk.c::submit_bh():
> 	count := is number of 512-byte blocks;
> 	kstat.pgpgout += count;
> 	kstat.pgpgin += count;
> 	calls generic_make_request();

Ah ... so every page to/from swap is counted in pswpin/out (as a page)
and again in pgpgin/out as half-kilobytes :-). Incidentally, I also
followed the third fork in this road, the one which derives the "blocks"
read and written per device that show up in /proc/stat. Those "blocks"
turn out to be 512 bytes long.

All of this is quite useful, actually, because I'm trying to make sense
of some high-frequency (every 15 seconds) samples of I/O data. Thanks!!

-- 
M. Edward Borasky
znmeb@borasky-research.net

The COUGAR Project
http://www.borasky-research.com/Cougar.htm

How to Stop A Folksinger Cold # 4
"Tie me kangaroo down, sport..."
Tie your own kangaroo down -- and stop calling me "sport"!


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

* Re: Questions about /proc/stat
  2002-04-01 23:44     ` M. Edward (Ed) Borasky
@ 2002-04-01 23:58       ` Randy.Dunlap
  2002-04-02  0:51         ` M. Edward (Ed) Borasky
  0 siblings, 1 reply; 6+ messages in thread
From: Randy.Dunlap @ 2002-04-01 23:58 UTC (permalink / raw)
  To: M. Edward (Ed) Borasky; +Cc: linux-kernel

On Mon, 1 Apr 2002, M. Edward (Ed) Borasky wrote:

| On Mon, 1 Apr 2002, Randy.Dunlap wrote:
|
| > Of course the basic answer is something like
| >   Try cscope
|
| I can't find this -- does it come with Red Hat??

it's at cscope.sf.net

| > or
| >   cd /usr/src/linux
| >   grep -r "kstat.p" * | more
|
| This worked.
|
| >
| > Using the latter one:
| >
| > | 1. Why are kstat.pgpgin and kstat.pgpgout shifted right / halved?
| >
| > I had wondered that also, so you made me look.
| >
| > pgpgin and pgpgout are maintained (counted) in units of 512-byte
| > blocks but displayed in /proc/stat in 1 KB (KiB :) blocks by shifting
| > right by 1.
|
| Yes ... that I managed to figure out. Seems strange that pgpgin/out are
| in units of kilobytes and pswpin/out are in units of pages, though. Just
| another little hole that needs plugging in the documentation.
|
| > | 2. Are the "page" and "swap" numbers mutually exclusive? That is, if a
| > | page is brought in from swap and counted in kstat.pswpin, is it also
| > | counted in kstat.pgpgin? I found the places in the code where the counts
| > | are incremented, but I couldn't tell if the swapin routine calls the
| > | block driver or not.
|
| > No, "page" and "swap" counts are not mutually exclusive.
| > Both paths call submit_bh().
| >
[snippage]
|
| Ah ... so every page to/from swap is counted in pswpin/out (as a page)
| and again in pgpgin/out as half-kilobytes :-). Incidentally, I also
| followed the third fork in this road, the one which derives the "blocks"
| read and written per device that show up in /proc/stat. Those "blocks"
| turn out to be 512 bytes long.

Do you mean this line or something else?
  disk_io: (3,0):(616296,386142,7120356,230154,3010882)

| of some high-frequency (every 15 seconds) samples of I/O data. Thanks!!

Sure, no problem.

-- 
~Randy


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

* Re: Questions about /proc/stat
  2002-04-01 23:58       ` Randy.Dunlap
@ 2002-04-02  0:51         ` M. Edward (Ed) Borasky
  0 siblings, 0 replies; 6+ messages in thread
From: M. Edward (Ed) Borasky @ 2002-04-02  0:51 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: linux-kernel

On Mon, 1 Apr 2002, Randy.Dunlap wrote:

> On Mon, 1 Apr 2002, M. Edward (Ed) Borasky wrote:
>
> | On Mon, 1 Apr 2002, Randy.Dunlap wrote:
> |
> | > Of course the basic answer is something like
> | >   Try cscope
> |
> | I can't find this -- does it come with Red Hat??
>
> it's at cscope.sf.net

OK ... I'll go grab it.

> | Ah ... so every page to/from swap is counted in pswpin/out (as a page)
> | and again in pgpgin/out as half-kilobytes :-). Incidentally, I also
> | followed the third fork in this road, the one which derives the "blocks"
> | read and written per device that show up in /proc/stat. Those "blocks"
> | turn out to be 512 bytes long.
>
> Do you mean this line or something else?
>   disk_io: (3,0):(616296,386142,7120356,230154,3010882)

Yeah ... that one. I have code that samples that every 15 seconds, as
well as everything else in /proc/stat. I was having trouble making sense
of the I/O numbers.

Q. How do you tell when a pineapple is ready to eat?
A. It picks up its knife and fork.


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

end of thread, other threads:[~2002-04-02  0:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-28 16:39 PROBLEM: OSS mixer does not work with second card Dariush Pietrzak
2002-03-28 17:18 ` Questions about /proc/stat M. Edward (Ed) Borasky
2002-04-01 23:14   ` Randy.Dunlap
2002-04-01 23:44     ` M. Edward (Ed) Borasky
2002-04-01 23:58       ` Randy.Dunlap
2002-04-02  0:51         ` M. Edward (Ed) Borasky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®