[PATCH] remove hardware metering

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] remove hardware metering

Lee Revell
I've asked several times on this list what hardware metering is supposed
to do in JACK (currently it's a NOOP) and didn't get a response.  Here's
a patch to remove it.  Compile tested.

Lee

--- drivers/alsa/alsa_driver.c~ 2005-11-07 11:55:57.000000000 -0500
+++ drivers/alsa/alsa_driver.c 2005-11-07 12:06:25.000000000 -0500
@@ -167,8 +167,7 @@
 }
 
 static int
-alsa_driver_hw_specific (alsa_driver_t *driver, int hw_monitoring,
- int hw_metering)
+alsa_driver_hw_specific (alsa_driver_t *driver, int hw_monitoring)
 {
  int err;
 
@@ -210,14 +209,6 @@
  driver->has_clock_sync_reporting = FALSE;
  }
 
- if (driver->hw->capabilities & Cap_HardwareMetering) {
- driver->has_hw_metering = TRUE;
- driver->hw_metering = hw_metering;
- } else {
- driver->has_hw_metering = FALSE;
- driver->hw_metering = FALSE;
- }
-
  return 0;
 }
 
@@ -1925,7 +1916,6 @@
  jack_nframes_t user_nperiods,
  jack_nframes_t rate,
  int hw_monitoring,
- int hw_metering,
  int capturing,
  int playing,
  DitherAlgorithm dither,
@@ -1949,7 +1939,6 @@
  frames_per_cycle, user_nperiods, rate,
  user_capture_nchnls,user_playback_nchnls,
  hw_monitoring ? "hwmon": "nomon",
- hw_metering ? "hwmeter":"swmeter",
  soft_mode ? "soft-mode":"-",
  shorts_first ? "16bit":"32bit");
 
@@ -2019,7 +2008,7 @@
  return NULL;
  }
 
- alsa_driver_hw_specific (driver, hw_monitoring, hw_metering);
+ alsa_driver_hw_specific (driver, hw_monitoring);
 
  if (playing) {
  if (snd_pcm_open (&driver->playback_handle,
@@ -2351,14 +2340,6 @@
  strcpy (params[i].long_desc, params[i].short_desc);
 
  i++;
- strcpy (params[i].name, "hwmeter");
- params[i].character  = 'M';
- params[i].type       = JackDriverParamBool;
- params[i].value.i    = 0;
- strcpy (params[i].short_desc, "Hardware metering, if available");
- strcpy (params[i].long_desc, params[i].short_desc);
-
- i++;
  strcpy (params[i].name, "duplex");
  params[i].character  = 'D';
  params[i].type       = JackDriverParamBool;
@@ -2453,7 +2434,6 @@
  char *playback_pcm_name = "hw:0";
  char *capture_pcm_name = "hw:0";
  int hw_monitoring = FALSE;
- int hw_metering = FALSE;
  int capture = FALSE;
  int playback = FALSE;
  int soft_mode = FALSE;
@@ -2504,10 +2484,6 @@
  monitor = param->value.i;
  break;
 
- case 'M':
- hw_metering = param->value.i;
- break;
-
  case 'r':
         srate = param->value.ui;
  fprintf (stderr, "apparent rate = %d\n", srate);
@@ -2565,7 +2541,7 @@
  capture_pcm_name, client,
  frames_per_interrupt,
  user_nperiods, srate, hw_monitoring,
- hw_metering, capture, playback, dither,
+ capture, playback, dither,
  soft_mode, monitor,
  user_capture_nchnls, user_playback_nchnls,
  shorts_first,

--- drivers/alsa/alsa_driver.h~ 2005-03-16 16:19:31.000000000 -0500
+++ drivers/alsa/alsa_driver.h 2005-11-07 12:06:44.000000000 -0500
@@ -110,7 +110,6 @@
 
     char   soft_mode : 1;
     char   hw_monitoring : 1;
-    char   hw_metering : 1;
     char   all_monitor_in : 1;
     char   capture_and_playback_not_synced : 1;
     char   playback_interleaved : 1;
@@ -130,7 +129,6 @@
     unsigned long next_clock_sync_listener_id;
     char has_clock_sync_reporting : 1;
     char has_hw_monitoring : 1;
-    char has_hw_metering : 1;
 
     int running;
     int run;




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] remove hardware metering

Florian Paul Schmidt-2
On Mon, 07 Nov 2005 12:10:34 -0500
Lee Revell <[hidden email]> wrote:

> I've asked several times on this list what hardware metering is supposed
> to do in JACK (currently it's a NOOP) and didn't get a response.  Here's
> a patch to remove it.  Compile tested.

Hi,

sorry, i didn't see your original inquiries, but "hw monitoring" is
basically exposing some soundcard mixer functionality through the jackd
api.

hw monitoring means that one can direct monitor a signal source without
the additional delay produced by running through the AD -> DA
conversion. This is of course done by routing the input signal in the
analog part of the soundcard mixer to some output, as this completely
bypasses DA/AD.

It is inspired by similar functionality on mac and windows DAW's i
think. It's simply a convenience functionality so one doesn't have to
fiddle with the soundcard mixer (which is a seperate program from the
DAW).

About the status in jackd - i don't really know. I thought it was
implemented for i.e. RME cards. Paul?

This also leads to some other problem: jackd always tried to open a ctl
device by the same name as the pcm. But with hw monitoring disabled this
isn't needed at all. It rather does some harm as it makes pointing jack
to self defined pcm devices difficult as it issues a (to a new user)
mysterious error message if there's no ctl device defined with the same
name.

Regards,
Flo

--
Palimm Palimm!
http://tapas.affenbande.org


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] remove hardware metering

Lee Revell
On Mon, 2005-11-07 at 23:03 +0100, Florian Schmidt wrote:

> On Mon, 07 Nov 2005 12:10:34 -0500
> Lee Revell <[hidden email]> wrote:
>
> > I've asked several times on this list what hardware metering is supposed
> > to do in JACK (currently it's a NOOP) and didn't get a response.  Here's
> > a patch to remove it.  Compile tested.
>
> Hi,
>
> sorry, i didn't see your original inquiries, but "hw monitoring" is
> basically exposing some soundcard mixer functionality through the jackd
> api.

You are confusing hardware monitoring (which is implemented, and useful)
with hardware metering, which does not do anything at all - note how
small the patch to completely remove it is...

Lee



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] remove hardware metering

Florian Paul Schmidt-2
On Mon, 07 Nov 2005 17:12:31 -0500
Lee Revell <[hidden email]> wrote:

> > sorry, i didn't see your original inquiries, but "hw monitoring" is
> > basically exposing some soundcard mixer functionality through the jackd
> > api.
>
> You are confusing hardware monitoring (which is implemented, and useful)
> with hardware metering, which does not do anything at all - note how
> small the patch to completely remove it is...

Oh, you are, of course, right. My bad. HW metering is something in the
same vein though afaics. Basically the soundcard provides metering (for
inputs and outputs), so the DAW doesn't have to waste cycles on it.

I have no idea though about the interface which is used for it and as
you note it seems to be a noop in jackd, one can probably eliminate it
from the source.

Flo

--
Palimm Palimm!
http://tapas.affenbande.org


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] remove hardware metering

Fons Adriaensen
On Mon, Nov 07, 2005 at 11:25:57PM +0100, Florian Schmidt wrote:

> Oh, you are, of course, right. My bad. HW metering is something in the
> same vein though afaics. Basically the soundcard provides metering (for
> inputs and outputs), so the DAW doesn't have to waste cycles on it.
>
> I have no idea though about the interface which is used for it and as
> you note it seems to be a noop in jackd, one can probably eliminate it
> from the source.

Are there any cards that provide this ? It would make sense, as (correct)
metering is not a trivial thing to do in software (e.g. to exactly
represent the analog waveform's peaks, you have to interpolate them
from the samples).

--
FA


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] remove hardware metering

