redchenjs / mt762x-wm8960

MT762X WM8960 ALSA SoC machine driver
GNU General Public License v2.0
27 stars 22 forks source link

mono sound fault #7

Closed hnhkj closed 3 years ago

hnhkj commented 3 years ago

Hi redchenjs

When I running follow command. I get a error message. I will how to do let it support mono sound? or it's dont support mono sound?

root@OpenWrt:~/wav# arecord -Dhw:0 -f cd -r 8000 -c 1 -t wav /tmp/rec.wav
Recording WAVE '/tmp/rec.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
arecord: set_params:1349: Channels count non available
redchenjs commented 3 years ago

Hi @hnhkj,

The number of channels is limited by ralink-i2s driver, it only supports 2-channel mode.

Screenshot

You can use these commands to fill two channels with data from the left or right ADC:

amixer sset "ALC Function" "Left"
amixer sset "ADC Data Output Select" "Left Data = Left ADC;  Right Data = Left ADC"
hnhkj commented 3 years ago

thanks

redchenjs commented 3 years ago

Hi @hnhkj,

You can use this patch to enable mono sound by hacking the ralink-i2s driver.

999-ralink-i2s-mono-sound.zip

According to your kernel version, put the patch file into target/linux/ramips/patches-5.4 or target/linux/ramips/patches-5.10

PolyLin commented 3 years ago

hi, @redchenjs , 我在linux-4.14.95上使用了你提供的这个path文件,发现在使用ffmpeg播放单声道的时候声音不正常(ffmpeg -v debug -re -i notfound.wav -ar 8000 -ac 1 -f alsa hw:0), 使用双声道播放(-ac 2)就正常了。请问是不是在4.14的kernel上还需要做什么修改?或者是其他的原因?