[alsa-devel] reading peak meter values from a RME HDSP madi soundcard
ListsAccount
lists at s201431494.online.de
Fri Mar 14 15:16:11 CET 2008
Hi,
I'd like to read the peak values of the RME HDSP madi soundcard. To do
this, I use the function: snd_hwdep_ioctl() with the ioctl command
"SNDRV_HDSPM_IOCTL_GET_PEAK_RMS".
I use the following code:
// create container
hdspm_peak_rms_t madi_peak_rms;
hdspm_peak_rms_t* ptr_madi_peak_rms = &madi_peak_rms;
//snd_hwdep_open
...
// fill the container with values
snd_hwdep_ioctl(hw,
SNDRV_HDSPM_IOCTL_GET_PEAK_RMS,
(void *)&ptr_madi_peak_rms);
for (unsigned int chn = 0; chn < numberOfChannels; ++chn)
{
//put values from madi soundcard into std::vector containers
currentInputPeak[chn] = madi_peak_rms.level_offset[chn];
currentPlaybackPeak[chn] = madi_peak_rms.level_offset[chn+64];
currentOutputPeak[chn] = madi_peak_rms.level_offset[chn+128];
}
The upper 24 bit of the read out values should be the signal peak. The
next 8 bit seem to represent a clipping counter.
For the first eight input channels this works pretty well. But for every
eighth channel of all further channels (input, playback and output) the
peak value is to low and is not in time with the other channels.
Do i use the function in the right way?
Is there a special function to get the peak meter values? (In a similar
way as for ADAT soundcards?)
Best regards.
More information about the Alsa-devel
mailing list