[alsa-devel] ESI Maya44 PCI – mixer code errors
Hello!
In the current release of ESI Maya44 PCI ALSA driver (1.0.23) selection of “Mic In” capture source is impossible. “Microphone” check in the “Switches “ mixer tab actually does not select anything – no recording audio at all, and the Phantom power switch does not perform correctly too.
Original, Rainer Zimmermann patch (for ALSA 1.0.19) performs well, but can`t be compiled with the current ALSA and kernel26. Sadly...
I've look into current, rewritten, code in the file ./alsa-driver-1.0.23/alsa-kernel/pci/ice1712/maya44.c
and found some interesting details. Further, I've add some changes, and “Mic In” selection now works, but only partially. (Below)
In the original maya44.c file, from Rainer Zimmermann patch, some definitions of I/O flags seems as a simple mask: #define GPIO_PHANTOM_OFF (1<<2) #define GPIO_MIC_RELAY (1<<4) #define GPIO_SPDIF_IN_INV (1<<5) /* CHECK! */ #define GPIO_MUST_BE_0 (1<<7)
Current branch of Maya44 code is rewritten, and these definitions look like the indexes #define GPIO_PHANTOM_OFF 2 #define GPIO_MIC_RELAY 4 #define GPIO_SPDIF_IN_INV 5 #define GPIO_MUST_BE_0 7
So, at the row 396 of the current branch - maya44.c
changed = maya_set_gpio_bits(chip->ice, GPIO_MIC_RELAY,
sel ? GPIO_MIC_RELAY : 0);
I change this code to:
changed = maya_set_gpio_bits(chip->ice, (1 << GPIO_MIC_RELAY),
sel ? (1 << GPIO_MIC_RELAY) : 0);
And finally, at the row 348 of the current maya44.c
/* known working input slots (0-4) */
#define MAYA_LINE_IN 1 /* in-2 */
#define MAYA_MIC_IN 4 /* in-5 */
but usable channels are 2 and 4 (from datasheet), therefore I change defines to
#define MAYA_LINE_IN 1 /* in-2 */
#define MAYA_MIC_IN 3 /* in-4 */
After that, we can get some usability from mixer.
Now, the “Microphone” check can select “Mic In”, and real audio path from microphone to ADC works! But only once. After that, in the “Capture” tab of mixer, “Mute” knob visually change state to muted. Some kind of strange cross influence between mixer tabs :-) Pressing to this “Mute” knob switches back “Mic In” capture source to “Line”, and clear Phantom Power check. (Very strange) And finally, if we check “Microphone” again - “Mic In” became selected again, and “Mute” enter in “unpressed” state again too. But microphone capture became again operable. Circle is closed.
Excuse me for some kind of messed story and poor English (my native is Russian), but such description of mixer behavior maybe useful for understanding...
I can't resolve more mistakes in the code. Perhaps, author can do it more better than me.
I have a hardware – ESI Maya44 PCI audio board installed to working and usable Arch Linux i686 system. I'm ready for testing, and glad to do it!
Sincerely Alex Chernyshoff
At Wed, 12 May 2010 00:54:12 +0400, Alex Chernyshoff wrote:
Hello!
In the current release of ESI Maya44 PCI ALSA driver (1.0.23) selection of “Mic In” capture source is impossible. “Microphone” check in the “Switches “ mixer tab actually does not select anything – no recording audio at all, and the Phantom power switch does not perform correctly too.
Original, Rainer Zimmermann patch (for ALSA 1.0.19) performs well, but can`t be compiled with the current ALSA and kernel26. Sadly...
I've look into current, rewritten, code in the file ./alsa-driver-1.0.23/alsa-kernel/pci/ice1712/maya44.c
and found some interesting details. Further, I've add some changes, and “Mic In” selection now works, but only partially. (Below)
In the original maya44.c file, from Rainer Zimmermann patch, some definitions of I/O flags seems as a simple mask: #define GPIO_PHANTOM_OFF (1<<2) #define GPIO_MIC_RELAY (1<<4) #define GPIO_SPDIF_IN_INV (1<<5) /* CHECK! */ #define GPIO_MUST_BE_0 (1<<7)
Current branch of Maya44 code is rewritten, and these definitions look like the indexes #define GPIO_PHANTOM_OFF 2 #define GPIO_MIC_RELAY 4 #define GPIO_SPDIF_IN_INV 5 #define GPIO_MUST_BE_0 7
So, at the row 396 of the current branch - maya44.c
changed = maya_set_gpio_bits(chip->ice, GPIO_MIC_RELAY,
sel ? GPIO_MIC_RELAY : 0);
I change this code to:
changed = maya_set_gpio_bits(chip->ice, (1 << GPIO_MIC_RELAY),
sel ? (1 << GPIO_MIC_RELAY) : 0);
And finally, at the row 348 of the current maya44.c
/* known working input slots (0-4) */
#define MAYA_LINE_IN 1 /* in-2 */
#define MAYA_MIC_IN 4 /* in-5 */
but usable channels are 2 and 4 (from datasheet), therefore I change defines to
#define MAYA_LINE_IN 1 /* in-2 */
#define MAYA_MIC_IN 3 /* in-4 */
After that, we can get some usability from mixer.
Now, the “Microphone” check can select “Mic In”, and real audio path from microphone to ADC works! But only once. After that, in the “Capture” tab of mixer, “Mute” knob visually change state to muted. Some kind of strange cross influence between mixer tabs :-) Pressing to this “Mute” knob switches back “Mic In” capture source to “Line”, and clear Phantom Power check. (Very strange) And finally, if we check “Microphone” again - “Mic In” became selected again, and “Mute” enter in “unpressed” state again too. But microphone capture became again operable. Circle is closed.
Excuse me for some kind of messed story and poor English (my native is Russian), but such description of mixer behavior maybe useful for understanding...
I can't resolve more mistakes in the code. Perhaps, author can do it more better than me.
I have a hardware – ESI Maya44 PCI audio board installed to working and usable Arch Linux i686 system. I'm ready for testing, and glad to do it!
Thanks for good analysis. I fixed the driver code now as you suggested in the above on sound git tree.
Takashi
participants (2)
-
Alex Chernyshoff
-
Takashi Iwai