Re: input/output sound level calibration
- From: Celer <card.lemoine@xxxxxxxxxx>
- Date: Thu, 09 Mar 2006 19:47:48 +0100
Bob Masta wrote:
Alain, a big problem is likely to be the mixer settings. DoesYes it does at the very start and all along the running,
your program control them?
It's quite easy (if I understand the question well) with unix "special
files" and the OSS API ; below is an exerpt of the code to see the "ioctl"
function in action.
/** Fichier : sound_mix.c -------------------------------------
Inialisation et configuration mixer de la carte son
----------------------------------------------------------- */
#include ...
....
void
sound_mix_apparatus (void)
{
unsigned int nver;
unsigned int mask;
....
if ((mixer_fd = open ("/dev/mixer", O_RDWR)) < 0)
printf ("Impossible d'ouvrir le mélangeur"),
exit (EXIT_FAILURE);
if (ioctl (mixer_fd, OSS_GETVERSION, &nver) == -1)
printf (" : Erreur obtention numéro version\n"), exit (EXIT_FAILURE);
....
mask = SOUND_MASK_MIC + SOUND_MASK_LINE;
if (ioctl (mixer_fd, SOUND_MIXER_WRITE_RECSRC, &mask) == -1)
printf (" : Erreur passage Micro en enregistrement\n"),
exit (EXIT_FAILURE);
....
}
void
sound_mix_purgatio (void)
{
close (mixer_fd);
mixer_fd = -1;
....
}
int /** Tous les volumes à zéro */
sound_mix_off ()
{
char *dev_names[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES;
unsigned int i;
magnitudo = MAGNITUDO (NIHIL_ADITUS);
dev_names[0] = 0; /* juste pour l'avertissement */
for (i = 0; i < SOUND_MIXER_NRDEVICES; i++)
{
if ((ioctl (mixer_fd, MIXER_WRITE (i), &magnitudo) == -1))
{
....
}
else
{
....
}
}
....
}
void
sound_mix_set_ampl (int dev, int value)
{
magnitudo = MAGNITUDO (magnitudo);
if ((ioctl (mixer_fd, MIXER_WRITE (dev), &magnitudo) == -1))
printf (" - Pb MIXER_WRITE sur %d\n", dev);
else
{
....
}
}
gboolean /* Recuperation de la valeur de la barre d'échelle */
sound_mix_reg_ampl (GtkWidget * W, gpointer data)
{
magnitudo = (int) gtk_range_get_value (GTK_RANGE (W));
sound_mix_set_ampl (GPOINTER_TO_INT (data), magnitudo);
return TRUE;
}
....
int
sound_mix_get_ampl (int dev)
{
int value = config_param_lecture (sound_mix_set_path (dev));
return value;
}
The important thing is that the
settings be constant between the calibration session and the
actual measurements. Unfortunately, you can't use the
standard Windows pop-up mixer since it doesn't show the
actual working steps of the mixer.
I'm sorry I know nothing about Window and the way to speak to their
drivers ; I'd like but life is too short to ... ;-)
The only way to get
repeatable settings with that would be to force everything
to maximum:
By the way what is the max level on MIC and LINE inputs ?
Sliders full up, and full left. If you try to set
anything in between, you might be just above or just
below the slider position which causes the actual attenuator
to step. You would have to have some provision to make
sure that the mixer wasn't touched between sessions, or
you would never be sure you had reset it the same.
Sliders should be controlled by some param in a console command line like :
my_mixer \l 180 \... In fact you could develop a kind of utility program in
order to control the mixer by command in a dos window, or desactivate most
of the stuff while runnig the calibration command under window gui.
If your program doesn't control the mixer directly, and
you are thinking about adding that, the best I can
say is "buy plenty of aspirin". The Mixer API is the
worst, most incomprehensible mess in all of Windows!
!!!
The same. Alain
As for microphone calibrations, there is no easy way
around the need for a calibrated reference mic.
Daqarta for Windows will allow you to calibrate a cheap
mic from a (borrowed) reference mic, but you still need
to get your hands on one at least for a while.
Best regards,
.
- Follow-Ups:
- Re: input/output sound level calibration
- From: Bob Masta
- Re: input/output sound level calibration
- References:
- input/output sound level calibration
- From: Celer
- Re: input/output sound level calibration
- From: Bob Masta
- Re: input/output sound level calibration
- From: Celer
- Re: input/output sound level calibration
- From: Bob Masta
- input/output sound level calibration
- Prev by Date: Re: input/output sound level calibration
- Next by Date: Re: input/output sound level calibration
- Previous by thread: Re: input/output sound level calibration
- Next by thread: Re: input/output sound level calibration
- Index(es):
Relevant Pages
|