Re: audio recording levels

2010-06-17 Thread Daniel Gracia
I have worked with audio before, and can confirm internal audio codecs 
are very good for... trash them.


If quality is of any concern for you, just try another adapter, i.e. an 
inexpensive Behringer UCA 202 USB audio interface.


I've tried it with great results on OpenBSD, and you can buy it in 
Europe for as low as 27eur in Thomann.


Regards, and good luck.

I've a PMR/O

El 16/06/2010 15:05, Paul M escribis:

On 16/06/2010, at 6:45 PM, Alexandre Ratchov wrote:


On Wed, Jun 16, 2010 at 12:06:40AM +1200, Paul M wrote:

On 15/06/2010, at 11:18 PM, Paul M wrote:


On 15/06/2010, at 8:25 PM, Alexandre Ratchov wrote:


On Mon, Jun 14, 2010 at 08:20:57AM -0600, Ted Roby wrote:


Sound cards just get too much noise off the motherboard.


well, it depends on the sound card; properly engineered
cards don't get noise, including pci ones.


It seems the best I can get with the built-in sound on this computer
is about 36dB S/N. If the various input gain stages are not set quite


Sorry, that's a typo - should be -46 dB



that's not very good; 8-bit samples correspond to 48dB; I
mean with 48dB S/N, only 8 higher bits are significant.

Such a low S/N ratio makes me wonder if your cables, power
supply or whatever are ok.

BTW, how did you measure the S/N ratio?


No, it's not.

I measured by writing samples to a file then examining the file.
For a source, I used a 440 Hz sine wave.
With all the input gains set to minimum, the noise was negligible
( -60 db, which is the smallest I could measure). This is pretty much
just the noise of the chip itself.

I then tweaked the various input levels (preamp, input stage, adc) till
the output of the preamp was just below clipping of the first input
stage, and the samples in the file were also just below clipping.
This gave me my signal level.
Then I disconnected the input and repeated, this gave me my noise -
shorting the input may give better results.

I repeated this over and over to find the best balance between input
stage gain and adc gain. I found the best result was to set the input
stage as low as possible, and adjust the adc gain to give full output.
(dont forget the input signal is as high as it can be without clipping)

Update: Today I reduced the input gain stage to 0 (I didnt try this
yesterday) and got about another 6-8 dB, so now I'm  50 dB.
Jacob mentioned in and earlier mail that '0' for the input stages on
this codec is 0dB gain. FWIW the adc gain is set to 96 (+12dB).

Since my moise is measured with no input connected, this rules out
any external problems such as cables.
The power supply in the computer may be moisy, but I would guess
that crappy circuit layout is more likely. (though I will try another
power supply some time and see if it helps)


paulm




Re: audio recording levels

2010-06-16 Thread Alexandre Ratchov
On Tue, Jun 15, 2010 at 10:46:47AM +0200, Jan Stary wrote:
   Sound cards just get too much noise off the motherboard.
  
  well, it depends on the sound card; properly engineered
  cards don't get noise, including pci ones.
 
 Are some of them known to be better then others in this respect?

any card that claims 100dB S/N should be ok, assuming the
vendor is not lying. I've a m-audio delta 1010lt, and a esi
julia that don't get noise while they are plugged on a
machine I use as a wireless access point (which btw is
probably the most stupid setup).

-- Alexandre



Re: audio recording levels

2010-06-16 Thread Alexandre Ratchov
On Wed, Jun 16, 2010 at 12:06:40AM +1200, Paul M wrote:
 On 15/06/2010, at 11:18 PM, Paul M wrote:
 
 On 15/06/2010, at 8:25 PM, Alexandre Ratchov wrote:
 
 On Mon, Jun 14, 2010 at 08:20:57AM -0600, Ted Roby wrote:
 
 Sound cards just get too much noise off the motherboard.
 
 well, it depends on the sound card; properly engineered
 cards don't get noise, including pci ones.
 
 It seems the best I can get with the built-in sound on this computer
 is about 36dB S/N. If the various input gain stages are not set quite
 
 Sorry, that's a typo - should be -46 dB
 

