Optically detected magnetic-resonance (ODMR) experiments have been performed on n-doped epitaxial layers of AlAs and AlxGa1-xAs with x0.35 grown on (001) GaAs substrates. The AlxGa1-xAs layers were doped during growth or via implantation with Si and Sn impurities from group IV and S, Se, and Te impurities from group VI. The studies were carried out with the as-grown layers on the parent GaAs substrates, removed from the substrates, and attached to substrates with larger lattice constants at low temperatures. Symmetry information was obtained from angular-rotation studies with the magnetic field rotated in the (11»0) and (001) crystal planes. Also, uniaxial stress along the [11»0] and  directions has been combined with ODMR to further probe the symmetry of the donor states. The magnetic resonance was detected mainly on deep (1.01.8 m) radiative-recombination processes. The donor state in Si-doped AlAs can be described by the usual hydrogenic effective-mass theory for substitutional donors on the group-III site associated with the X-point conduction-band minima. The g-value anisotropy and splitting observed from the rotation studies in the (11»0) and (001) planes, respectively, can be understood using an independent-valley model. The Si-donor g values in AlAs are the following: g=1.976±0.001 and g?=1.917±0.001 with respect to the long axes of the X-valley ellipsoid. The results obtained for the AlxGa1-xAs layers doped with S, Se, and Te, particularly for samples with x0.6, can be described by the hydrogenic effective-mass theory modified by a finite valley-orbit (i.e., central cell) interaction that mixes the states derived from the Xx, Xy, and Xz valleys to form an A1 ground state, as predicted by Morgan. Analyses of these results within the virtual-crystal approximation yield valley-orbit splitting energies (i.e., chemical shifts) of 16 20 meV for these group-VI donors in Al0.6Ga0.4As. The nature of the donor states in the Si-doped AlxGa1-xAs heterostructures with x<1 is more complicated. The monotonic decrease in both the g-value anisotropy and splitting with decreasing Al mole fraction and the increase in the linewidth of the donor resonances from 7 mT for AlAs:Si to 14 mT for Al0.4Ga0.6As:Si indicate a breakdown of the independent-valley model employed to describe the symmetry of the donor ground state in Si-doped AlAs. Various mechanisms that can potentially influence the properties of the donor ground state in Si-doped AlxGa1-xAs with x<1, such as a finite spin-valley interaction, L-X (or -X) interband mixing, and alloy disorder, are discussed. The results for the Sn-doped AlAs and AlxGa1-xAs/GaAs heterostructures provide evidence that the optically active states revealed in these studies are much deeper compared to the Si donor states. © 1991 The American Physical Society.