Setting up ALSA on Chromebook Asus C201 Debian

ALSA – Advanced Linux Sound Architecture

After initial preparation of the bootable Debian images, I managed to boot into Debian from the SD card and run system upgrade and migrate the Operating System from Debian Jessie to Debian Stretch (current Debian testing release). The migration was successful. There are a few things that still require tuning on this laptop, one of them is the ALSA (Advanced Linux Sound Architecture) system. Before proceeding with ALSA settings, there are a few things worth mentioning. The default installation doesn’t provide the working ALSA subsystem, and it can be “unsafe” (see disclaimer on the bottom of this article) if you try using the sound system without the correct system configuration, as you might even damage or ruin the speakers. So to begin with the settings:

First we will install the base of the ALSA packages, alsamixer for tuning the settings and pavucontrol monitor for setting additonal pulseaudio values:

  • aptitude install alsa-utils alsamixergui pulseaudio pulseaudio-utils pavucontrol

We start with configuration of the ALSA values by using the “amixer” entries. It’s advisable to copy all these values inside the script, so they can be executed after reboot in case of configuration loss. We will be using program “amixer” with “-Dhw” parameter and “ROCKCHIPI2S” is the device name we’re setting up. You can ignore the error “shared memfd open() failed: Function not implemented” if it appears. It is something related to the Linux kernel settings, which cannot be alternated inside the current running kernel. Apply the settings below as root or use “sudo” from the user account.

amixer -Dhw:ROCKCHIPI2S cset name=’Left Speaker Mixer Left DAC Switch’ on
amixer -Dhw:ROCKCHIPI2S cset name=’Right Speaker Mixer Right DAC Switch’ on
amixer -Dhw:ROCKCHIPI2S cset name=’Headphone Left Switch’ off
amixer -Dhw:ROCKCHIPI2S cset name=’Headphone Right Switch’ off
amixer -Dhw:ROCKCHIPI2S cset name=’Digital EQ 3 Band Switch’ off
amixer -Dhw:ROCKCHIPI2S cset name=’Digital EQ 5 Band Switch’ off
amixer -Dhw:ROCKCHIPI2S cset name=’Digital EQ 7 Band Switch’ off
amixer -Dhw:ROCKCHIPI2S cset name=’Biquad Switch’ off
amixer -Dhw:ROCKCHIPI2S cset name=’Filter Mode’ Music
amixer -Dhw:ROCKCHIPI2S cset name=’ADC Oversampling Rate’ 0
amixer -Dhw:ROCKCHIPI2S cset name=’DMIC Mux’ DMIC
amixer -Dhw:ROCKCHIPI2S cset name=’MIC2 Mux’ IN34
amixer -Dhw:ROCKCHIPI2S cset name=’Right ADC Mixer MIC2 Switch’ on
amixer -Dhw:ROCKCHIPI2S cset name=’Left ADC Mixer MIC2 Switch’ on
amixer -Dhw:ROCKCHIPI2S cset name=’MIC2 Volume’ 20
amixer -Dhw:ROCKCHIPI2S cset name=’Headset Mic Switch’ off
amixer -Dhw:ROCKCHIPI2S cset name=’Int Mic Switch’ on
amixer -Dhw:ROCKCHIPI2S cset name=’ADCR Boost Volume’ 4
amixer -Dhw:ROCKCHIPI2S cset name=’ADCL Boost Volume’ 4
amixer -Dhw:ROCKCHIPI2S cset name=’ADCR Volume’ 11
amixer -Dhw:ROCKCHIPI2S cset name=’ADCL Volume’ 11
amixer -Dhw:ROCKCHIPI2S cset name=’Left Speaker Mixer Left DAC Switch’ on
amixer -Dhw:ROCKCHIPI2S cset name=’Right Speaker Mixer Right DAC Switch’ on
amixer -Dhw:ROCKCHIPI2S cset name=’Speaker Left Mixer Volume’ 2
amixer -Dhw:ROCKCHIPI2S cset name=’Speaker Right Mixer Volume’ 2
amixer -Dhw:ROCKCHIPI2S cset name=’Record Path DC Blocking’ on
amixer -Dhw:ROCKCHIPI2S cset name=’Playback Path DC Blocking’ on
amixer -Dhw:ROCKCHIPI2S cset name=’Speaker Left Switch’ on
amixer -Dhw:ROCKCHIPI2S cset name=’Speaker Right Switch’ on
amixer -Dhw:ROCKCHIPI2S cset name=’Speaker Switch’ on

After implementing these values, the sound system should be ready. Test if there is any sound coming from the speakers by playing a .wav file on your computer. You can do this with the program “aplay”. There is a short manual for soundcard testing.

  • aplay -vv soundfile.wav

If this command gives you a visualisation of playing graphics inside the terminal but not producing the actual sound from the speakers, you can continue with sound test outside of “pulseaudio” mode with:

  • pasuspender — speaker-test -c2 -twav -l3 -Dhw:ROCKCHIPI2S

This should produce the sound in your speakers by a voice saying “Front left (on the left speaker) and front right (on the right speaker)”. You should probably hear this. This means that the hardware itself works and it could also mean that the pulseaudio is doing something strange not to hear the sound by using “aplay”. Next thing you could try is using pavucontrol GUI, which is the main pulseaudio configuration tool. Look at the picture below and match your settings similar to it, focus on the “Output devices” section and make sure the output device is selected as your fallback device and that it is not muted. Start “pavucontrol” as root and a GUI will open a similar image like the one below:

Select the bottom output device where it says “ROCKCHIP-I2S Analog Stereo” click on the speaker button to mute it and then again to unmute the device (just to be sure) and click the green button on the right side where is the setting for setting default output device. This worked for me and I was able to hear the sound coming out from the speakers.

The last thing which you need to apply is storing the ALSA values permanently into the system which will also work after reboot.

You can do this as root just type:

  • alsactl store

Alternative thing if “alsactl store” doesn’t save the values for you, you can still save the settings for ALSA inside the script with:

  • alsactl –file ~/.config/asound.state store

Which you reload after reboot with:

  • alsactl –file ~/.config/asound.state restore

That’s about it.

Disclaimer

Be sure to read the disclaimer before proceeding with the installation.


Posted

in

, , , ,

by

Tags:

Comments

One response to “Setting up ALSA on Chromebook Asus C201 Debian”

  1. ao2 Avatar

    Hey Jan,

    I don’t have a C201, but in general, for such complex mixer settings it’s safer to use Alsa UCM (Use Case Manager).

    Here it says that you can take the UCM config from the Chromium OS filesystem:
    https://wiki.debian.org/InstallingDebianOn/Asus/C201#Audio

    However that may not even be necessary, it looks like the UCM files for the rockchip device are already upstream in alsa-lib but they have been renamed from ROCKCHIP-I2S to VEYRON-I2S: http://www.alsa-project.org/main/index.php/Changes_v1.1.1_v1.1.2

    If you have /usr/share/alsa/ucm/VEYRON-I2S, just try something like:
    alsaucm -c -VEYRON-I2S set _verb HiFi

    It that does not work check with the alsa devs.

    Ciao,
    Antonio

Leave a Reply

Your email address will not be published. Required fields are marked *