that's not very good; 8-bit samples correspond to 48dB; I
mean with 48dB S/N, only 8 higher bits are significant.

Such a low S/N ratio makes me wonder if your cables, power
supply or whatever are ok.

BTW, how did you measure the S/N ratio?

-- Alexandre



Re: audio recording levels

2010-06-16 Thread Paul M

On 16/06/2010, at 6:45 PM, Alexandre Ratchov wrote:


On Wed, Jun 16, 2010 at 12:06:40AM +1200, Paul M wrote:

On 15/06/2010, at 11:18 PM, Paul M wrote:


On 15/06/2010, at 8:25 PM, Alexandre Ratchov wrote:


On Mon, Jun 14, 2010 at 08:20:57AM -0600, Ted Roby wrote:


Sound cards just get too much noise off the motherboard.


well, it depends on the sound card; properly engineered
cards don't get noise, including pci ones.


It seems the best I can get with the built-in sound on this computer
is about 36dB S/N. If the various input gain stages are not set quite


Sorry, that's a typo - should be -46 dB



that's not very good; 8-bit samples correspond to 48dB; I
mean with 48dB S/N, only 8 higher bits are significant.

Such a low S/N ratio makes me wonder if your cables, power
supply or whatever are ok.

BTW, how did you measure the S/N ratio?


No, it's not.

I measured by writing samples to a file then examining the file.
For a source, I used a 440 Hz sine wave.
With all the input gains set to minimum, the noise was negligible
( -60 db, which is the smallest I could measure). This is pretty much
just the noise of the chip itself.

I then tweaked the various input levels (preamp, input stage, adc) till
the output of the preamp was just below clipping of the first input
stage, and the samples in the file were also just below clipping.
This gave me my signal level.
Then I disconnected the input and repeated, this gave me my noise -
shorting the input may give better results.

I repeated this over and over to find the best balance between input
stage gain and adc gain. I found the best result was to set the input
stage as low as possible, and adjust the adc gain to give full output.
(dont forget the input signal is as high as it can be without clipping)

Update: Today I reduced the input gain stage to 0 (I didnt try this
yesterday) and got about another 6-8 dB, so now I'm  50 dB.
Jacob mentioned in and earlier mail that '0' for the input stages on
this codec is 0dB gain. FWIW the adc gain is set to 96 (+12dB).

Since my moise is measured with no input connected, this rules out
any external problems such as cables.
The power supply in the computer may be moisy, but I would guess
that crappy circuit layout is more likely. (though I will try another
power supply some time and see if it helps)


paulm



Re: audio recording levels

2010-06-15 Thread Alexandre Ratchov
On Mon, Jun 14, 2010 at 08:20:57AM -0600, Ted Roby wrote:
 
 Sound cards just get too much noise off the motherboard.

well, it depends on the sound card; properly engineered
cards don't get noise, including pci ones.

-- Alexandre



Re: audio recording levels

2010-06-15 Thread Jan Stary
  Sound cards just get too much noise off the motherboard.
 
 well, it depends on the sound card; properly engineered
 cards don't get noise, including pci ones.

Are some of them known to be better then others in this respect?



Re: audio recording levels

2010-06-15 Thread Paul M

On 15/06/2010, at 8:25 PM, Alexandre Ratchov wrote:


On Mon, Jun 14, 2010 at 08:20:57AM -0600, Ted Roby wrote:


Sound cards just get too much noise off the motherboard.


well, it depends on the sound card; properly engineered
cards don't get noise, including pci ones.


It seems the best I can get with the built-in sound on this computer
is about 36dB S/N. If the various input gain stages are not set quite
carefully, it gets much worse.
Rf pickup in the input leads is high too.


paulm



Re: audio recording levels

2010-06-15 Thread Paul M

On 15/06/2010, at 11:18 PM, Paul M wrote:


On 15/06/2010, at 8:25 PM, Alexandre Ratchov wrote:


On Mon, Jun 14, 2010 at 08:20:57AM -0600, Ted Roby wrote:


Sound cards just get too much noise off the motherboard.


well, it depends on the sound card; properly engineered
cards don't get noise, including pci ones.


It seems the best I can get with the built-in sound on this computer
is about 36dB S/N. If the various input gain stages are not set quite


Sorry, that's a typo - should be -46 dB


carefully, it gets much worse.
Rf pickup in the input leads is high too.



paulm



Re: audio recording levels

2010-06-14 Thread Jan Stary
On Jun 14 11:37:52, Paul M wrote:
 I have a large amount of analog audio I need to digitize and
 naturaly want to ensure best transfer quality. So I need to set
 the analog level at the input to the adc as high as possible
 without clipping.

It is good practice to leave a little headroom (say, 6dB)
for further processing. You might want to do some noise
reduction, compressing, whatever, and the effects will clip
if the signal already is saturated.

Also, the input to the adc is not all there is to it;
there are other mixer settings that affect the signal
that will eventually end in your file.wav

 Ideally, I'll get the workstation hardware
 set to certin defaults, then adjust the incomming audio as
 required.

There are no defaults. Your analog inputs can
(and most probably will) vary greatly.

 This leads to a couple of questions:
 Are there (typicaly) any variable gain stages in the analog input
 path in the computer.

Yes. 'mixerctl -a' will shouw you how the azalia 'widgets' are
interconnected on your codec.

 Mixerctl -av (full output below) shows a
 node called 'record.adc'. It seems reasonable that this might
 opperate on the analog input to the adc. However there is also
 'record.volume', though I would assume this operates on the mixed
 digital signals at the end of the chain.

record.volume
Amplifier gain control for widgets listed in record.volume.slaves.

 Also: a lot of the gain stages have defaults of 120.120. Would
 it be reasonable to assume that this is the 0 gain setting?

What's a 0 gain setting?

I believe Jacob Meuser has work going on to make the numbers
on the azalia knobs correspond to actual decibels,
but I don't know if it's current yet.

 bios0: ASUSTeK Computer INC. P5QPL-AM
 azalia0 at pci0 dev 27 function 0 Intel 82801GB HD Audio rev 0x01:  
 apic 2 int 21 (irq 5)
 azalia0: codecs: Realtek/0x0887
 audio0 at azalia0

It would be my guess that this is the audio chip that's integrated
with the Asus P5QPL-AM motherboard.  If you are really after best
transfer quality, you might want to use something else in the
first place.



Re: audio recording levels

2010-06-14 Thread Paul M

On 14/06/2010, at 12:49 PM, Jacob Meuser wrote:


On Mon, Jun 14, 2010 at 11:37:52AM +1200, Paul M wrote:

I have a large amount of analog audio I need to digitize and
naturaly want to ensure best transfer quality. So I need to set
the analog level at the input to the adc as high as possible
without clipping. Ideally, I'll get the workstation hardware
set to certin defaults, then adjust the incomming audio as
required.
This leads to a couple of questions:
Are there (typicaly) any variable gain stages in the analog input
path in the computer.


varies depending on hardware, but often there is a gain
at the input and a gain at the ADC.


Looking at the mixerctl output again, this does appear to be the
case.



Mixerctl -av (full output below) shows a
node called 'record.adc'. It seems reasonable that this might
opperate on the analog input to the adc


generically speaking, yes.


However there is also
'record.volume', though I would assume this operates on the mixed
digital signals at the end of the chain.


no.  record.volume is essenially an alias.  on your hardware with the
configuration you've posted, it's a shortcut for setting both
record.adc and record.adc2.  this is explained in azalia(4) (though
maybe that info didn't make it into 4.6, the info in -current azalia(4)
is mostly relevant even for 4.6).


Also: a lot of the gain stages have defaults of 120.120. Would
it be reasonable to assume that this is the 0 gain setting?


no.  unfortunately, the mixer interface, like a lot of audio(4)
related stuff, is designed for consumer usage.  so, we just have
a range that is essentially 0-100% - it has no relevance to anything
except the knob.  truly the  worst kind of knobs are those that
have no outside meaning, but apparently people like this.  *shrug*

http://marc.info/?l=openbsd-techm=123101323408867w=2


Any thoughts appreciated.


if you really want to know how to do this right, your best bet is to
find the datasheet for your codec.

now, your codec is a Realtek, which is common for azalia(4), and
I happen to know them pretty well ...


inputs.line=85,85

this is a 0 (0), 10 (85), 20 (170), 30 (255) dB gain on the line-in
jack.  values in () are the corresponding mixerctl values.


record.adc=248,248

this is the ADC input gain.  0 dB should be around '88'.
0..255 here represents the hardware's -16.5 to 30 dB
in 1.5 dB steps.

these are the only gains on the recording path of your device.



Thanks Jacob, this is gold.
I'll try and find that datasheet, but what you've given me here is
probably enough for me to work out what I need.


Thanks again, and thanks to all who worked on giving the audio
subsystem the openBSD love.

paulm



Re: audio recording levels

2010-06-14 Thread Paul M

On 14/06/2010, at 6:54 PM, Jan Stary wrote:


On Jun 14 11:37:52, Paul M wrote:

I have a large amount of analog audio I need to digitize and
naturaly want to ensure best transfer quality. So I need to set
the analog level at the input to the adc as high as possible
without clipping.


It is good practice to leave a little headroom (say, 6dB)
for further processing. You might want to do some noise
reduction, compressing, whatever, and the effects will clip
if the signal already is saturated.


I'll leave enough headroom to allow for the highest peaks, but
I'm not planning on doing any additional processing during the
initial conversion. I can attenuate the signal later if I add
any post processing.



Also, the input to the adc is not all there is to it;
there are other mixer settings that affect the signal
that will eventually end in your file.wav


Ideally, I'll get the workstation hardware
set to certin defaults, then adjust the incomming audio as
required.


There are no defaults. Your analog inputs can
(and most probably will) vary greatly.


I dont really want to futz with the audio hardware once it's set
up, so these 'defaults' would be such that a certain input signal
level will produce a clean digital file with no clipping and
good dynamic range. I'll then use a preamp with decent VU meters
to ensure the signal sent to the computer is optimal.



This leads to a couple of questions:
Are there (typicaly) any variable gain stages in the analog input
path in the computer.


Yes. 'mixerctl -a' will shouw you how the azalia 'widgets' are
interconnected on your codec.


Mixerctl -av (full output below) shows a
node called 'record.adc'. It seems reasonable that this might
opperate on the analog input to the adc. However there is also
'record.volume', though I would assume this operates on the mixed
digital signals at the end of the chain.


record.volume
Amplifier gain control for widgets listed in record.volume.slaves.


Thanks, I wondered about the slaves.



Also: a lot of the gain stages have defaults of 120.120. Would
it be reasonable to assume that this is the 0 gain setting?


What's a 0 gain setting?


Unity gain, or 0dB gain. Signal level out = signal level in (for
that stage).



I believe Jacob Meuser has work going on to make the numbers
on the azalia knobs correspond to actual decibels,
but I don't know if it's current yet.


bios0: ASUSTeK Computer INC. P5QPL-AM
azalia0 at pci0 dev 27 function 0 Intel 82801GB HD Audio rev 0x01:
apic 2 int 21 (irq 5)
azalia0: codecs: Realtek/0x0887
audio0 at azalia0


It would be my guess that this is the audio chip that's integrated
with the Asus P5QPL-AM motherboard.  If you are really after best
transfer quality, you might want to use something else in the
first place.


Good point, thanks for the reality check.
Most of what I have to do is not the best quality anyway, but that
doesn't mean I'm happy to introduce unnecessary generation loss by
being sloppy. There is some though that is very good, so that may well
need something better.


paulm



Re: audio recording levels

2010-06-14 Thread Ted Roby
On Mon, Jun 14, 2010 at 2:29 AM, Paul M l...@no-tek.com wrote:
 On 14/06/2010, at 6:54 PM, Jan Stary wrote:


 It would be my guess that this is the audio chip that's integrated
 with the Asus P5QPL-AM motherboard.  If you are really after best
 transfer quality, you might want to use something else in the
 first place.

 Good point, thanks for the reality check.
 Most of what I have to do is not the best quality anyway, but that
 doesn't mean I'm happy to introduce unnecessary generation loss by
 being sloppy. There is some though that is very good, so that may well
 need something better.


I heard the Griffin iMic was to be discontinued, but mine is supported
under OpenBSD. Your best bet for clean audio is a USB-attached device.

Sound cards just get too much noise off the motherboard.



Re: audio recording levels

2010-06-14 Thread Paul M

On 15/06/2010, at 2:20 AM, Ted Roby wrote:


On Mon, Jun 14, 2010 at 2:29 AM, Paul M l...@no-tek.com wrote:

On 14/06/2010, at 6:54 PM, Jan Stary wrote:




It would be my guess that this is the audio chip that's integrated
with the Asus P5QPL-AM motherboard.  If you are really after best
transfer quality, you might want to use something else in the
first place.


Good point, thanks for the reality check.
Most of what I have to do is not the best quality anyway, but that
doesn't mean I'm happy to introduce unnecessary generation loss by
being sloppy. There is some though that is very good, so that may well
need something better.



I heard the Griffin iMic was to be discontinued, but mine is supported
under OpenBSD. Your best bet for clean audio is a USB-attached device.

Sound cards just get too much noise off the motherboard.



Interesting.
I have one of those kicking around somewhere. I'll have to dig it out.
Thanks


paulm



audio recording levels

2010-06-13 Thread Paul M

I have a large amount of analog audio I need to digitize and
naturaly want to ensure best transfer quality. So I need to set
the analog level at the input to the adc as high as possible
without clipping. Ideally, I'll get the workstation hardware
set to certin defaults, then adjust the incomming audio as
required.
This leads to a couple of questions:
Are there (typicaly) any variable gain stages in the analog input
path in the computer. Mixerctl -av (full output below) shows a
node called 'record.adc'. It seems reasonable that this might
opperate on the analog input to the adc. However there is also
'record.volume', though I would assume this operates on the mixed
digital signals at the end of the chain.
Also: a lot of the gain stages have defaults of 120.120. Would
it be reasonable to assume that this is the 0 gain setting?

Any thoughts appreciated.


paulm


molly:/home/paul mixerctl -a
record.adc_mute=off
record.adc=248,248
record.adc2_mute=off
record.adc2=120,120
inputs.mix_source=mic,mic2,line-in,hp,line
inputs.mix_mic=120,120
inputs.mix_mic2=120,120
inputs.mix_line-in=248,248
inputs.mix_hp=120,120
inputs.mix_line=120,120
outputs.mix2=120,120
inputs.mix2_source=dac,mix
outputs.mix3=120,120
inputs.mix3_source=dac2,mix
outputs.mix4=120,120
inputs.mix4_source=dac3,mix
outputs.mix5=120,120
inputs.mix5_source=dac4,mix
outputs.line_source=mix2
outputs.line_mute=off
inputs.line=85,85
outputs.line_dir=output
outputs.line_boost=off
outputs.line_eapd=on
outputs.mic_source=mix3
outputs.mic_mute=off
inputs.mic=85,85
outputs.mic_dir=input-vr80
outputs.mic_boost=off
outputs.mic2_source=mix8
outputs.mic2_mute=off
inputs.mic2=85,85
outputs.mic2_dir=input-vr80
outputs.mic2_boost=off
outputs.line-in_source=mix4
outputs.line-in_mute=off
inputs.line-in=85,85
outputs.line-in_dir=input
outputs.line-in_boost=off
outputs.hp_source=mix5
outputs.hp_mute=off
inputs.hp=85,85
outputs.hp_dir=output
outputs.hp_boost=off
outputs.SPDIF_source=dig-dac
record.adc2_source=mic,mic2,line-in,hp,line,mix
record.adc_source=mic,mic2,line-in,hp,line,mix
outputs.mix8=120,120
inputs.mix8_source=dac5,mix
outputs.line_sense=plugged
outputs.mic_sense=plugged
outputs.mic2_sense=unplugged
outputs.line-in_sense=unplugged
outputs.hp_sense=unplugged
outputs.master=120,120
outputs.master.mute=off
outputs.master.slaves=mix2,line
record.volume=120,120
record.volume.mute=off
record.volume.slaves=adc,adc2
outputs.mode=analog


molly:/home/paul dmesg
OpenBSD 4.6 (GENERIC.MP.RAID) #0: Mon Mar 29 11:47:19 NZDT 2010
 
r...@molly.no-tek.local:/molly0/src/sys/arch/i386/compile/ 
GENERIC.MP.RAID
cpu0: Pentium(R) Dual-Core CPU E5400 @ 2.70GHz (GenuineIntel  
686-class) 2.73 GHz
cpu0:  
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36, 
CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS- 
CPL,VMX,EST,TM2,CX16,xTPR

real mem  = 1037135872 (989MB)
avail mem = 993542144 (947MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 09/21/09, BIOS32 rev. 0 @  
0xf0010, SMBIOS rev. 2.5 @ 0xf06c0 (50 entries)

bios0: vendor American Megatrends Inc. version 0317 date 09/21/2009
bios0: ASUSTeK Computer INC. P5QPL-AM
acpi0 at bios0: rev 0
acpi0: tables DSDT FACP APIC MCFG OEMB HPET GSCI SSDT
acpi0: wakeup devices P0P2(S4) P0P3(S4) P0P1(S4) UAR1(S4) PS2K(S4)  
PS2M(S4) USB0(S4) USB1(S4) USB2(S4) USB3(S4) EUSB(S4) MC97(S4) P0P4(S4)  
P0P5(S4) P0P6(S4) P0P7(S4) P0P8(S4) P0P9(S4) SLPB(S4)

acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 201MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Pentium(R) Dual-Core CPU E5400 @ 2.70GHz (GenuineIntel  
686-class) 2.73 GHz
cpu1:  
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36, 
CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS- 
CPL,VMX,EST,TM2,CX16,xTPR

ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (P0P2)
acpiprt2 at acpi0: bus -1 (P0P3)
acpiprt3 at acpi0: bus 3 (P0P1)
acpiprt4 at acpi0: bus 2 (P0P4)
acpiprt5 at acpi0: bus 1 (P0P5)
acpicpu0 at acpi0: PSS
acpicpu1 at acpi0: PSS
acpibtn0 at acpi0: SLPB
acpibtn1 at acpi0: PWRB
bios0: ROM list: 0xc/0xc600! 0xcc800/0x5800
cpu0: Enhanced SpeedStep 2723 MHz: speeds: 2700, 2003, 1603, 1203 MHz
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 Intel G41 Host rev 0x03
vga1 at pci0 dev 2 function 0 Intel G41 Video rev 0x03
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp at vga1 not configured
azalia0 at pci0 dev 27 function 0 Intel 82801GB HD Audio rev 0x01:  
apic 2 int 21 (irq 5)

azalia0: codecs: Realtek/0x0887
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 Intel 82801GB PCIE rev 0x01: apic 2  
int 16 (irq 11)

pci1 at ppb0 bus 2
ppb1 at pci0 dev 28 function 1 Intel 82801GB PCIE rev 

Re: audio recording levels

2010-06-13 Thread Martin Pelikán
Hi,
this you might already know, but good rule of thumb is to set the
levels manually for each source (according to its dynamics), having
peaks around -6dB to -10dB. If you have manual volume/gain control on
your recording device/preamp, I'd set all levels in the computer to
80% of the scale and then control everything by hand, on the box.
This probably doesn't apply to OpenBSD, but in Linux there have been
serious distortion trouble with levels set to 100% on some older cards
- the only solution is AFAIK try it out and use what your ears tell
you.
The good news is you can do other stuff while your LP's spinning and
recording :-)
-- 
Martin Pelikan



