162306a36Sopenharmony_ci=================================
262306a36Sopenharmony_ciNotes on Maya44 USB Audio Support
362306a36Sopenharmony_ci=================================
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci.. note::
662306a36Sopenharmony_ci   The following is the original document of Rainer's patch that the
762306a36Sopenharmony_ci   current maya44 code based on.  Some contents might be obsoleted, but I
862306a36Sopenharmony_ci   keep here as reference -- tiwai
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ciFeb 14, 2008
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ciRainer Zimmermann <mail@lightshed.de>
1362306a36Sopenharmony_ci 
1462306a36Sopenharmony_ciSTATE OF DEVELOPMENT
1562306a36Sopenharmony_ci====================
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ciThis driver is being developed on the initiative of Piotr Makowski (oponek@gmail.com) and financed by Lars Bergmann.
1862306a36Sopenharmony_ciDevelopment is carried out by Rainer Zimmermann (mail@lightshed.de).
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ciESI provided a sample Maya44 card for the development work.
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_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.
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ciThis is the first testing version of the Maya44 driver released to the alsa-devel mailing list (Feb 5, 2008).
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ciThe following functions work, as tested by Rainer Zimmermann and Piotr Makowski:
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci- playback and capture at all sampling rates
3062306a36Sopenharmony_ci- input/output level
3162306a36Sopenharmony_ci- crossmixing
3262306a36Sopenharmony_ci- line/mic switch
3362306a36Sopenharmony_ci- phantom power switch
3462306a36Sopenharmony_ci- analogue monitor a.k.a bypass
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ciThe following functions *should* work, but are not fully tested:
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci- Channel 3+4 analogue - S/PDIF input switching
4062306a36Sopenharmony_ci- S/PDIF output
4162306a36Sopenharmony_ci- all inputs/outputs on the M/IO/DIO extension card
4262306a36Sopenharmony_ci- internal/external clock selection
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci*In particular, we would appreciate testing of these functions by anyone who has access to an M/IO/DIO extension card.*
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ciThings that do not seem to work:
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_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).
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci- Ardour 2.1 seems to work only via JACK, not using ALSA directly or via OSS. This still needs to be tracked down.
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ciDRIVER DETAILS
5662306a36Sopenharmony_ci==============
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_cithe following files were added:
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci* pci/ice1724/maya44.c - Maya44 specific code
6162306a36Sopenharmony_ci* pci/ice1724/maya44.h
6262306a36Sopenharmony_ci* pci/ice1724/ice1724.patch
6362306a36Sopenharmony_ci* pci/ice1724/ice1724.h.patch - PROPOSED patch to ice1724.h (see SAMPLING RATES)
6462306a36Sopenharmony_ci* i2c/other/wm8776.c - low-level access routines for Wolfson WM8776 codecs 
6562306a36Sopenharmony_ci* include/wm8776.h
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ciNote that the wm8776.c code is meant to be card-independent and does not actually register the codec with the ALSA infrastructure.
6962306a36Sopenharmony_ciThis is done in maya44.c, mainly because some of the WM8776 controls are used in Maya44-specific ways, and should be named appropriately.
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_cithe following files were created in pci/ice1724, simply #including the corresponding file from the alsa-kernel tree:
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci* wtm.h
7562306a36Sopenharmony_ci* vt1720_mobo.h
7662306a36Sopenharmony_ci* revo.h
7762306a36Sopenharmony_ci* prodigy192.h
7862306a36Sopenharmony_ci* pontis.h
7962306a36Sopenharmony_ci* phase.h
8062306a36Sopenharmony_ci* maya44.h
8162306a36Sopenharmony_ci* juli.h
8262306a36Sopenharmony_ci* aureon.h
8362306a36Sopenharmony_ci* amp.h
8462306a36Sopenharmony_ci* envy24ht.h
8562306a36Sopenharmony_ci* se.h
8662306a36Sopenharmony_ci* prodigy_hifi.h
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_ci*I hope this is the correct way to do things.*
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ciSAMPLING RATES
9362306a36Sopenharmony_ci==============
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_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.
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ciAs the ICE1724 chip only allows one global sampling rate, this is handled as follows:
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_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.
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ci* In the current state of the driver, setting rates of up to 192 kHz is permitted even for capture devices.
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_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.
10462306a36Sopenharmony_ci
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_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.
10762306a36Sopenharmony_ci
10862306a36Sopenharmony_ciThe proposed code (currently deactivated) is in ice1712.h.patch, ice1724.c and maya44.c (in pci/ice1712).
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci
11162306a36Sopenharmony_ciSOUND DEVICES
11262306a36Sopenharmony_ci=============
11362306a36Sopenharmony_ci
11462306a36Sopenharmony_ciPCM devices correspond to inputs/outputs as follows (assuming Maya44 is card #0):
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci* hw:0,0 input - stereo, analog input 1+2
11762306a36Sopenharmony_ci* hw:0,0 output - stereo, analog output 1+2
11862306a36Sopenharmony_ci* hw:0,1 input - stereo, analog input 3+4 OR S/PDIF input
11962306a36Sopenharmony_ci* hw:0,1 output - stereo, analog output 3+4 (and SPDIF out)
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci
12262306a36Sopenharmony_ciNAMING OF MIXER CONTROLS
12362306a36Sopenharmony_ci========================
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_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).
12662306a36Sopenharmony_ci
12762306a36Sopenharmony_ci
12862306a36Sopenharmony_ciPCM
12962306a36Sopenharmony_ci    (digital) output level for channel 1+2
13062306a36Sopenharmony_ciPCM 1
13162306a36Sopenharmony_ci    same for channel 3+4
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_ciMic Phantom+48V
13462306a36Sopenharmony_ci    switch for +48V phantom power for electrostatic microphones on input 1/2.
13562306a36Sopenharmony_ci
13662306a36Sopenharmony_ci    Make sure this is not turned on while any other source is connected to input 1/2.
13762306a36Sopenharmony_ci    It might damage the source and/or the maya44 card.
13862306a36Sopenharmony_ci
13962306a36Sopenharmony_ciMic/Line input
14062306a36Sopenharmony_ci    if switch is on, input jack 1/2 is microphone input (mono), otherwise line input (stereo).
14162306a36Sopenharmony_ci
14262306a36Sopenharmony_ciBypass
14362306a36Sopenharmony_ci    analogue bypass from ADC input to output for channel 1+2. Same as "Monitor" in the windows driver.
14462306a36Sopenharmony_ciBypass 1
14562306a36Sopenharmony_ci    same for channel 3+4.
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_ciCrossmix
14862306a36Sopenharmony_ci    cross-mixer from channels 1+2 to channels 3+4
14962306a36Sopenharmony_ciCrossmix 1
15062306a36Sopenharmony_ci    cross-mixer from channels 3+4 to channels 1+2
15162306a36Sopenharmony_ci
15262306a36Sopenharmony_ciIEC958 Output
15362306a36Sopenharmony_ci    switch for S/PDIF output.
15462306a36Sopenharmony_ci
15562306a36Sopenharmony_ci    This is not supported by the ESI windows driver.
15662306a36Sopenharmony_ci    S/PDIF should output the same signal as channel 3+4. [untested!]
15762306a36Sopenharmony_ci
15862306a36Sopenharmony_ci
15962306a36Sopenharmony_ciDigital output selectors
16062306a36Sopenharmony_ci    These switches allow a direct digital routing from the ADCs to the DACs.
16162306a36Sopenharmony_ci    Each switch determines where the digital input data to one of the DACs comes from.
16262306a36Sopenharmony_ci    They are not supported by the ESI windows driver.
16362306a36Sopenharmony_ci    For normal operation, they should all be set to "PCM out".
16462306a36Sopenharmony_ci
16562306a36Sopenharmony_ciH/W
16662306a36Sopenharmony_ci    Output source channel 1
16762306a36Sopenharmony_ciH/W 1
16862306a36Sopenharmony_ci    Output source channel 2
16962306a36Sopenharmony_ciH/W 2
17062306a36Sopenharmony_ci    Output source channel 3
17162306a36Sopenharmony_ciH/W 3
17262306a36Sopenharmony_ci    Output source channel 4
17362306a36Sopenharmony_ci
17462306a36Sopenharmony_ciH/W 4 ... H/W 9
17562306a36Sopenharmony_ci    unknown function, left in to enable testing.
17662306a36Sopenharmony_ci
17762306a36Sopenharmony_ci    Possibly some of these control S/PDIF output(s).
17862306a36Sopenharmony_ci    If these turn out to be unused, they will go away in later driver versions.
17962306a36Sopenharmony_ci
18062306a36Sopenharmony_ciSelectable values for each of the digital output selectors are:
18162306a36Sopenharmony_ci
18262306a36Sopenharmony_ciPCM out
18362306a36Sopenharmony_ci	DAC output of the corresponding channel (default setting)
18462306a36Sopenharmony_ciInput 1 ... Input 4
18562306a36Sopenharmony_ci	direct routing from ADC output of the selected input channel
18662306a36Sopenharmony_ci
187