Skip to contentSkip to conversation

help for a levelmeter

DISCUSSION Laurent Georget 5 participants 10 messages Oct 15, 2002 – Oct 18, 2002

lore
Share & tools
lore
#0 lore raw

Hello,

I 'd like to make a levelmeter program which would display sound card input/output
while the audio device is opened by another program. I tried to use copy plugin , but now (since 0.9.0rc3 ) the "snd_pcm_copy_open" give a "implicit declaration of function"
message . (Anyway, i don't know if using this plugin was correct for that purpose)

So, would you know a way to read audio data going to (or coming from) the device , when it is opened by another program ?

Thanks for any help!

Laurent

-------------------------------------------------------
This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us.
http://ad.doubleclick.net/clk;4749864;7604308;v?http://www.viaverio.com/
consolidator/osdn.cfm

#1 lore raw

Laurent Georget:

Quoted 10 lines

Hello,

I 'd like to make a levelmeter program which would display sound card
input/output
while the audio device is opened by another program. I tried to use copy
plugin , but now (since 0.9.0rc3 ) the "snd_pcm_copy_open" give a "implicit declaration of function"

hmm, it is still declared in
alsa-lib/include/pcm_plugin.h ...?

Quoted 11 lines

message . (Anyway, i don't know if using this plugin was correct for
that purpose)

So, would you know a way to read audio data going to (or coming from)
the device , when it is opened by another program ?

Thanks for any help!

Laurent

(there is a jack meter client @
http://plugin.org.uk/meterbridge/)

regards, karsten

__________________________________________________________________

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Möchten Sie mit einem Gruß antworten? http://grusskarten.yahoo.de

-------------------------------------------------------
This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us.
http://ad.doubleclick.net/clk;4749864;7604308;v?
http://www.viaverio.com/consolidator/osdn.cfm

#2 lore raw
Quoted 13 lines · karsten wiese

Laurent Georget:

Quoted 10 lines

Hello,

I 'd like to make a levelmeter program which would display sound card
input/output
while the audio device is opened by another program. I tried to use copy
plugin , but now (since 0.9.0rc3 ) the "snd_pcm_copy_open" give a "implicit declaration of function"

Quoted 3 lines

hmm, it is still declared in
alsa-lib/include/pcm_plugin.h ...?

Hmm.. my fault, just have to include pcm_plugin.h

Quoted 7 lines

(there is a jack meter client @
http://plugin.org.uk/meterbridge/)

regards, karsten

Thanks for responding!

Ok , I have seen it , but it works with jack compatible programs, and the levelmeter i'm aiming at should work with Glame , as an example .

Anyway I can now try to experiment the copy_plugin : would you know some program using this plugin, which would make the thing easier !

Thanks again

Laurent

-------------------------------------------------------
This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us.
http://ad.doubleclick.net/clk;4749864;7604308;v?
http://www.viaverio.com/consolidator/osdn.cfm

#3 lore raw
Quoted 31 lines · Laurent Georget
Quoted 13 lines · karsten wiese

Laurent Georget:

Quoted 10 lines

Hello,

I 'd like to make a levelmeter program which would display sound card
input/output
while the audio device is opened by another program. I tried to use copy
plugin , but now (since 0.9.0rc3 ) the "snd_pcm_copy_open" give a "implicit declaration of function"

Quoted 3 lines

hmm, it is still declared in
alsa-lib/include/pcm_plugin.h ...?

Hmm.. my fault, just have to include pcm_plugin.h

Quoted 7 lines

(there is a jack meter client @
http://plugin.org.uk/meterbridge/)

regards, karsten

Thanks for responding!

Quoted 8 lines

Ok , I have seen it , but it works with jack compatible programs, and the levelmeter
i'm aiming at should work with Glame , as an example .

Anyway I can now try to experiment the copy_plugin : would you know some program using
this plugin, which would make the thing easier !

The correct plugin has already been written and available inside alsa-lib.

The name is pcm_meter, it's lockless and perfectly integrated with ALSA PCM chains.

A sample implementation for curses level meter is already available and working.

It's very simple to add other *-meters, scopes, etc.

Signature · 12 lines
Abramo Bagnara                       mailto:[email protected]

Opera Unica                          Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy


-------------------------------------------------------
This sf.net email is sponsored by: viaVerio will pay you up to
$1,000 for every account that you consolidate with us.
http://ad.doubleclick.net/clk;4749864;7604308;v?
http://www.viaverio.com/consolidator/osdn.cfm
#4 lore raw
Quoted 10 lines · Abramo Bagnara

The correct plugin has already been written and available inside alsa-lib.

The name is pcm_meter, it's lockless and perfectly integrated with ALSA PCM chains.

A sample implementation for curses level meter is already available and working.

It's very simple to add other *-meters, scopes, etc.

That's great!

Is there any user-level documentation for all this cool stuff?

Signature · 10 lines
  Jack O'Quin
  Austin, Texas, USA



-------------------------------------------------------
This sf.net email is sponsored by: viaVerio will pay you up to
$1,000 for every account that you consolidate with us.
http://ad.doubleclick.net/clk;4749864;7604308;v?
http://www.viaverio.com/consolidator/osdn.cfm
#5 lore raw
Quoted 12 lines · Jack O'Quin
Quoted 9 lines · Abramo Bagnara

The correct plugin has already been written and available inside alsa-lib.

The name is pcm_meter, it's lockless and perfectly integrated with ALSA PCM chains.

A sample implementation for curses level meter is already available and working.

Quoted 6 lines
Quoted 1 line

It's very simple to add other *-meters, scopes, etc.

That's great!

Is there any user-level documentation for all this cool stuff?

ha :p

Signature · 18 lines
Patrick Shirkey - Boost Hardware Ltd.
For the discerning hardware connoisseur
Http://www.boosthardware.com
Http://www.djcj.org - The Linux Audio Users guide
========================================

"Um...symbol_get and symbol_put... They're
kindof like does anyone remember like get_symbol
and put_symbol I think we used to have..."
- Rusty Russell in his talk on the module subsystem



-------------------------------------------------------
This sf.net email is sponsored by: viaVerio will pay you up to
$1,000 for every account that you consolidate with us.
http://ad.doubleclick.net/clk;4749864;7604308;v?
http://www.viaverio.com/consolidator/osdn.cfm
#6 lore raw
In reply to Jack O'Quin
Quoted 9 lines · Jack O'Quin
Quoted 6 lines · Abramo Bagnara

The correct plugin has already been written and available inside alsa-lib.

The name is pcm_meter, it's lockless and perfectly integrated with ALSA PCM chains.

Quoted 8 lines
Quoted 4 lines

A sample implementation for curses level meter is already available and working.

It's very simple to add other *-meters, scopes, etc.

That's great!

Is there any user-level documentation for all this cool stuff?

Ehm... guess what...

No, wait: I wrote some lines in asoundrc.txt:

type meter # Meter PCM
slave STR # Slave name (see pcm_slave)

  # or
  slave {               # Slave definition or name
    pcm STR             # Slave PCM name
    # or
    pcm { }             # Slave PCM definition
  }
  [frequency INT]       # Updates per second
  scopes {              # Scopes
    ID STR              # Scope name (see pcm_scope)
  # or
    ID { }              # Scope definition (see pcm_scope)
  }

# PCM scope type definition
pcm_scope_type.NAME {
[lib STR] # Library file (default libasound.so)
[open STR] # Open function (default
_snd_pcm_scope_NAME_open)
}

# PCM scope definition
pcm_scope.NAME {
type STR # Scope type
...
}

The rest is obvious, of course ;-)))

