Sunday, March 31, 2013

Measy U2C / B12 / NX003II Linux Microphone and Audio Out

As you may already know, the Measy U2C Android stick (AFAIK same hardware as Kimdecent B12 and NX003II sticks) contains an A/V Out (right besides the HDMI connector, in the picture below) and an integrated digital microphone (MIC in the picture below).

You can insert the typical stereo headphones jack into the A/V out and listen to music from there, in case your screen doesn't have HDMI audio, like my PC monitor.





However, if you want to use the mic and headphones from Linux (i.e. Picuntu) you will need to recompile the kernel (actually quite easy) enabling the following options in the ".config" file at the kernel source's root path.

Where it says (each line is in a different part, and the last may not be there at all):
# CONFIG_MFD_RK1000 is not set
# CONFIG_SND_RK29_SOC_RK1000 is not set
# CONFIG_SND_SOC_RK1000 is not set
and make them be (add if necessary):

CONFIG_MFD_RK1000=y
CONFIG_SND_RK29_SOC_RK1000=y
CONFIG_SND_SOC_RK1000=y
Compile and flash. Once Linux boots, open a terminal and type:
alsamixer -c 0 -V capture
You should see the microphone input, make sure the volume is at an adequate level, then exit and type:
arecord -f cd -D hw:0,0 test.wav
Hit enter and speak to the MIC, hit Ctrl-C to stop it and enter:
aplay test.wav
And you should hear the mono sound you have just recorded.

From XFCE I use PulseAudio's Volume Control app to select the headphone output, instead of HDMI, try it if you don't get to hear anything.

One step closer to full Linux support!! :)


UPDATE: The command to set PulseAudio's volume to a lower level, from the command-line, is:
pacmd set-sink-volume alsa_output.platform-soc-audio.analog-stereo 0x4500
I came up with this since the volume at start-up is very loud, though I still don't know where exactly to place this command in the startup sequence so it takes effect after PulseAudio is loaded.


References:

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.