Jack O'Quin-2
fons adriaensen <[hidden email]> writes:

> On Mon, Nov 07, 2005 at 11:25:57PM +0100, Florian Schmidt wrote:
>
>> Oh, you are, of course, right. My bad. HW metering is something in the
>> same vein though afaics. Basically the soundcard provides metering (for
>> inputs and outputs), so the DAW doesn't have to waste cycles on it.
>>
>> I have no idea though about the interface which is used for it and as
>> you note it seems to be a noop in jackd, one can probably eliminate it
>> from the source.
>
> Are there any cards that provide this ? It would make sense, as (correct)
> metering is not a trivial thing to do in software (e.g. to exactly
> represent the analog waveform's peaks, you have to interpolate them
> from the samples).

Let's make sure we never want to implement this before removing it.
--
  joq


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] remove hardware metering

LGTrader
In reply to this post by Florian Paul Schmidt-2
On 11/7/05, Florian Schmidt <[hidden email]> wrote:

> On Mon, 07 Nov 2005 17:12:31 -0500
> Lee Revell <[hidden email]> wrote:
>
> > > sorry, i didn't see your original inquiries, but "hw monitoring" is
> > > basically exposing some soundcard mixer functionality through the jackd
> > > api.
> >
> > You are confusing hardware monitoring (which is implemented, and useful)
> > with hardware metering, which does not do anything at all - note how
> > small the patch to completely remove it is...
>
> Oh, you are, of course, right. My bad. HW metering is something in the
> same vein though afaics. Basically the soundcard provides metering (for
> inputs and outputs), so the DAW doesn't have to waste cycles on it.
>
> I have no idea though about the interface which is used for it and as
> you note it seems to be a noop in jackd, one can probably eliminate it
> from the source.
>
> Flo
>

Hi,
   Silly of me to insert myself here, but I understood from long
