Re: input/output sound level calibration



Bob Masta wrote:


Alain, a big problem is likely to be the mixer settings. Does
your program control them?
Yes it does at the very start and all along the running,
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!

!!!


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,
The same. Alain

.



Relevant Pages

  • (Not) Echoing Input in Secondary DOS Windows
    ... windows, something is not being done to make ... void gotoXY(int X, int Y); ... // source screen buffer ...
    (microsoft.public.vc.language)
  • Problem with the JIT-Compiler of .NET3.5SP1
    ... Version 2.0.50727.3521 which is included in Windows 7 Beta but there is still ... void ExtractCommonData() ... int ExtractInt() ... void CParentClass::setbit(unsigned char nr, BYTE *xconf) ...
    (microsoft.public.dotnet.framework.clr)
  • Re: SendMessage problem
    ... > void CxxxDlg::OnButton1 ... > void CxxxDlg::OnSize(UINT nType, int cx, int cy) ... You should not send it other windows yourself. ... use functions like MoveWindow and SetWindowPos to change window sizes. ...
    (microsoft.public.vc.mfc)
  • Re: Cant figure this out
    ... agenthunt@netcourrier.com (Jeff) wrote in news:6c79eab5.0311180700.75725fb8 ... > int main (void) ... > compiled using GCC under cygwin, on a windows 98 machine. ...
    (comp.lang.c)
  • Help in Java swings(internal Frame)
    ... public int getSize() ... public void valueChanged{ ... private JScrollPane scrollPane1; ... public class PeakContainer extends JInternalFrame ...
    (comp.lang.java.programmer)