1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122
|
/****************************************************************************
Hal8420.cpp
Description: Lynx Application Programming Interface Header File
Created: David A. Hoatson, September 2000
Copyright 2000 Lynx Studio Technology, Inc.
This software contains the valuable TRADE SECRETS and CONFIDENTIAL INFORMATION
of Lynx Studio Technology, Inc. The software is protected under copyright
laws as an unpublished work of Lynx Studio Technology, Inc. Notice is
for informational purposes only and does not imply publication. The user
of this software may make copies of the software for use with products
manufactured by Lynx Studio Technology, Inc. or under license from
Lynx Studio Technology, Inc. and for no other use.
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
PURPOSE.
Environment:
4 spaces per tab
Revision History
When Who Description
--------- --- ------------------------------------------------------------
Feb 01 05 DAH Changed GetSRCRatio to return 0xFFFFFFFF if SRC is OFF
May 28 03 DAH GetInputSampleRate now uses a range of sample rates to
determine the base rate.
May 28 03 DAH Noted that calls to CHalAdapter::IORead may lockup the
chipset on beige G3's.
Sep 05 02 DAH 8420 now no longer generates any interrupts. D to E
transfers are disabled.
****************************************************************************/
#include <StdAfx.h>
#include "HalAdapter.h"
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::Open (PHALADAPTER pHalAdapter)
/////////////////////////////////////////////////////////////////////////////
{
// save the pointer to the parent adapter object
m_pHalAdapter = pHalAdapter;
#ifdef USE_RESET_ON_UNLOCK
m_bResetDigitalIOLock = FALSE;
m_ulLockState = LOCKSTATE_LOCKED; // assume we are locked
m_lInIOActive = 0;
#endif
m_ucInputErrors = 0;
//RtlZeroMemory( &m_QSubcode, sizeof( QCHANNELSUBCODE ) );
RtlZeroMemory (&m_TxCBuffer, sizeof (m_TxCBuffer));
m_bWriteCUFirstTime = TRUE; // Force the CU buffer to be completely written the first time through
m_bMuteOnError = TRUE;
m_ulSRCMode = MIXVAL_SRCMODE_SRC_ON;
m_ulFormat = MIXVAL_DF_AESEBU;
m_ulOutputStatus = MIXVAL_OUTSTATUS_VALID; // Non-Audio OFF, Emphasis OFF
InitializeChip ();
return (HSTATUS_OK);
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::Close ()
/////////////////////////////////////////////////////////////////////////////
{
SetSRCMode (MIXVAL_SRCMODE_SRC_ON);
Write (k8420ClockSourceControl, (BYTE) 0, k8420_CSC_RUN);
return (HSTATUS_OK);
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::InitializeChip ()
/////////////////////////////////////////////////////////////////////////////
{
// 1: Set the direction of TCBL to output
Write (k8420MiscControl1, k8420_MC1_TCBLD);
// 2: Set RMCk output frequncy to 128 Fsi
Write (k8420MiscControl2, k8420_MC2_RMCKF | k8420_MC2_HOLD01); // Mute On Error: ON
// 3: Data Flow Control
// Mute on Loss of Lock, Everything else gets set in SetMode
Write (k8420DataFlowControl, k8420_DFC_AMLL);
// 4: Put the chip in run mode
Write (k8420ClockSourceControl, k8420_CSC_RUN);
// 5: Serial audio input port format: slave, 24-bit, I2S
Write (k8420SerialInputFormat, (k8420_SAI_SIDEL | k8420_SAI_SILRPOL));
// 6: Serial audio output port format: 24-bit, I2S
//NOTE: SOMS=1: master mode, OLRCK and OSCLK are outputs, slave to AES, set DILRCKDIR=1
// SOMS=0: slave mode, OLRCK and OSCLK are inputs - clock for AES in derived externally
Write (k8420SerialOutputFormat, (k8420_SAO_SOLRPOL | k8420_SAO_SODEL)); //SRC, slave mode
// 7: Interrupt Register 1 Status, Read Only
// 8: Interrupt Register 2 Status, Read Only
// 9: Interrupt 1 Register Mask, Enable Receiver Error Interrupt
#ifdef USE_RESET_ON_UNLOCK
if (m_bResetDigitalIOLock)
{
Write (k8420Interrupt1Mask, k8420_Int1_RERR); // DAH 10/13/2005
m_ulLockState = LOCKSTATE_UNLOCKED;
}
else
#endif
{
Write (k8420Interrupt1Mask, 0); // DAH 10/13/2005
}
//Write( k8420Interrupt1Mask, (k8420_Int1_RERR | k8420_Int1_EFTC | k8420_Int1_DETC) );
// 10&11: Interrupt Register 1 Mode MSB & LSB, Default values OK (Rising edge always!)
// 12: Interrupt 2 Register Mask, Enable SRC UNLOCK Interrupt
Write (k8420Interrupt2Mask, 0); //k8420_Int2_REUNLOCK ); // DAH 07/15/2005
//Write( k8420Interrupt2Mask, k8420_Int2_QCH );
// 13&14: Interrupt Register 2 Mode MSB & LSB, Default values OK (Rising edge always!)
// 15: Receiver Channel Status, Read Only
// 16: Receiver Error, Read Only
// 17: setup which errors we are interested in...
Write (k8420RxErrorMask,
(k8420_RxErr_PAR | k8420_RxErr_BIP | k8420_RxErr_CONF |
k8420_RxErr_VAL | k8420_RxErr_UNLOCK | k8420_RxErr_CCRC |
k8420_RxErr_QCRC));
// 18: Channel Status Data Buffer Control
// only interested in DtoE transfers (Receiver), disable EtoF transfers (Transmitter)
Write (k8420CSDataBufferControl, k8420_CsDB_DETCI, k8420_CsDB_DETCI); // DAH Sep 05 2002
//Write( k8420CSDataBufferControl, k8420_CsDB_EFTCI, k8420_CsDB_EFTCI );
// 19: User Data Buffer Control,
Write (k8420UDataBufferControl, k8420_UDB_UD); //set U pin as output
// 20-29: Q-Channel Subcode Bytes, Read Only
// 30: Sample Rate Ratio, Read Only
// 32-55: C or U bit data buffer
ULONG ulSavedSRCMode = m_ulSRCMode;
SetSRCMode (MIXVAL_SRCMODE_TXONLY, TRUE); // Start with Mode 5 so transmitter will always turn on
SetFormat (m_ulFormat); // Calls WriteCUBuffer
SetOutputStatus (m_ulOutputStatus); // Calls WriteCUBuffer
SetSRCMode (ulSavedSRCMode, TRUE);
return (HSTATUS_OK);
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::Write (ULONG ulRegister, BYTE ucValue, BYTE ucMask)
// Write a single byte to a 8420 register
/////////////////////////////////////////////////////////////////////////////
{
return (m_pHalAdapter->IOWrite ((BYTE) ulRegister, ucValue, ucMask));
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::Write (ULONG ulRegister, PBYTE pucValue, ULONG ulSize)
// Write a buffer to the 8420 starting at a specific register
/////////////////////////////////////////////////////////////////////////////
{
while (ulSize--)
{
m_pHalAdapter->IOWrite ((BYTE) ulRegister++, *pucValue++);
}
return (HSTATUS_OK);
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::Read (ULONG ulRegister, PBYTE pucValue)
// Read a single byte to from a 8420 register
/////////////////////////////////////////////////////////////////////////////
{
// this may hang older beige G3's
return (m_pHalAdapter->IORead ((BYTE) ulRegister, pucValue));
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::Read (ULONG ulRegister, PBYTE pucValue, ULONG ulSize)
// only called from ReadCUBuffer which is never used
// Read a buffer from the 8420 starting at a specific register
/////////////////////////////////////////////////////////////////////////////
{
while (ulSize--)
{
m_pHalAdapter->IORead ((BYTE) ulRegister++, pucValue++);
}
return (HSTATUS_OK);
}
/////////////////////////////////////////////////////////////////////////////
BYTE
CHal8420::GetInputErrors ()
// private
/////////////////////////////////////////////////////////////////////////////
{
// NOTE: This may hang older Mac G3 computers!
Read (k8420RxErrors, &m_ucInputErrors);
return (m_ucInputErrors);
}
/////////////////////////////////////////////////////////////////////////////
BYTE
CHal8420::GetRxChannelStatus ()
// private
/////////////////////////////////////////////////////////////////////////////
{
BYTE ucStatus;
// NOTE: This may hang older Mac G3 computers!
Read (k8420RxChannelStatus, &ucStatus);
return (ucStatus);
}
/////////////////////////////////////////////////////////////////////////////
BOOLEAN
CHal8420::IsInputLocked ()
// No longer looks at the input channel status
/////////////////////////////////////////////////////////////////////////////
{
ULONG ulDigitalInRate;
m_pHalAdapter->GetFrequencyCounter (L2_FREQCOUNTER_DIGITALIN, &ulDigitalInRate); // this will return 0 if the input is unlocked
if (ulDigitalInRate)
return (TRUE);
return (FALSE);
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::GetInputStatus (PULONG pulStatus)
// This only called from CHalMixer::GetSharedControls and CHal8420::GetMixerControl
/////////////////////////////////////////////////////////////////////////////
{
#if defined(OSX) || defined(MACINTOSH)
if (IsInputLocked ())
*pulStatus = DIS_RXCS_PRO;
else
*pulStatus = DIS_ERR_UNLOCK;
#else
*pulStatus =
((ULONG) GetInputErrors () | ((ULONG) GetRxChannelStatus () << 8));
#endif
return (HSTATUS_OK);
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::UpdateStatus (BOOLEAN bInISR)
// This function insures that if the CS8420 goes into an invalid state
// (See CS8420 Rev D Errata # 3) that we can recover from it.
// Return Value never checked.
/////////////////////////////////////////////////////////////////////////////
{
#ifdef USE_RESET_ON_UNLOCK
#if defined(OSX) || defined(MACINTOSH)
#else
//cmn_err(CE_WARN,"CHal8420::UpdateStatus\n");
if (m_bResetDigitalIOLock)
{
// If we are being called from the ISR, then we can only be in the state UNLOCKED or LOCKED.
if (bInISR)
{
if (!
((m_ulLockState == LOCKSTATE_UNLOCKED)
|| (m_ulLockState == LOCKSTATE_LOCKED)))
{
//cmn_err(CE_WARN,"UpdateStatus NOT UNLOCKED or LOCKED\n");
// don't do anything...
return (HSTATUS_OK);
}
}
BOOLEAN bIsInputLocked;
// DAH 10/13/2005 moved to after check for ISR so this doesn't get called from within the ISR when it isn't needed.
bIsInputLocked =
(GetInputErrors () & k8420_RxErr_UNLOCK) ? FALSE : TRUE;
//if( bIsInputLocked ) DC('L'); else DC('U');
switch (m_ulLockState)
{
case LOCKSTATE_UNLOCKED:
//cmn_err((CE_WARN,"LOCKSTATE_UNLOCKED\n");
if (bIsInputLocked)
{
// we are transitioning from UNLOCK to LOCK
//Write( kMisc, (BYTE)0, IO_MISC_CS8420RSTn ); // put the CS8420 into reset mode
//Write( kMisc, IO_MISC_CS8420RSTn, IO_MISC_CS8420RSTn ); // take the CS8420 out of reset mode
//Write( k8420ClockSourceControl, (BYTE)0, k8420_CSC_RUN );
//cmn_err (CE_WARN, "Set WAITLOCK1\n");
m_ulLockState = LOCKSTATE_WAITINGFORLOCK1;
}
break;
case LOCKSTATE_WAITINGFORLOCK1:
//cmn_err (CE_WARN, "WAITLOCK1\n");
// if we are still locked, then toggle the RUN bit
if (bIsInputLocked)
{
//PHALSAMPLECLOCK pClock = m_pHalAdapter->GetSampleClock();
//ULONG ulSavedSRCMode;
//LONG lPreferredSource;
//cmn_err (CE_WARN, "[R]");
// toggle the run bit
m_lInIOActive++;
Write (k8420ClockSourceControl, (BYTE) 0, k8420_CSC_RUN);
Write (k8420ClockSourceControl, k8420_CSC_RUN, k8420_CSC_RUN);
// When going into RUN mode, the transmitter will be dead if the AES receiver isn't locked.
// Normally this would not be a problem, but in loopback mode this will keep the transmitter
// from ever working. Doing the SRCMode dance will solve this problem.
// The two calls to SetSRCMode will correct the TX error problem, but will blast the
// SRC mode and PreferredClockSource, so we save them off first...
//ulSavedSRCMode = m_ulSRCMode;
//pClock->GetPreferredSource( &lPreferredSource );
// The CS8420 seems to lose the transmit channel status when turning off RUN mode, so we
// force a new write.
//cmn_err (CE_WARN, "[F]");
m_bWriteCUFirstTime = TRUE;
SetFormat (m_ulFormat);
m_lInIOActive--;
//cmn_err (CE_WARN, "Setting WAITLOCK2\n");
m_ulLockState = LOCKSTATE_WAITINGFORLOCK2;
}
else
{
//cmn_err (CE_WARN, "Reverting to UNLOCKED\n");
m_ulLockState = LOCKSTATE_UNLOCKED;
}
break;
case LOCKSTATE_WAITINGFORLOCK2:
// we may be showing locked or unlocked here, it doesn't matter...
//cmn_err (CE_WARN, "Setting LOCKED\n");
m_ulLockState = LOCKSTATE_LOCKED;
break;
case LOCKSTATE_LOCKED:
//cmn_err((CE_WARN,"LOCKSTATE_LOCKED\n");
if (!bIsInputLocked)
{
// LOCKED to UNLOCK transition
//cmn_err (CE_WARN, "Setting UNLOCKED\n");
m_ulLockState = LOCKSTATE_UNLOCKED;
}
break;
}
}
//cmn_err(CE_WARN,"CHal8420::UpdateStatus Done\n");
#endif
#endif
return (HSTATUS_OK);
}
#ifdef USE_RESET_ON_UNLOCK
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::SetResetDigitalIOUnlock (BOOLEAN bValue)
/////////////////////////////////////////////////////////////////////////////
{
m_bResetDigitalIOLock = bValue;
if (m_bResetDigitalIOLock)
{
Write (k8420Interrupt1Mask, k8420_Int1_RERR); // DAH 10/13/2005
m_ulLockState = LOCKSTATE_UNLOCKED;
}
else
{
Write (k8420Interrupt1Mask, 0); // DAH 10/13/2005
}
return (HSTATUS_OK);
}
#endif
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::SetInputMuteOnError (BOOLEAN bMuteOnError)
/////////////////////////////////////////////////////////////////////////////
{
PHALLSTREAM pLStream;
if (bMuteOnError)
Write (k8420MiscControl2, k8420_MC2_HOLD01, k8420_MC2_HOLD_MASK);
else
Write (k8420MiscControl2, k8420_MC2_HOLD10, k8420_MC2_HOLD_MASK);
m_bMuteOnError = bMuteOnError;
// Need to set the mute on error for the LStream devices
pLStream = m_pHalAdapter->GetLStream ();
if (pLStream)
{
pLStream->AESSetInputMuteOnError (LSTREAM_BRACKET, bMuteOnError);
pLStream->AESSetInputMuteOnError (LSTREAM_HEADER, bMuteOnError);
}
return (HSTATUS_OK);
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::SetOutputNonAudio (BOOLEAN bNonAudio)
// Only called from CHalWaveDevice and CHalWaveDMADevice
/////////////////////////////////////////////////////////////////////////////
{
if (bNonAudio)
{
SET (m_ulOutputStatus, MIXVAL_OUTSTATUS_NONAUDIO);
SET (m_TxCBuffer[0], MIXVAL_DCS_BYTE0_NONPCM);
}
else
{
CLR (m_ulOutputStatus, MIXVAL_OUTSTATUS_NONAUDIO);
CLR (m_TxCBuffer[0], MIXVAL_DCS_BYTE0_NONPCM);
}
WriteCUBuffer (m_TxCBuffer);
return (HSTATUS_OK);
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::SetOutputStatus (ULONG ulStatus)
/////////////////////////////////////////////////////////////////////////////
{
// Validity
if (ulStatus & MIXVAL_OUTSTATUS_VALID)
Write (k8420MiscControl1, (BYTE) 0, k8420_MC1_VSET); // transmit a 1 for the V bit (Invalid)
else
Write (k8420MiscControl1, k8420_MC1_VSET, k8420_MC1_VSET); // transmit a 0 for the V bit (Valid)
// Non-Audio
if (ulStatus & MIXVAL_OUTSTATUS_NONAUDIO)
SET (m_TxCBuffer[0], MIXVAL_DCS_BYTE0_NONPCM);
else
CLR (m_TxCBuffer[0], MIXVAL_DCS_BYTE0_NONPCM);
// Emphasis
if (m_TxCBuffer[0] & MIXVAL_DCS_BYTE0_PRO)
{
CLR (m_TxCBuffer[0], MIXVAL_DCS_PRO_BYTE0_EMPH_MASK);
switch (ulStatus & MIXVAL_OUTSTATUS_EMPHASIS_MASK)
{
default:
case MIXVAL_OUTSTATUS_EMPHASIS_NONE:
SET (m_TxCBuffer[0], MIXVAL_DCS_PRO_BYTE0_EMPH_NONE);
break;
case MIXVAL_OUTSTATUS_EMPHASIS_5015:
SET (m_TxCBuffer[0], MIXVAL_DCS_PRO_BYTE0_EMPH_5015);
break;
case MIXVAL_OUTSTATUS_EMPHASIS_J17:
SET (m_TxCBuffer[0], MIXVAL_DCS_PRO_BYTE0_EMPH_CCITTJ17);
break;
}
}
else
{
if (ulStatus & MIXVAL_OUTSTATUS_EMPHASIS_5015)
SET (m_TxCBuffer[0], MIXVAL_DCS_CON_BYTE0_EMPH_5015);
else
CLR (m_TxCBuffer[0], MIXVAL_DCS_CON_BYTE0_EMPH_5015);
}
m_ulOutputStatus = ulStatus;
WriteCUBuffer (m_TxCBuffer);
return (HSTATUS_OK);
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::GetInputSampleRate (PLONG plRate)
/////////////////////////////////////////////////////////////////////////////
{
ULONG ulRate;
m_pHalAdapter->GetFrequencyCounter (L2_FREQCOUNTER_DIGITALIN, &ulRate);
m_pHalAdapter->NormalizeFrequency (ulRate, plRate);
return (HSTATUS_OK);
}
/////////////////////////////////////////////////////////////////////////////
BYTE
Invert (BYTE ucIn)
/////////////////////////////////////////////////////////////////////////////
{
BYTE ucOut = 0;
for (int i = 0; i < 8; i++)
if ((ucIn >> i) & 1)
ucOut |= (1 << (7 - i));
return (ucOut);
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::SampleClockChanged (LONG lRate, LONG lSource)
// Called by CHalSampleClock when the clock rate is changed
/////////////////////////////////////////////////////////////////////////////
{
//cmn_err(CE_WARN,"CHal8420::SampleClockChanged\n");
// if the Sample Clock Source is Digital, then we must set the 8420 to Mode 3 (SRC Off)
if (lSource == MIXVAL_L2_CLKSRC_DIGITAL)
{
// only make the change if the SRC mode is ON or OFF Clock Sync
if ((m_ulSRCMode == MIXVAL_SRCMODE_SRC_ON) ||
(m_ulSRCMode == MIXVAL_SRCMODE_SRC_ON_DIGOUT) ||
(m_ulSRCMode == MIXVAL_SRCMODE_SRC_OFF_CLKSYNC))
{
SetSRCMode (MIXVAL_SRCMODE_SRC_OFF);
}
}
else
{ // if the Clock Source is not Digital
// and the SRC mode is OFF, turn the SRC mode ON
if (m_ulSRCMode == MIXVAL_SRCMODE_SRC_OFF)
{
SetSRCMode (MIXVAL_SRCMODE_SRC_ON);
}
}
return (SetFormat (m_ulFormat, lRate));
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::SetFormat (ULONG ulFormat, LONG lRate)
/////////////////////////////////////////////////////////////////////////////
{
RtlZeroMemory (&m_TxCBuffer, sizeof (m_TxCBuffer));
if (!lRate)
{
// get the current sample rate
m_pHalAdapter->GetSampleClock ()->Get (&lRate);
}
switch (ulFormat)
{
case MIXVAL_DF_AESEBU:
// Change the relay
m_pHalAdapter->IOWrite (kMisc, IO_MISC_DF_AESEBU, IO_MISC_DF_MASK);
m_ulFormat = MIXVAL_DF_AESEBU;
m_TxCBuffer[0] = MIXVAL_DCS_BYTE0_PRO | MIXVAL_DCS_PRO_BYTE0_LOCKED;
switch (m_ulOutputStatus & MIXVAL_OUTSTATUS_EMPHASIS_MASK)
{
default:
case MIXVAL_OUTSTATUS_EMPHASIS_NONE:
SET (m_TxCBuffer[0], MIXVAL_DCS_PRO_BYTE0_EMPH_NONE);
break;
case MIXVAL_OUTSTATUS_EMPHASIS_5015:
SET (m_TxCBuffer[0], MIXVAL_DCS_PRO_BYTE0_EMPH_5015);
break;
case MIXVAL_OUTSTATUS_EMPHASIS_J17:
SET (m_TxCBuffer[0], MIXVAL_DCS_PRO_BYTE0_EMPH_CCITTJ17);
break;
}
switch (lRate)
{
case 22050:
SET (m_TxCBuffer[4], MIXVAL_DCS_PRO_BYTE4_FS_22050);
break;
case 24000:
SET (m_TxCBuffer[4], MIXVAL_DCS_PRO_BYTE4_FS_24000);
break;
case 32000:
SET (m_TxCBuffer[0], MIXVAL_DCS_PRO_BYTE0_FS_32000);
break;
case 44056:
SET (m_TxCBuffer[0], MIXVAL_DCS_PRO_BYTE0_FS_44100);
SET (m_TxCBuffer[4], MIXVAL_DCS_PRO_BYTE4_FS_PULLDOWN);
break;
case 44100:
SET (m_TxCBuffer[0], MIXVAL_DCS_PRO_BYTE0_FS_44100);
break;
case 48000:
SET (m_TxCBuffer[0], MIXVAL_DCS_PRO_BYTE0_FS_48000);
break;
case 88200:
SET (m_TxCBuffer[4], MIXVAL_DCS_PRO_BYTE4_FS_88200);
break;
case 96000:
SET (m_TxCBuffer[4], MIXVAL_DCS_PRO_BYTE4_FS_96000);
break;
case 176400:
SET (m_TxCBuffer[4], MIXVAL_DCS_PRO_BYTE4_FS_176400);
break;
case 192000:
SET (m_TxCBuffer[4], MIXVAL_DCS_PRO_BYTE4_FS_192000);
break;
}
m_TxCBuffer[1] = MIXVAL_DCS_PRO_BYTE1_CM_STEREO;
m_TxCBuffer[2] =
MIXVAL_DCS_PRO_BYTE2_AUX_MAIN24 | MIXVAL_DCS_PRO_BYTE2_AUX_24BITS;
m_TxCBuffer[6] = 'L';
if (m_pHalAdapter->GetDeviceID () == PCIDEVICE_LYNX_L22)
{
m_TxCBuffer[7] = '2';
m_TxCBuffer[8] = '2';
m_TxCBuffer[9] = ' ';
}
else
{
m_TxCBuffer[7] = 'T';
m_TxCBuffer[8] = 'W';
m_TxCBuffer[9] = 'O';
}
break;
case MIXVAL_DF_SPDIF:
// Change the relay
m_pHalAdapter->IOWrite (kMisc, IO_MISC_DF_SPDIF, IO_MISC_DF_MASK);
m_ulFormat = MIXVAL_DF_SPDIF;
m_TxCBuffer[0] =
MIXVAL_DCS_BYTE0_CON | MIXVAL_DCS_CON_BYTE0_COPY_PERMIT;
if (m_ulOutputStatus & MIXVAL_OUTSTATUS_EMPHASIS_5015)
SET (m_TxCBuffer[0], MIXVAL_DCS_CON_BYTE0_EMPH_5015);
// default is 44100
switch (lRate)
{
case 32000:
SET (m_TxCBuffer[3], MIXVAL_DCS_CON_BYTE3_FS_32000);
break;
case 44100:
SET (m_TxCBuffer[3], MIXVAL_DCS_CON_BYTE3_FS_44100);
break;
case 48000:
SET (m_TxCBuffer[3], MIXVAL_DCS_CON_BYTE3_FS_48000);
break;
}
SET (m_TxCBuffer[3], MIXVAL_DCS_CON_BYTE3_CA_LEVELI);
break;
}
if (m_ulOutputStatus & MIXVAL_OUTSTATUS_NONAUDIO)
SET (m_TxCBuffer[0], MIXVAL_DCS_BYTE0_NONPCM);
// write the transmitters C bit data
WriteCUBuffer (m_TxCBuffer);
return (HSTATUS_OK);
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::SetSRCMode (ULONG ulMode, BOOLEAN bInISR)
/////////////////////////////////////////////////////////////////////////////
{
PHALSAMPLECLOCK pClock = m_pHalAdapter->GetSampleClock ();
LONG lRate, lSource;
//USHORT usStatus;
//cmn_err(CE_WARN,"CHal8420::SetMode\n");
pClock->Get (&lRate, &lSource);
switch (ulMode)
{
case MIXVAL_SRCMODE_SRC_ON: // (CS8420 Page 14, Figure 12) AES In, SRC
if (lSource == MIXVAL_L2_CLKSRC_DIGITAL)
{
// SetPreferredSource is going to call Set, which in turn is going to call this function
// to keep it from doing this, we must set the mode right now
m_ulSRCMode = ulMode;
pClock->SetPreferredSource (MIXVAL_L2_CLKSRC_INTERNAL);
}
// Set the serial audio output to slave-in mode
Write (k8420SerialOutputFormat, (BYTE) 0, k8420_SAO_SOMS);
// Set the Digital Input LRCK Direction to Output
m_pHalAdapter->IOWrite (kMisc, 0, IO_MISC_DILRCKDIR);
Write (k8420MiscControl1, (BYTE) 0, k8420_MC1_MUTESAO); // enable the serial audio output
Write (k8420DataFlowControl,
(k8420_DFC_TXD01 | k8420_DFC_SPD00 | k8420_DFC_SRCD),
(k8420_DFC_TXD_MASK | k8420_DFC_SPD_MASK | k8420_DFC_SRCD));
Write (k8420ClockSourceControl, k8420_CSC_RXD01,
(k8420_CSC_OUTC | k8420_CSC_INC | k8420_CSC_RXD_MASK));
break;
case MIXVAL_SRCMODE_SRC_OFF_CLKSYNC: // (CS8420 Page 14, Figure 13 Modified) Synchronous AES In, No SRC
if (lSource == MIXVAL_L2_CLKSRC_DIGITAL)
{
// SetPreferredSource is going to call Set, which in turn is going to call this function
// to keep it from doing this, we must set the mode right now
m_ulSRCMode = ulMode;
pClock->SetPreferredSource (MIXVAL_L2_CLKSRC_INTERNAL);
}
// Set the serial audio output to slave-in mode
Write (k8420SerialOutputFormat, (BYTE) 0, k8420_SAO_SOMS);
// Set the Digital Input LRCK Direction to Output
m_pHalAdapter->IOWrite (kMisc, 0, IO_MISC_DILRCKDIR);
Write (k8420MiscControl1, (BYTE) 0, k8420_MC1_MUTESAO); // enable the serial audio output
Write (k8420DataFlowControl, (k8420_DFC_TXD01 | k8420_DFC_SPD10),
(k8420_DFC_TXD_MASK | k8420_DFC_SPD_MASK | k8420_DFC_SRCD));
Write (k8420ClockSourceControl, k8420_CSC_RXD01,
(k8420_CSC_OUTC | k8420_CSC_INC | k8420_CSC_RXD_MASK));
break;
case MIXVAL_SRCMODE_SRC_OFF: // (CS8420 Page 14, Figure 13) Slave to AES In, No SRC
// must set the Sample Clock Source to Digital before we change the
// rest of this so the digital input is still locked.
if (lSource != MIXVAL_L2_CLKSRC_DIGITAL)
{
// SetPreferredSource is going to call Set, which in turn is going to call this function
// to keep it from doing this, we must set the mode right now
m_ulSRCMode = ulMode;
pClock->SetPreferredSource (MIXVAL_L2_CLKSRC_DIGITAL);
}
// Set the Digital Input LRCK Direction to Input
m_pHalAdapter->IOWrite (kMisc, IO_MISC_DILRCKDIR, IO_MISC_DILRCKDIR);
// Set the serial audio output to Master-out mode
Write (k8420SerialOutputFormat, k8420_SAO_SOMS, k8420_SAO_SOMS);
Write (k8420MiscControl1, (BYTE) 0, k8420_MC1_MUTESAO); // enable the serial audio output
Write (k8420DataFlowControl, (k8420_DFC_TXD01 | k8420_DFC_SPD10),
(k8420_DFC_TXD_MASK | k8420_DFC_SPD_MASK | k8420_DFC_SRCD));
Write (k8420ClockSourceControl, (k8420_CSC_OUTC | k8420_CSC_RXD01),
(k8420_CSC_OUTC | k8420_CSC_INC | k8420_CSC_RXD_MASK));
break;
case MIXVAL_SRCMODE_SRC_ON_DIGOUT: // (CS8420 Page 14, Figure 11) AES out SRC to AES in
if (lSource == MIXVAL_L2_CLKSRC_DIGITAL)
{
// SetPreferredSource is going to call Set, which in turn is going to call this function
// to keep it from doing this, we must set the mode right now
m_ulSRCMode = ulMode;
pClock->SetPreferredSource (MIXVAL_L2_CLKSRC_INTERNAL);
}
// Set the serial audio output to slave-in mode
Write (k8420SerialOutputFormat, (BYTE) 0, k8420_SAO_SOMS);
// Set the Digital Input LRCK Direction to Output
m_pHalAdapter->IOWrite (kMisc, 0, IO_MISC_DILRCKDIR);
Write (k8420MiscControl1, k8420_MC1_MUTESAO, k8420_MC1_MUTESAO); // mute the serial audio output
Write (k8420DataFlowControl, (BYTE) 0,
(k8420_DFC_TXD_MASK | k8420_DFC_SPD_MASK | k8420_DFC_SRCD));
Write (k8420ClockSourceControl,
(k8420_CSC_OUTC | k8420_CSC_INC | k8420_CSC_RXD01),
(k8420_CSC_OUTC | k8420_CSC_INC | k8420_CSC_RXD_MASK));
break;
case MIXVAL_SRCMODE_TXONLY: // (CS8420 Page 14, Figure 15) Transmit Only
if (lSource == MIXVAL_L2_CLKSRC_DIGITAL)
{
// SetPreferredSource is going to call Set, which in turn is going to call this function
// to keep it from doing this, we must set the mode right now
m_ulSRCMode = ulMode;
pClock->SetPreferredSource (MIXVAL_L2_CLKSRC_INTERNAL);
}
Write (k8420DataFlowControl, (k8420_DFC_TXD01 | k8420_DFC_SPD01),
(k8420_DFC_TXD_MASK | k8420_DFC_SPD_MASK | k8420_DFC_SRCD));
Write (k8420ClockSourceControl, (k8420_CSC_INC | k8420_CSC_RXD00),
(k8420_CSC_OUTC | k8420_CSC_INC | k8420_CSC_RXD_MASK));
break;
default:
return (HSTATUS_INVALID_PARAMETER);
}
m_ulSRCMode = ulMode;
// Notify mixer of changes (except if we are being called from within the ISR)
if (!bInISR)
m_pHalAdapter->GetMixer ()->ControlChanged (LINE_ADAPTER, LINE_NO_SOURCE,
CONTROL_SRC_MODE);
return (HSTATUS_OK);
}
#define SRCRATIO_SCALE 10000L // 5 digits of precision
#define SRCRATIO_NORMAL 0x10000 // 1:1
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::GetSRCRatio (PULONG pulSRCRatio)
// returned as a 16:16 fixed point number where the fractional part is in
// the lower 16 bits of the ULONG.
// Returns 0xFFFFFFFF is SRC is OFF
/////////////////////////////////////////////////////////////////////////////
{
ULONG ulLRClock, ulDigitalInRate, ulSRCRatio = 0;
if ((m_ulSRCMode == MIXVAL_SRCMODE_SRC_ON)
|| (m_ulSRCMode == MIXVAL_SRCMODE_SRC_ON_DIGOUT))
{
m_pHalAdapter->GetFrequencyCounter (L2_FREQCOUNTER_DIGITALIN, &ulDigitalInRate); // this will return 0 if the input is unlocked
// The ratio is LRClock / DigitalIn
// This is returned as a 16:16 fixed point number
if (ulDigitalInRate)
{
m_pHalAdapter->GetFrequencyCounter (L2_FREQCOUNTER_LRCLOCK,
&ulLRClock);
// Valid lock range of 8K to 108K
if ((ulLRClock >= 8000) && (ulLRClock <= 108000))
{
ulSRCRatio =
(((ulLRClock * SRCRATIO_SCALE) / ulDigitalInRate) *
SRCRATIO_NORMAL) / SRCRATIO_SCALE;
}
}
}
else
{
ulSRCRatio = 0xFFFFFFFF; // let the applications know that the SRC is OFF
}
*pulSRCRatio = ulSRCRatio;
return (HSTATUS_OK);
}
/*
/////////////////////////////////////////////////////////////////////////////
USHORT CHal8420::GetQChannelSubcode( PQCHANNELSUBCODE pSubcode )
/////////////////////////////////////////////////////////////////////////////
{
// copy the current Q-Subcode into the users buffer
// *pSubcode = m_QSubcode;
return( HSTATUS_OK );
}
*/
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::ReadCUBuffer (PBYTE pBuffer)
// never used
/////////////////////////////////////////////////////////////////////////////
{
Read (k8420CorUDataBuffer, pBuffer, 24); // 192 bits or 24 bytes
for (int i = 0; i < 24; i++)
pBuffer[i] = Invert (pBuffer[i]);
return (HSTATUS_OK);
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::WriteCUBuffer (PBYTE pBuffer)
// Called From:
// CHal8420::SetOutputNonAudio
// CHal8420::SetOutputStatus
// CHal8420::SetFormat
/////////////////////////////////////////////////////////////////////////////
{
BYTE ucByte;
BYTE ucShadowByte;
BYTE ucRegister = k8420CorUDataBuffer;
// invert the bytes in the buffer (prepare for transmission)
for (int i = 0; i < 24; i++, ucRegister++)
{
ucByte = Invert (pBuffer[i]);
// if this is the first time for the CU write, write all the bytes down
if (m_bWriteCUFirstTime)
{
// only write if non-zero
if (ucByte)
{
Write (ucRegister, ucByte);
}
}
// if not the first time, only write the bytes that actually changed
else
{
m_pHalAdapter->IORead (ucRegister, &ucShadowByte, TRUE); // Read the shadow register only
if (ucShadowByte != ucByte)
Write (ucRegister, ucByte);
}
}
// Disable both transfers
//Write( k8420CSDataBufferControl, (k8420_CsDB_EFTCI | k8420_CsDB_DETCI), (k8420_CsDB_EFTCI | k8420_CsDB_DETCI) );
// Write the E buffer
//Write( k8420CorUDataBuffer, LocalBuffer, 24 ); // 192 bits or 24 bytes
// Enable EtoF transfers
//Write( k8420CSDataBufferControl, (BYTE)0, k8420_CsDB_EFTCI );
m_bWriteCUFirstTime = FALSE;
return (HSTATUS_OK);
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::SetDefaults (void)
/////////////////////////////////////////////////////////////////////////////
{
SetFormat (MIXVAL_DF_AESEBU);
SetSRCMode (MIXVAL_SRCMODE_SRC_ON);
SetInputMuteOnError (TRUE);
SetOutputStatus (MIXVAL_OUTSTATUS_VALID); // Non-Audio Off, Emphasis Off
return (HSTATUS_OK);
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::SetMixerControl (USHORT usControl, ULONG ulValue)
/////////////////////////////////////////////////////////////////////////////
{
switch (usControl)
{
case CONTROL_DIGITAL_FORMAT:
return (SetFormat (ulValue));
case CONTROL_SRC_MODE:
return (SetSRCMode (ulValue));
case CONTROL_DIGITALIN_MUTE_ON_ERROR:
return (SetInputMuteOnError ((BOOLEAN) ulValue));
case CONTROL_DIGITALOUT_STATUS:
return (SetOutputStatus (ulValue));
#ifdef USE_RESET_ON_UNLOCK
case CONTROL_RESET_DIGITALIO_LOCK:
return (SetResetDigitalIOUnlock ((BOOLEAN) ulValue));
#endif
default:
return (HSTATUS_INVALID_MIXER_CONTROL);
}
return (HSTATUS_OK);
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::GetMixerControl (USHORT usControl, PULONG pulValue)
/////////////////////////////////////////////////////////////////////////////
{
switch (usControl)
{
case CONTROL_DIGITAL_FORMAT:
*pulValue = GetFormat ();
break;
case CONTROL_SRC_MODE:
*pulValue = GetSRCMode ();
break;
case CONTROL_SRC_RATIO:
return (GetSRCRatio (pulValue));
case CONTROL_DIGITALIN_RATE:
return (GetInputSampleRate ((PLONG) pulValue));
case CONTROL_DIGITALIN_MUTE_ON_ERROR:
*pulValue = GetInputMuteOnError ();
break;
case CONTROL_DIGITALIN_STATUS:
return (GetInputStatus (pulValue));
case CONTROL_DIGITALOUT_STATUS:
*pulValue = GetOutputStatus ();
break;
#ifdef USE_RESET_ON_UNLOCK
case CONTROL_RESET_DIGITALIO_LOCK:
*pulValue = m_bResetDigitalIOLock;
break;
#endif
default:
return (HSTATUS_INVALID_MIXER_CONTROL);
}
return (HSTATUS_OK);
}
/////////////////////////////////////////////////////////////////////////////
USHORT
CHal8420::Service ()
// called by the ISR to service the 8420
/////////////////////////////////////////////////////////////////////////////
{
#ifdef USE_RESET_ON_UNLOCK
BYTE ucInterrupt1Status = 0; //, ucInterrupt2Status;
//DC('8');
//cmn_err(CE_WARN,"CHal8420::Service\n");
// go read both interrupt status registers
// TODO: This read really needs to happen before we read the MISTAT register,
// otherwise the hardware will generate another interrupt for no reason.
// This read is happening from the ISR level (not DPC), so any code that is running
// at DPC level is going to get pre-empted by this code, and potentially cause a problem
// on the PCI bus. In any case, this read can fail if some other code is running
// and IORead or IOWrite right now, so that will also cause a problem because this
// read MUST actually hit the hardware for the 8420 to stop interrupting.
// if the foreground is actively doing IOWrites, we wait here until that process is complete
if (m_lInIOActive)
{
cmn_err (CE_WARN, "ACTIVE!\n");
}
// this while loop is dangerous because it may lockup the machine on single processor computers
while (m_lInIOActive)
;
while (Read (k8420Interrupt1Status, &ucInterrupt1Status) != HSTATUS_OK)
;
//Read( k8420Interrupt2Status, &ucInterrupt2Status );
if (!ucInterrupt1Status) //&& !ucInterrupt2Status )
{
//DC('!');
return (HSTATUS_INVALID_PARAMETER);
}
//DC('<'); DX8( ucInterrupt1Status, COLOR_NORMAL ); DC(' '); DX8( ucInterrupt2Status, COLOR_NORMAL ); DC(' ');
//cmn_err(CE_WARN,"CHal8420::Service %02x %02x\n", ucInterrupt1Status, ucInterrupt2Status );
/*
if( ucInterrupt1Status & k8420_Int1_EFTC ) // E to F Transfer C bit (Transmitter)
{
// This is now a one-shot interrupt. Everytime the the CS data to
// transmit changes we disable the DtoE transfers, write the transmit
// data, enable the EtoF transfer and wait for it to complete. This
// interrupt comes in when the EtoF transfer is complete and we can
// resume normal operation.
//cmn_err(CE_WARN,"8420: E to F Transfer\n");
DC('f');
// inhibit another E to F transfer
// enable D to E transfer
Write( k8420CSDataBufferControl, k8420_CsDB_EFTCI, (k8420_CsDB_EFTCI | k8420_CsDB_DETCI) );
}
if( ucInterrupt1Status & k8420_Int1_DETC ) // D to E Transfer C bit (Receiver)
{
// This interrupt should never come in...
//cmn_err(CE_WARN,"8420: D to E Transfer\n");
DC('d');
// This interrupt occurs every 192 AES3 frames which is
// 229.69 times a second at 44.1kHz (4.35ms) and
// 500 times a second at 96kHz (2ms).
// inhibit another D to E transfer
//Write( k8420CSDataBufferControl, k8420_CsDB_DETCI, k8420_CsDB_DETCI );
// read the receivers C bit data
//ReadCUBuffer( m_RxCBuffer );
// write the transmitters C bit data
//WriteCUBuffer( m_TxCBuffer );
// enable E to F transfer
//Write( k8420CSDataBufferControl, (BYTE)0, k8420_CsDB_EFTCI );
//Write( k8420Interrupt1Mask, (k8420_Int1_EFTC), (k8420_Int1_EFTC | k8420_Int1_DETC) );
}
*/
if (ucInterrupt1Status & k8420_Int1_RERR)
{
UpdateStatus (TRUE);
}
/*
if( ucInterrupt2Status & k8420_Int2_QCH )
{
//cmn_err(CE_WARN,"8420: Q-Subcode\n");
DC('q');
// handle the Q-Subcode interrupt.
// This interrupt occurs every 588 AES3 frames which is
// 75 times a second at 44.1kHz (13.33ms) and
// 163.27 times a second at 96kHz (6.125ms).
// read just the first byte to see if this is valid sub-code
//Read( k8420QSubCodeData, (PBYTE)&m_QSubcode );
//if( m_QSubcode.ucAddrCntl == 0x01 )
//{
// Read( k8420QSubCodeData, (PBYTE)&m_QSubcode, sizeof( QCHANNELSUBCODE ) );
// TODO: alert the driver that a mixer control has changed...
//cmn_err(CE_WARN,"A %02x T %02x I %02x %02x:%02x:%02x %02x:%02x:%02x \r",
// m_QSubcode.ucAddrCntl, m_QSubcode.ucTrack, m_QSubcode.ucIndex,
// m_QSubcode.ucMinute, m_QSubcode.ucSecond, m_QSubcode.ucFrame,
// m_QSubcode.ucABSMinute, m_QSubcode.ucABSSecond, m_QSubcode.ucABSFrame );
//}
}
*/
#endif // USE_RESET_ON_UNLOCK
//DC('>');
return (HSTATUS_OK);
}
|