Coder Social home page Coder Social logo

redchenjs / mt762x-wm8960 Goto Github PK

View Code? Open in Web Editor NEW
26.0 3.0 22.0 1.46 MB

MT762X WM8960 ALSA SoC machine driver

License: GNU General Public License v2.0

Makefile 24.30% C 75.70%
wm8960 kernel dts openwrt alsa asoc mt7628 mt7688 mt762x mt76x8

mt762x-wm8960's Introduction

MT762X WM8960 ALSA SoC machine driver

ALSA SoC machine driver for MT762X SoCs with WM8960 CODEC chip.

Requirements

  • OpenWrt with kernel 5.10 or later.

Preparing

  • Add the mt762x-wm8960 folder to the package/kernel folder of OpenWrt.
cd package/kernel
git clone https://github.com/redchenjs/mt762x-wm8960.git
  • Modify the target DTS file in the target/linux/ramips/dts folder of OpenWrt according to the example DTS files.

WM8960 MCLK

WM8960 can get MCLK from an externel clock source or the refclk output of MT762X SoCs (12MHz). To enable the refclk output, you can modify the dts file as follows:

refclk {
	groups = "refclk";
	function = "refclk";
};

WM8960 ADCLRC

WM8960 can internally get ADCLRC from DACLRC and the ADCLRC pin can be used as GPIO1. It is useful for some boards that only have the DACLRC pin connected and the ADCLRC pin is left floating. To enable this feature, modify the dts file as follows:

codec: wm8960@1a {
	compatible = "wlf,wm8960";
	reg = <0x1a>;
	wlf,shared-lrclk;
	wlf,hp-cfg = <0 0 0>;
	wlf,gpio-cfg = <1 0>;
};

Configuring the OpenWrt

make menuconfig

Kernel modules:

  • Navigate to > Kernel modules > Sound Support.
  • Select kmod-sound-core and kmod-sound-mt762x-wm8960.

Userspace tools:

  • Navigate to > Sound and select alsa-utils.

Building the image

make -j9 V=s

Settings

Examples of /etc/asound.conf:

  • examples/asound.conf.alsa for ALSA only.
  • examples/asound.conf.pulse for PulseAudio.

After restarting, the output of WM8960 is muted. Use these commands to set the volume.

amixer sset "Headphone" 90
amixer sset "Speaker" 90

Playback

amixer sset "Left Output Mixer PCM" on
amixer sset "Right Output Mixer PCM" on

Capture

amixer sset "Left Input Mixer Boost" on
amixer sset "Right Input Mixer Boost" on
amixer sset "ALC Function" "Stereo"

References

WM8960 block diagram

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.