conversations with Thomas Charbonnel many moons ago that hdspmixer
uses values calculated in the HDSP9652 to do the display of the both
peaks and RMS values that are displayed real time. I remember this
vividly since we had really bad results originally and it amonted to
he and I discovering through trial and error which registers to read
to get correct results.

   When I first read Lee's message today I was suprised to hear that
maybe these features were not using these registers?

   Maybe I'm completely off base, but I think this is in the area you
were asking about Florian.

Cheers,
Mark

Only 4 days to Guitar Center's Green Tag sale....


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] remove hardware metering

LGTrader
On 11/7/05, Mark Knecht <[hidden email]> wrote:

> On 11/7/05, Florian Schmidt <[hidden email]> wrote:
> > On Mon, 07 Nov 2005 17:12:31 -0500
> > Lee Revell <[hidden email]> wrote:
> >
> > > > sorry, i didn't see your original inquiries, but "hw monitoring" is
> > > > basically exposing some soundcard mixer functionality through the jackd
> > > > api.
> > >
> > > You are confusing hardware monitoring (which is implemented, and useful)
> > > with hardware metering, which does not do anything at all - note how
> > > small the patch to completely remove it is...
> >
> > Oh, you are, of course, right. My bad. HW metering is something in the
> > same vein though afaics. Basically the soundcard provides metering (for
> > inputs and outputs), so the DAW doesn't have to waste cycles on it.
> >
> > I have no idea though about the interface which is used for it and as
> > you note it seems to be a noop in jackd, one can probably eliminate it
> > from the source.
> >
> > Flo
> >
>
> Hi,
>    Silly of me to insert myself here, but I understood from long
> conversations with Thomas Charbonnel many moons ago that hdspmixer
> uses values calculated in the HDSP9652 to do the display of the both
> peaks and RMS values that are displayed real time. I remember this
> vividly since we had really bad results originally and it amonted to
> he and I discovering through trial and error which registers to read
> to get correct results.
>
>    When I first read Lee's message today I was suprised to hear that
> maybe these features were not using these registers?
>
>    Maybe I'm completely off base, but I think this is in the area you
> were asking about Florian.
>
> Cheers,
> Mark
>
> Only 4 days to Guitar Center's Green Tag sale....
>

Of course the current hdspmixer is not a Jack app so none of this matters.....

- Mark


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] remove hardware metering

Lee Revell
In reply to this post by Jack O'Quin-2
On Mon, 2005-11-07 at 17:31 -0600, Jack O'Quin wrote:
> Let's make sure we never want to implement this before removing it.

Heh, my intention was not to have it removed - I just wanted someone to
tell me what it's for.  I read a kerneltrap.org interview with Andrew
Morton where he said the best way to get a festering problem fixed is to
post a totally bogus patch to "fix" it.  It worked perfectly.

Lee



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] remove hardware metering

Lee Revell
In reply to this post by Fons Adriaensen
On Mon, 2005-11-07 at 23:38 +0100, fons adriaensen wrote:

> On Mon, Nov 07, 2005 at 11:25:57PM +0100, Florian Schmidt wrote:
>
> > Oh, you are, of course, right. My bad. HW metering is something in the
> > same vein though afaics. Basically the soundcard provides metering (for
> > inputs and outputs), so the DAW doesn't have to waste cycles on it.
> >
> > I have no idea though about the interface which is used for it and as
> > you note it seems to be a noop in jackd, one can probably eliminate it
> > from the source.
>
> Are there any cards that provide this ? It would make sense, as (correct)
> metering is not a trivial thing to do in software (e.g. to exactly
> represent the analog waveform's peaks, you have to interpolate them
> from the samples).
>

Yes, even the emu10k1 can do this in hardware (monitoring too).  But
without a reference implementation I have no idea where to even start.

Lee



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] remove hardware metering

Paul Davis
On Wed, 2005-11-09 at 17:46 -0500, Lee Revell wrote:

> On Mon, 2005-11-07 at 23:38 +0100, fons adriaensen wrote:
> > On Mon, Nov 07, 2005 at 11:25:57PM +0100, Florian Schmidt wrote:
> >
> > > Oh, you are, of course, right. My bad. HW metering is something in the
> > > same vein though afaics. Basically the soundcard provides metering (for
> > > inputs and outputs), so the DAW doesn't have to waste cycles on it.
> > >
> > > I have no idea though about the interface which is used for it and as
> > > you note it seems to be a noop in jackd, one can probably eliminate it
> > > from the source.
> >
> > Are there any cards that provide this ? It would make sense, as (correct)
> > metering is not a trivial thing to do in software (e.g. to exactly
> > represent the analog waveform's peaks, you have to interpolate them
> > from the samples).
> >
>
> Yes, even the emu10k1 can do this in hardware (monitoring too).  But
> without a reference implementation I have no idea where to even start.

don't even start.

it is more or less useless. there are hardly any JACK clients that need
to meter the data delivered to/from the actual h/w ports. i don't see
any real justification for adding it to the API; it was an experiment
that revealed itself (to me, anyway) to be a mistake.



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel