require 5.004;
use POSIX qw(locale_h);
setlocale(LC_ALL, "russian");
use Win32::ODBC;
$ODBCUserDSN = 'AccessODBCTest';
$db = new Win32::ODBC($ODBCUserDSN)
|| die "Error opening ODBC \"$ODBCUserDSN\"\n";
$stmt = "SELECT table2.field1, table2.field2, table1.field3
FROM table1 INNER JOIN table2 ON table1.field1 = table2.field1;";
$rc = $db->Sql($stmt);
die qq(SQL failed "$stmt": ), $db->Error(), qq(\n) if $rc;
while ($db->FetchRow())
{
($A1, $A2, $A3) = $db->Data();#("field1", "field2", "field3");
print "$A1, $A2, $A3\n";
} # while
$db->Close();
exit;
2011-12-26
Connecting to Microsoft Access with Perl using Win32::ODBC
Just a short example.
2011-10-25
iPhone 3G RMAA test report.
iPhone 3G RMAA audio test.
Testing chain: iPhone 3G (16-bit, 44.1 kHz AIFF file playback) -> SBLive!24 line-in (24-bit, 48 kHz).
Frequency response (from 40 Hz to 15 kHz), dB : +0.02, -0.15
Noise level, dB (A) : -92.4
Dynamic range, dB (A) : 92.3
THD, % : 0.0024
THD + Noise, dB (A) : -81.3
IMD + Noise, % : 0.012
Stereo crosstalk, dB : -88.1
IMD at 10 kHz, % : 0.011
Testing chain: iPhone 3G with 16 Ohm load (16-bit, 44.1 kHz AIFF file playback) -> SBLive!24 line-in (24-bit, 48 kHz).
Frequency response (from 40 Hz to 15 kHz), dB : +0.15, -2.09
Noise level, dB (A) : -93.0
Dynamic range, dB (A) : 92.9
THD, % : 0.027
THD + Noise, dB (A) : -69.9
IMD + Noise, % : 0.047
Stereo crosstalk, dB : -67.6
IMD at 10 kHz, % : 0.074
![]() |
| iPhone 3G |
Testing chain: iPhone 3G (16-bit, 44.1 kHz AIFF file playback) -> SBLive!24 line-in (24-bit, 48 kHz).
Frequency response (from 40 Hz to 15 kHz), dB : +0.02, -0.15
Noise level, dB (A) : -92.4
Dynamic range, dB (A) : 92.3
THD, % : 0.0024
THD + Noise, dB (A) : -81.3
IMD + Noise, % : 0.012
Stereo crosstalk, dB : -88.1
IMD at 10 kHz, % : 0.011
Testing chain: iPhone 3G with 16 Ohm load (16-bit, 44.1 kHz AIFF file playback) -> SBLive!24 line-in (24-bit, 48 kHz).
Frequency response (from 40 Hz to 15 kHz), dB : +0.15, -2.09
Noise level, dB (A) : -93.0
Dynamic range, dB (A) : 92.9
THD, % : 0.027
THD + Noise, dB (A) : -69.9
IMD + Noise, % : 0.047
Stereo crosstalk, dB : -67.6
IMD at 10 kHz, % : 0.074
2011-10-12
MP3 player Explay X1 (ATJ3310) RMAA test report.
RMAA - RightMark Audio Analyzer.
ATJ3310 - Actions Semiconductor multimedia IC
ATJ3310 - Actions Semiconductor multimedia IC
Explay X1 audio tests below...
Testing chain: Explay X1 (16-bit, 44.1 kHz WAV file playback) -> SBLive!24 line-in (24-bit, 48 kHz).
Frequency response (from 40 Hz to 15 kHz), dB : +0.05, -0.28
Noise level, dB (A) : -91.2
Dynamic range, dB (A) : 91.2
THD, % : 0.0027
THD + Noise, dB (A) : -82.0
IMD + Noise, % : 0.010
Stereo crosstalk, dB : -89.1
IMD at 10 kHz, % : 0.0096
Testing chain: Explay X1 with 16 Ohm load (16-bit, 44.1 kHz WAV file playback) -> SBLive!24 line-in (24-bit, 48 kHz).
Frequency response (from 40 Hz to 15 kHz), dB : +0.05, -0.29
Noise level, dB (A) : -91.8
Dynamic range, dB (A) : 91.7
THD, % : 0.0045
THD + Noise, dB (A) : -80.0
IMD + Noise, % : 0.013
Stereo crosstalk, dB : -66.5
IMD at 10 kHz, % : 0.023
Frequency response (from 40 Hz to 15 kHz), dB : +0.05, -0.28
Noise level, dB (A) : -91.2
Dynamic range, dB (A) : 91.2
THD, % : 0.0027
THD + Noise, dB (A) : -82.0
IMD + Noise, % : 0.010
Stereo crosstalk, dB : -89.1
IMD at 10 kHz, % : 0.0096
Testing chain: Explay X1 with 16 Ohm load (16-bit, 44.1 kHz WAV file playback) -> SBLive!24 line-in (24-bit, 48 kHz).
Frequency response (from 40 Hz to 15 kHz), dB : +0.05, -0.29
Noise level, dB (A) : -91.8
Dynamic range, dB (A) : 91.7
THD, % : 0.0045
THD + Noise, dB (A) : -80.0
IMD + Noise, % : 0.013
Stereo crosstalk, dB : -66.5
IMD at 10 kHz, % : 0.023
2011-10-10
MEIER-AUDIO CORDA ARIETTA headphone amplifier RMAA test report.
MEIER-AUDIO CORDA ARIETTA headamp audio test by RightMark Audio Analyzer (RMAA).
Testing chain: SBLive!24 line-out (24-bit, 48 kHz) -> ARIETTA -> SBLive!24 line-in (24-bit, 48 kHz).
Frequency response (from 40 Hz to 15 kHz), dB : +0.01, -0.07
Noise level, dB (A) : -94.9
Dynamic range, dB (A) : 94.9
THD, % : 0.0016
THD + Noise, dB (A) : -87.3
IMD + Noise, % : 0.0055
Stereo crosstalk, dB : -89.6
IMD at 10 kHz, % : 0.0056
Testing chain: SBLive!24 line-out (24-bit, 48 kHz) -> ARIETTA (with 16 Ohm load) -> SBLive!24 line-in (24-bit, 48 kHz).
Frequency response (from 40 Hz to 15 kHz), dB : +0.01, -0.09
Noise level, dB (A) : -94.9
Dynamic range, dB (A) : 95.1
THD, % : 0.0066
THD + Noise, dB (A) : -82.0
IMD + Noise, % : 0.010
Stereo crosstalk, dB : -54.7
IMD at 10 kHz, % : 0.015
Testing chain: SBLive!24 line-out (24-bit, 48 kHz) -> ARIETTA -> SBLive!24 line-in (24-bit, 48 kHz).
Frequency response (from 40 Hz to 15 kHz), dB : +0.01, -0.07
Noise level, dB (A) : -94.9
Dynamic range, dB (A) : 94.9
THD, % : 0.0016
THD + Noise, dB (A) : -87.3
IMD + Noise, % : 0.0055
Stereo crosstalk, dB : -89.6
IMD at 10 kHz, % : 0.0056
Testing chain: SBLive!24 line-out (24-bit, 48 kHz) -> ARIETTA (with 16 Ohm load) -> SBLive!24 line-in (24-bit, 48 kHz).
Frequency response (from 40 Hz to 15 kHz), dB : +0.01, -0.09
Noise level, dB (A) : -94.9
Dynamic range, dB (A) : 95.1
THD, % : 0.0066
THD + Noise, dB (A) : -82.0
IMD + Noise, % : 0.010
Stereo crosstalk, dB : -54.7
IMD at 10 kHz, % : 0.015
2011-10-06
Creative Sound Blaster Live! 24-bit RMAA test report.
Creative Sound Blaster Live! 24-bit audio test by RightMark Audio Analyzer (RMAA).
Testing chain: line output (24-bit, 48 kHz) -> line input (24-bit, 48 kHz).
Frequency response (from 40 Hz to 15 kHz), dB : +0.01, -0.05
Noise level, dB (A) : -100.8
Dynamic range, dB (A) : 100.9
THD, % : 0.0012
THD + Noise, dB (A) : -92.3
IMD + Noise, % : 0.0029
Stereo crosstalk, dB : -98.8
IMD at 10 kHz, % : 0.0039
![]() |
| iXBT.com review |
Testing chain: line output (24-bit, 48 kHz) -> line input (24-bit, 48 kHz).
Frequency response (from 40 Hz to 15 kHz), dB : +0.01, -0.05
Noise level, dB (A) : -100.8
Dynamic range, dB (A) : 100.9
THD, % : 0.0012
THD + Noise, dB (A) : -92.3
IMD + Noise, % : 0.0029
Stereo crosstalk, dB : -98.8
IMD at 10 kHz, % : 0.0039
2011-06-27
CentOS 5.6 tuning.
# yum update
# yum list installed
# yum remove GConf2.x86_64
# yum remove kernel-2.6.18-238.el5
# yum remove NetworkManager NetworkManager NetworkManager-glib NetworkManager-glib
# yum remove ...
# yum install ntp.x86_64
# vi /etc/ntp.conf
(edit)> server <X.X.X.X>
# vi /etc/sysconfig/ntpd
(edit)> SYNC_HWCLOCK=yes
# adduser -c "<User Name>" -m -u 1001 -g users -G wheel <login>
# passwd <login>
# cd /home/<User Name>
# vi .bash_profile
(edit)> PATH=$PATH:/sbin:/usr/sbin:$HOME/bin
# vi /etc/aliases
(add)> root: <login>
(add)> <login>: <user@domain>
# newaliases
# vi /etc/sysconfig/iptables
(add)> -A RH-Firewall-1-INPUT -m state --state NEW -s <X.X.X.X>/<X> -m tcp -p tcp --dport 22 -j ACCEPT
# service iptables restart
# service ntpd restart
# vi /etc/sysconfig/network
(add)> FORWARD_IPV4=no
(del)> GATEWAY=<X.X.X.X>
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
(add)> GATEWAY=<X.X.X.X>
# service network restart
# vi /etc/pam.d/su
(uncoment)> auth required pam_wheel.so use_uid
# vi /etc/sudoers
(uncoment)> %wheel ALL=(ALL) ALL
# vi /etc/ssh/sshd_config
(edit)> PermitRootLogin no
(edit)> AllowTcpForwarding no
(edit)> X11Forwarding no
# kill -HUP `cat /var/run/sshd.pid`
...
# yum list installed
# yum remove GConf2.x86_64
# yum remove kernel-2.6.18-238.el5
# yum remove NetworkManager NetworkManager NetworkManager-glib NetworkManager-glib
# yum remove ...
# yum install ntp.x86_64
# vi /etc/ntp.conf
(edit)> server <X.X.X.X>
# vi /etc/sysconfig/ntpd
(edit)> SYNC_HWCLOCK=yes
# chkconfig --level 3 ntpd on
# service ntpd start
# service ntpd start
# adduser -c "<User Name>" -m -u 1001 -g users -G wheel <login>
# passwd <login>
# cd /home/<User Name>
# vi .bash_profile
(edit)> PATH=$PATH:/sbin:/usr/sbin:$HOME/bin
# vi /etc/aliases
(add)> root: <login>
(add)> <login>: <user@domain>
# newaliases
# vi /etc/sysconfig/iptables
(add)> -A RH-Firewall-1-INPUT -m state --state NEW -s <X.X.X.X>/<X> -m tcp -p tcp --dport 22 -j ACCEPT
# service iptables restart
# service ntpd restart
# vi /etc/sysconfig/network
(add)> FORWARD_IPV4=no
(del)> GATEWAY=<X.X.X.X>
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
(add)> GATEWAY=<X.X.X.X>
# service network restart
# vi /etc/pam.d/su
(uncoment)> auth required pam_wheel.so use_uid
# vi /etc/sudoers
(uncoment)> %wheel ALL=(ALL) ALL
# vi /etc/ssh/sshd_config
(edit)> PermitRootLogin no
(edit)> AllowTcpForwarding no
(edit)> X11Forwarding no
# kill -HUP `cat /var/run/sshd.pid`
...
2010-12-24
Windows Media Player Audio DSP Plug-in.
These are a changed DoProcessOutput and ValidateMediaType of a plug-in wizard sample code (see the Implementing DoProcessOutput article) with implementing of the Bauer stereophonic-to-binaural DSP (bs2b).
I have try to support a various media types. There are something have get success, but the main disappoint of my experience is untouched playback of WAV file with 32bit floating point samples by WMP.
There is no problem of passing to effect of 32bit floating point WAVs and of CD/HDCD on Windows7 with WMP12, but still no way to pass of 32bit float on Windows XP.
I have try to support a various media types. There are something have get success, but the main disappoint of my experience is untouched playback of WAV file with 32bit floating point samples by WMP.
There is no problem of passing to effect of 32bit floating point WAVs and of CD/HDCD on Windows7 with WMP12, but still no way to pass of 32bit float on Windows XP.
//////////////////////////////////////////////////
// CBs2bwmp::DoProcessOutput
//
// Convert the input buffer to the output buffer
//////////////////////////////////////////////////
HRESULT CBs2bwmp::DoProcessOutput(
BYTE *pbOutputData,
const BYTE *pbInputData,
DWORD *cbBytesProcessed)
{
// see if the plug-in has been disabled by the user
if (!m_bEnabled)
{
memcpy(pbOutputData, pbInputData, *cbBytesProcessed);
return S_OK;
}
WAVEFORMATEX *pWave = (WAVEFORMATEX *)m_mtInput.pbFormat;
//DWORD dwSamplesToProcess = (*cbBytesProcessed / pWave->nBlockAlign) * pWave->nChannels;
DWORD dwStereoSamplesToProcess = *cbBytesProcessed / pWave->nBlockAlign;
bs2b.set_srate(pWave->nSamplesPerSec);
// Note: for 8 and 16-bit samples, we assume the container is the same size as
// the samples. For > 16-bit samples, we need to use the WAVEFORMATEXTENSIBLE
// structure to determine the valid bits per sample.
// ...this comment (and some other ones) is from Microsoft's Plug-in Wizard of
// Windows Media Player (WMP) SDK which is part of
// Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1.
switch (pWave->wBitsPerSample)
{
case 8: // 8-bit sound is 0..255 with 128 == silence
{
// return no. bytes actually copied to output buffer
//*cbBytesProcessed = dwSamplesToProcess * sizeof(BYTE);
memcpy(pbOutputData, pbInputData, *cbBytesProcessed);
bs2b.cross_feed((uint8_t *)pbOutputData, dwStereoSamplesToProcess);
}
break;
case 16:
{
// return no. bytes actually copied to output buffer
//*cbBytesProcessed = dwSamplesToProcess * sizeof(short);
memcpy(pbOutputData, pbInputData, *cbBytesProcessed);
bs2b.cross_feed((int16_t *)pbOutputData, dwStereoSamplesToProcess);
}
break;
case 24:
{
// return no. bytes actually copied to output buffer
//*cbBytesProcessed = dwSamplesToProcess * 3;
WAVEFORMATEXTENSIBLE *pWaveXT = (WAVEFORMATEXTENSIBLE *)pWave;
switch (pWaveXT->Samples.wValidBitsPerSample)
{
case 16: // not implemented yet (can't find a data to test)
{
*cbBytesProcessed = 0;
return E_FAIL;
}
break;
case 20: // wikipedia.org/wiki/High_Definition_Compatible_Digital#Windows_Media_Player
// Tools menu: Tools/Options/Devices/Speakers/Properties/Performance
// with 24bit=On - CDDA/HDCD playback hit here
/* This commented code should be ok if the ValidBitsPerSample will be equal
to a real bit depth of the data.
The real bit depth is 24 bit, so, go to case of 24bit.
{
while (dwStereoSamplesToProcess-- > 0)
{
int i;
double df[2];
i = (char)pbInputData[2];
i = (i << 8) | pbInputData[1];
i = (i << 4) | (pbInputData[0] >> 4);
df[0] = (double)i / 0x7FFFF; // normalize to [-1..1]
i = (char)pbInputData[5];
i = (i << 8) | pbInputData[4];
i = (i << 4) | (pbInputData[3] >> 4);
df[1] = (double)i / 0x7FFFF; // normalize to [-1..1]
pbInputData += 6;
bs2b.cross_feed(df);
i = (int)(df[0] * 0x7FFFF);
*pbOutputData++ = i & 0xFF;
*pbOutputData++ = (i >> 8) & 0xFF;
*pbOutputData++ = (i >> 16) & 0xFF;
i = (int)(df[1] * 0x7FFFF);
*pbOutputData++ = i & 0xFF;
*pbOutputData++ = (i >> 8) & 0xFF;
*pbOutputData++ = (i >> 16) & 0xFF;
}
}
break;
*/
case 24: // Can't find a test stream to hit here
default: // ++ 24bit LPCM WAV playback hit here only (BitsPerSample!=16,20,24)
{
memcpy(pbOutputData, pbInputData, *cbBytesProcessed);
bs2b.cross_feed((bs2b_int24_t *)pbOutputData, dwStereoSamplesToProcess);
}
break;
}
}
break;
case 32:
{
// return no. bytes actually copied to output buffer
//*cbBytesProcessed = dwSamplesToProcess * 4;
switch (pWave->wFormatTag)
{
case WAVE_FORMAT_IEEE_FLOAT: // 32bit float WAV playback not hit here
{
memcpy(pbOutputData, pbInputData, *cbBytesProcessed);
bs2b.cross_feed((float *)pbOutputData, dwStereoSamplesToProcess);
}
break;
case WAVE_FORMAT_PCM: // ++ 32bit LPCM WAV playback hit to here only
{
memcpy(pbOutputData, pbInputData, *cbBytesProcessed);
bs2b.cross_feed((int32_t *)pbOutputData, dwStereoSamplesToProcess);
}
break;
case WAVE_FORMAT_EXTENSIBLE:
{
WAVEFORMATEXTENSIBLE *pWaveXT = (WAVEFORMATEXTENSIBLE *)pWave;
if (pWaveXT->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT)
{
// 32bit float WAV playback not hit here
memcpy(pbOutputData, pbInputData, *cbBytesProcessed);
bs2b.cross_feed((float *)pbOutputData, dwStereoSamplesToProcess);
}
else if (pWaveXT->SubFormat == KSDATAFORMAT_SUBTYPE_PCM)
{
// 32bit LPCM WAV playback not hit here
memcpy(pbOutputData, pbInputData, *cbBytesProcessed);
bs2b.cross_feed((int32_t *)pbOutputData, dwStereoSamplesToProcess);
}
}
break;
default:
// should never happen
_ASSERT(false);
*cbBytesProcessed = 0;
return E_FAIL;
break;
}
}
break;
default:
// return no. bytes actually copied to output buffer
*cbBytesProcessed = 0;
return E_FAIL;
break;
}
return S_OK;
}
//////////////////////////////////////////////////
// CBs2bwmp::ValidateMediaType
//
// Validate that the media type is acceptable
//////////////////////////////////////////////////
HRESULT CBs2bwmp::ValidateMediaType(
const DMO_MEDIA_TYPE *pmtTarget,
const DMO_MEDIA_TYPE *pmtPartner)
{
// make sure the target media type has the fields we require
if( ( MEDIATYPE_Audio != pmtTarget->majortype ) ||
( FORMAT_WaveFormatEx != pmtTarget->formattype ) ||
( pmtTarget->cbFormat < sizeof( WAVEFORMATEX )) ||
( NULL == pmtTarget->pbFormat) )
{
return DMO_E_TYPE_NOT_ACCEPTED;
}
// make sure the wave header has the fields we require
WAVEFORMATEX *pWave = (WAVEFORMATEX *) pmtTarget->pbFormat;
if ((2 != pWave->nChannels) || // stereo only for bs2b (was: 0 == pWave->nChannels)
(0 == pWave->nSamplesPerSec) ||
(0 == pWave->nAvgBytesPerSec) ||
(0 == pWave->nBlockAlign) ||
(0 == pWave->wBitsPerSample))
{
return DMO_E_TYPE_NOT_ACCEPTED;
}
// make sure this is a supported container size
if ((8 != pWave->wBitsPerSample) &&
(16 != pWave->wBitsPerSample) &&
(24 != pWave->wBitsPerSample) &&
(32 != pWave->wBitsPerSample))
{
return DMO_E_TYPE_NOT_ACCEPTED;
}
// make sure the wave format is acceptable
switch (pWave->wFormatTag)
{
case WAVE_FORMAT_PCM:
// make sure sample size is 8 or 16-bit
if ((8 != pWave->wBitsPerSample) &&
(16 != pWave->wBitsPerSample) &&
(24 != pWave->wBitsPerSample) && // ++ 24bit LPCM WAV
(32 != pWave->wBitsPerSample)) // ++ 32bit LPCM WAV
{
return DMO_E_TYPE_NOT_ACCEPTED;
}
break;
case WAVE_FORMAT_IEEE_FLOAT:
// make sure the input is sane
if (32 != pWave->wBitsPerSample)
{
return DMO_E_TYPE_NOT_ACCEPTED;
}
break;
case WAVE_FORMAT_EXTENSIBLE:
{
WAVEFORMATEXTENSIBLE *pWaveXT = (WAVEFORMATEXTENSIBLE *) pWave;
// make sure the wave format extensible has the fields we require
if ((KSDATAFORMAT_SUBTYPE_PCM != pWaveXT->SubFormat &&
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT != pWaveXT->SubFormat) ||
(0 == pWaveXT->Samples.wSamplesPerBlock) ||
(pWaveXT->Samples.wValidBitsPerSample > pWave->wBitsPerSample))
{
return DMO_E_TYPE_NOT_ACCEPTED;
}
// for 8 or 16-bit, the container and sample size must match
if ((8 == pWave->wBitsPerSample) ||
(16 == pWave->wBitsPerSample))
{
if (pWave->wBitsPerSample != pWaveXT->Samples.wValidBitsPerSample)
{
return DMO_E_TYPE_NOT_ACCEPTED;
}
}
else
{
// for any other container size, make sure the valid
// bits per sample is a value we support
if (//(16 != pWaveXT->Samples.wValidBitsPerSample) && // not implemented yet
(20 != pWaveXT->Samples.wValidBitsPerSample) &&
(24 != pWaveXT->Samples.wValidBitsPerSample) &&
(32 != pWaveXT->Samples.wValidBitsPerSample))
{
return DMO_E_TYPE_NOT_ACCEPTED;
}
}
}
break;
default:
return DMO_E_TYPE_NOT_ACCEPTED;
break;
}
// if the partner media type is configured, make sure it matches the target.
// this is done because this plug-in requires the same input and output types
if (GUID_NULL != pmtPartner->majortype)
{
if ((pmtTarget->majortype != pmtPartner->majortype) ||
(pmtTarget->subtype != pmtPartner->subtype))
{
return DMO_E_TYPE_NOT_ACCEPTED;
}
// make sure the wave headers for the target and the partner match
WAVEFORMATEX *pPartnerWave = (WAVEFORMATEX *) pmtPartner->pbFormat;
if ((pWave->nChannels != pPartnerWave->nChannels) ||
(pWave->nSamplesPerSec != pPartnerWave->nSamplesPerSec) ||
(pWave->nAvgBytesPerSec != pPartnerWave->nAvgBytesPerSec) ||
(pWave->nBlockAlign != pPartnerWave->nBlockAlign) ||
(pWave->wBitsPerSample != pPartnerWave->wBitsPerSample) ||
(pWave->wFormatTag != pPartnerWave->wFormatTag))
{
return DMO_E_TYPE_NOT_ACCEPTED;
}
// make sure the waveformatextensible types are the same
if (pWave->wFormatTag == WAVE_FORMAT_EXTENSIBLE)
{
WAVEFORMATEXTENSIBLE *pWaveXT = (WAVEFORMATEXTENSIBLE *) pWave;
WAVEFORMATEXTENSIBLE *pPartnerWaveXT = (WAVEFORMATEXTENSIBLE *) pPartnerWave;
if (pWaveXT->SubFormat != pPartnerWaveXT->SubFormat)
{
return DMO_E_TYPE_NOT_ACCEPTED;
}
}
}
// media type is valid
return S_OK;
}
//////////////////////////////////////////////////






