Signature · 12 lines
Abramo Bagnara                       mailto:[email protected]

Opera Unica                          Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy


-------------------------------------------------------
This sf.net email is sponsored by: viaVerio will pay you up to
$1,000 for every account that you consolidate with us.
http://ad.doubleclick.net/clk;4749864;7604308;v?
http://www.viaverio.com/consolidator/osdn.cfm
#7 lore raw
Quoted 47 lines · Abramo Bagnara
Quoted 9 lines · Jack O'Quin
Quoted 6 lines · Abramo Bagnara

The correct plugin has already been written and available inside alsa-lib.

The name is pcm_meter, it's lockless and perfectly integrated with ALSA PCM chains.

Quoted 8 lines
Quoted 4 lines

A sample implementation for curses level meter is already available and working.

It's very simple to add other *-meters, scopes, etc.

That's great!

Is there any user-level documentation for all this cool stuff?

Ehm... guess what...

No, wait: I wrote some lines in asoundrc.txt:

type meter # Meter PCM
slave STR # Slave name (see pcm_slave)

  # or
  slave {               # Slave definition or name
    pcm STR             # Slave PCM name
    # or
    pcm { }             # Slave PCM definition
  }
  [frequency INT]       # Updates per second
  scopes {              # Scopes
    ID STR              # Scope name (see pcm_scope)
  # or
    ID { }              # Scope definition (see pcm_scope)
  }