Re: audio recording levels

2010-06-13 Thread Jacob Meuser
On Mon, Jun 14, 2010 at 11:37:52AM +1200, Paul M wrote:
 I have a large amount of analog audio I need to digitize and
 naturaly want to ensure best transfer quality. So I need to set
 the analog level at the input to the adc as high as possible
 without clipping. Ideally, I'll get the workstation hardware
 set to certin defaults, then adjust the incomming audio as
 required.
 This leads to a couple of questions:
 Are there (typicaly) any variable gain stages in the analog input
 path in the computer.

varies depending on hardware, but often there is a gain
at the input and a gain at the ADC.

 Mixerctl -av (full output below) shows a
 node called 'record.adc'. It seems reasonable that this might
 opperate on the analog input to the adc

generically speaking, yes.

 However there is also
 'record.volume', though I would assume this operates on the mixed
 digital signals at the end of the chain.

no.  record.volume is essenially an alias.  on your hardware with the
configuration you've posted, it's a shortcut for setting both
record.adc and record.adc2.  this is explained in azalia(4) (though
maybe that info didn't make it into 4.6, the info in -current azalia(4)
is mostly relevant even for 4.6).

 Also: a lot of the gain stages have defaults of 120.120. Would
 it be reasonable to assume that this is the 0 gain setting?

no.  unfortunately, the mixer interface, like a lot of audio(4)
related stuff, is designed for consumer usage.  so, we just have
a range that is essentially 0-100% - it has no relevance to anything
except the knob.  truly the  worst kind of knobs are those that
have no outside meaning, but apparently people like this.  *shrug*

http://marc.info/?l=openbsd-techm=123101323408867w=2

 Any thoughts appreciated.

if you really want to know how to do this right, your best bet is to
find the datasheet for your codec.

now, your codec is a Realtek, which is common for azalia(4), and
I happen to know them pretty well ...

 inputs.line=85,85
this is a 0 (0), 10 (85), 20 (170), 30 (255) dB gain on the line-in
jack.  values in () are the corresponding mixerctl values.

 record.adc=248,248
this is the ADC input gain.  0 dB should be around '88'.
0..255 here represents the hardware's -16.5 to 30 dB
in 1.5 dB steps.

these are the only gains on the recording path of your device.

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org



Re: audio recording levels

2010-06-13 Thread Jacob Meuser
On Mon, Jun 14, 2010 at 02:03:38AM +0200, Martin Pelik?n wrote:
 Hi,
 this you might already know, but good rule of thumb is to set the
 levels manually for each source (according to its dynamics), having
 peaks around -6dB to -10dB. If you have manual volume/gain control on
 your recording device/preamp, I'd set all levels in the computer to
 80% of the scale and then control everything by hand, on the box.

but what does 80% mean?  that could be either some attenuation,
or a lot of gain.  depends on the mixer control.

 This probably doesn't apply to OpenBSD, but in Linux there have been
 serious distortion trouble with levels set to 100% on some older cards

again, that depends on what 100% means, which varies greatly.

 - the only solution is AFAIK try it out and use what your ears tell
 you.

ultimately, yes.

 The good news is you can do other stuff while your LP's spinning and
 recording :-)

well, that depends on *what* you're doing and *how* you're recording.

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org