18c2ecf20Sopenharmony_ci=================================
28c2ecf20Sopenharmony_ciNotes on Maya44 USB Audio Support
38c2ecf20Sopenharmony_ci=================================
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci.. note::
68c2ecf20Sopenharmony_ci   The following is the original document of Rainer's patch that the
78c2ecf20Sopenharmony_ci   current maya44 code based on.  Some contents might be obsoleted, but I
88c2ecf20Sopenharmony_ci   keep here as reference -- tiwai
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciFeb 14, 2008
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ciRainer Zimmermann <mail@lightshed.de>
138c2ecf20Sopenharmony_ci 
148c2ecf20Sopenharmony_ciSTATE OF DEVELOPMENT
158c2ecf20Sopenharmony_ci====================
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ciThis driver is being developed on the initiative of Piotr Makowski (oponek@gmail.com) and financed by Lars Bergmann.
188c2ecf20Sopenharmony_ciDevelopment is carried out by Rainer Zimmermann (mail@lightshed.de).
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ciESI provided a sample Maya44 card for the development work.
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciHowever, unfortunately it has turned out difficult to get detailed programming information, so I (Rainer Zimmermann) had to find out some card-specific information by experiment and conjecture. Some information (in particular, several GPIO bits) is still missing.
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ciThis is the first testing version of the Maya44 driver released to the alsa-devel mailing list (Feb 5, 2008).
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ciThe following functions work, as tested by Rainer Zimmermann and Piotr Makowski:
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci- playback and capture at all sampling rates
308c2ecf20Sopenharmony_ci- input/output level
318c2ecf20Sopenharmony_ci- crossmixing
328c2ecf20Sopenharmony_ci- line/mic switch
338c2ecf20Sopenharmony_ci- phantom power switch
348c2ecf20Sopenharmony_ci- analogue monitor a.k.a bypass
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ciThe following functions *should* work, but are not fully tested:
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci- Channel 3+4 analogue - S/PDIF input switching
408c2ecf20Sopenharmony_ci- S/PDIF output
418c2ecf20Sopenharmony_ci- all inputs/outputs on the M/IO/DIO extension card
428c2ecf20Sopenharmony_ci- internal/external clock selection
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci*In particular, we would appreciate testing of these functions by anyone who has access to an M/IO/DIO extension card.*
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ciThings that do not seem to work:
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci- The level meters ("multi track") in 'alsamixer' do not seem to react to signals in (if this is a bug, it would probably be in the existing ICE1724 code).
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci- Ardour 2.1 seems to work only via JACK, not using ALSA directly or via OSS. This still needs to be tracked down.
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ciDRIVER DETAILS
568c2ecf20Sopenharmony_ci==============
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_cithe following files were added:
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci* pci/ice1724/maya44.c - Maya44 specific code
618c2ecf20Sopenharmony_ci* pci/ice1724/maya44.h
628c2ecf20Sopenharmony_ci* pci/ice1724/ice1724.patch
638c2ecf20Sopenharmony_ci* pci/ice1724/ice1724.h.patch - PROPOSED patch to ice1724.h (see SAMPLING RATES)
648c2ecf20Sopenharmony_ci* i2c/other/wm8776.c - low-level access routines for Wolfson WM8776 codecs 
658c2ecf20Sopenharmony_ci* include/wm8776.h
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ciNote that the wm8776.c code is meant to be card-independent and does not actually register the codec with the ALSA infrastructure.
698c2ecf20Sopenharmony_ciThis is done in maya44.c, mainly because some of the WM8776 controls are used in Maya44-specific ways, and should be named appropriately.
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_cithe following files were created in pci/ice1724, simply #including the corresponding file from the alsa-kernel tree:
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci* wtm.h
758c2ecf20Sopenharmony_ci* vt1720_mobo.h
768c2ecf20Sopenharmony_ci* revo.h
778c2ecf20Sopenharmony_ci* prodigy192.h
788c2ecf20Sopenharmony_ci* pontis.h
798c2ecf20Sopenharmony_ci* phase.h
808c2ecf20Sopenharmony_ci* maya44.h
818c2ecf20Sopenharmony_ci* juli.h
828c2ecf20Sopenharmony_ci* aureon.h
838c2ecf20Sopenharmony_ci* amp.h
848c2ecf20Sopenharmony_ci* envy24ht.h
858c2ecf20Sopenharmony_ci* se.h
868c2ecf20Sopenharmony_ci* prodigy_hifi.h
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci*I hope this is the correct way to do things.*
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ciSAMPLING RATES
938c2ecf20Sopenharmony_ci==============
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ciThe Maya44 card (or more exactly, the Wolfson WM8776 codecs) allow a maximum sampling rate of 192 kHz for playback and 92 kHz for capture.
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ciAs the ICE1724 chip only allows one global sampling rate, this is handled as follows:
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci* setting the sampling rate on any open PCM device on the maya44 card will always set the *global* sampling rate for all playback and capture channels.
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci* In the current state of the driver, setting rates of up to 192 kHz is permitted even for capture devices.
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci*AVOID CAPTURING AT RATES ABOVE 96kHz*, even though it may appear to work. The codec cannot actually capture at such rates, meaning poor quality.
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ciI propose some additional code for limiting the sampling rate when setting on a capture pcm device. However because of the global sampling rate, this logic would be somewhat problematic.
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ciThe proposed code (currently deactivated) is in ice1712.h.patch, ice1724.c and maya44.c (in pci/ice1712).
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ciSOUND DEVICES
1128c2ecf20Sopenharmony_ci=============
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ciPCM devices correspond to inputs/outputs as follows (assuming Maya44 is card #0):
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci* hw:0,0 input - stereo, analog input 1+2
1178c2ecf20Sopenharmony_ci* hw:0,0 output - stereo, analog output 1+2
1188c2ecf20Sopenharmony_ci* hw:0,1 input - stereo, analog input 3+4 OR S/PDIF input
1198c2ecf20Sopenharmony_ci* hw:0,1 output - stereo, analog output 3+4 (and SPDIF out)
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ciNAMING OF MIXER CONTROLS
1238c2ecf20Sopenharmony_ci========================
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci(for more information about the signal flow, please refer to the block diagram on p.24 of the ESI Maya44 manual, or in the ESI windows software).
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ciPCM
1298c2ecf20Sopenharmony_ci    (digital) output level for channel 1+2
1308c2ecf20Sopenharmony_ciPCM 1
1318c2ecf20Sopenharmony_ci    same for channel 3+4
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ciMic Phantom+48V
1348c2ecf20Sopenharmony_ci    switch for +48V phantom power for electrostatic microphones on input 1/2.
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci    Make sure this is not turned on while any other source is connected to input 1/2.
1378c2ecf20Sopenharmony_ci    It might damage the source and/or the maya44 card.
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ciMic/Line input
1408c2ecf20Sopenharmony_ci    if switch is on, input jack 1/2 is microphone input (mono), otherwise line input (stereo).
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ciBypass
1438c2ecf20Sopenharmony_ci    analogue bypass from ADC input to output for channel 1+2. Same as "Monitor" in the windows driver.
1448c2ecf20Sopenharmony_ciBypass 1
1458c2ecf20Sopenharmony_ci    same for channel 3+4.
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ciCrossmix
1488c2ecf20Sopenharmony_ci    cross-mixer from channels 1+2 to channels 3+4
1498c2ecf20Sopenharmony_ciCrossmix 1
1508c2ecf20Sopenharmony_ci    cross-mixer from channels 3+4 to channels 1+2
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ciIEC958 Output
1538c2ecf20Sopenharmony_ci    switch for S/PDIF output.
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci    This is not supported by the ESI windows driver.
1568c2ecf20Sopenharmony_ci    S/PDIF should output the same signal as channel 3+4. [untested!]
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ciDigitial output selectors
1608c2ecf20Sopenharmony_ci    These switches allow a direct digital routing from the ADCs to the DACs.
1618c2ecf20Sopenharmony_ci    Each switch determines where the digital input data to one of the DACs comes from.
1628c2ecf20Sopenharmony_ci    They are not supported by the ESI windows driver.
1638c2ecf20Sopenharmony_ci    For normal operation, they should all be set to "PCM out".
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ciH/W
1668c2ecf20Sopenharmony_ci    Output source channel 1
1678c2ecf20Sopenharmony_ciH/W 1
1688c2ecf20Sopenharmony_ci    Output source channel 2
1698c2ecf20Sopenharmony_ciH/W 2
1708c2ecf20Sopenharmony_ci    Output source channel 3
1718c2ecf20Sopenharmony_ciH/W 3
1728c2ecf20Sopenharmony_ci    Output source channel 4
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ciH/W 4 ... H/W 9
1758c2ecf20Sopenharmony_ci    unknown function, left in to enable testing.
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci    Possibly some of these control S/PDIF output(s).
1788c2ecf20Sopenharmony_ci    If these turn out to be unused, they will go away in later driver versions.
1798c2ecf20Sopenharmony_ci
1808c2ecf20Sopenharmony_ciSelectable values for each of the digital output selectors are:
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ciPCM out
1838c2ecf20Sopenharmony_ci	DAC output of the corresponding channel (default setting)
1848c2ecf20Sopenharmony_ciInput 1 ... Input 4
1858c2ecf20Sopenharmony_ci	direct routing from ADC output of the selected input channel
1868c2ecf20Sopenharmony_ci
187