# PCM scope type definition
pcm_scope_type.NAME {
[lib STR] # Library file (default libasound.so)
[open STR] # Open function (default
_snd_pcm_scope_NAME_open)
}

Quoted 8 lines

# PCM scope definition
pcm_scope.NAME {
type STR # Scope type
...
}

The rest is obvious, of course ;-)))

Excellent!

Well, you wrote that there is a sample implementation of this pcm_meter ,
but I can't find it (searched in alsa tools / utils , and searched with google with no good result)

Anyway, i'm going on trying to use it

Thanks

Laurent

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#8 lore raw
Quoted 9 lines · Laurent Georget

Excellent!

Well, you wrote that there is a sample implementation of this pcm_meter , but I can't find it (searched in alsa tools / utils , and searched with google with no good result)

Anyway, i'm going on trying to use it

Install alsa-driver, alsa-lib, alsa-oss. Insert (adapting it) this in your .asoundrc

pcm_scope.level {
type level
}

pcm_scope_type.level {
lib /u/cvs/alsa/alsa-lib/src/pcm/scopes/.libs/liblevel.so
}

pcm.dsp0 {
	type meter
	slave.pcm 'hw:0,0'
	scopes.0 level
}

Then try:

aplay -D dsp0 file.wav

or the more complex

aoss realplay /u/music/real/music.rm

and you'll see amazing things ;-)

Signature · 11 lines
Abramo Bagnara                       mailto:[email protected]

Opera Unica                          Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
#9 lore raw
Quoted 32 lines · Abramo Bagnara
Quoted 8 lines · Laurent Georget

Excellent!

Well, you wrote that there is a sample implementation of this pcm_meter , but I can't find it (searched in alsa tools / utils , and searched with google with no good result)

Anyway, i'm going on trying to use it

Install alsa-driver, alsa-lib, alsa-oss.
Insert (adapting it) this in your .asoundrc

pcm_scope.level {
type level
}

pcm_scope_type.level {
lib /u/cvs/alsa/alsa-lib/src/pcm/scopes/.libs/liblevel.so
}

pcm.dsp0 {
	type meter
	slave.pcm 'hw:0,0'
	scopes.0 level
}

Then try:

Quoted 9 lines

aplay -D dsp0 file.wav

or the more complex

aoss realplay /u/music/real/music.rm

and you'll see amazing things ;-)

Wow! I got both working !
(give me a bad point for not searching cvs ;)

Now, i can try to make the levelmeter I'm aiming at ( it would be a gtk app. ), with no guarantee about the result (given my low programming skills)

Thanks a lot

Laurent

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf