Linux system wm9713 sound card configuration record

Source: Internet
Author: User

Recently engaged in the wm9713 of the external audio playback and the detection of headphones, engaged in a few days to hope that the final fix. For example, the Development Board is real210 v6.2 version number:

Assuming that you want to make the external sound output, then ensure that the value of the wm9713 0x1c Register is 0x1200, the headphone output is 0x00a0, of course, the two can also output at the same time, the value is 0x12a0.

Also set the Ac97_extended_mstatus register (that is, the 0x3e register), set the value of 0xb900 (turn on the speaker output enable, the 7th, 8-bit control horn 9, 10-bit control headphones, set to 0 to open).

Of course the volume setting is also required Ac97_master (0x02) Set the external tone volume, Ac97_headphone (0x04) Set the headphone volume, my value here is set for 0x0000 and 0x0606, where 0x0000 is the maximum sound.

To have a headset test, then also set two registers (other development boards may be measured by the CPU to see if there is a headphone insertion, which is measured by wm9713 itself, the CPU does not intervene) ac97_int_paging and Ac97_additional_ FUNC1 (i.e., 0x24 and 0x5a), the values are 0x10 and 0x40 respectively.

The entire function of these settings is posted below, which can be used directly (the wm9713.c file under the Codecs folder):

 #define AC97_ additional_func10x5astatic int wm9713_hifi_hw_params (struct snd_pcm_substream *substream,struct snd_pcm_hw_params * Params,struct Snd_soc_dai *dai) {struct Snd_soc_codec *codec = Dai->codec;ac97_write (codec, Ac97_powerdown, 0x0000); Ac97_write (codec, Ac97_phone, 0x0808); Ac97_write (codec, Ac97_extended_mid, 0xf803); Ac97_write (codec, ac97_extended_ Mstatus, 0xb900);//here to turn on the horn output Enable, 7th, 8-bit control horn 9, 10-bit control headphones, set to 0 for the open ac97_write (codec, Ac97_master, 0x0000); Ac97_write (codec, Ac97_headphone, 0x0606); Ac97_write (codec, Ac97_rec_gain, 0x12a0)//0x00a0 headphone output 0x1200 horn output ac97_write (codec, Ac97_int_ PAGING, 0x10);//enable headphones to insert a test ac97_write (codec, ac97_additional_func1, 0x40);//Set up a test headset inserted ioport#ifdef config_sound_wm9713 _input_stream_micac97_write (codec, 0x5c, 0x0002); Ac97_write (codec, Ac97_line, 0x0068); Ac97_write (codec, Ac97_video, 0xfe00); #elseac97_write (codec, Ac97_video, 0xd612); #endifreturn 0;} 
static struct SND_SOC_DAI_ Ops Wm9713_dai_ops_hifi = {. hw_params= wm9713_hifi_hw_params,.prepare= ac97_hifi_prepare,.set_clkdiv= Wm9713_set_dai _clkdiv,.set_pll= WM9713_SET_DAI_PLL,}; 


 

Linux system wm9713 sound card configuration record

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.