Asterisk18: how to chan_alsa

I use linkit7688 hardware and to build openwrt20.02.

I use https://github.com/redchenjs/mt762x-wm8960(772ae2d31d5df69994c170b8b05009f15ff3fac0) enable the linkit sound card. I test it working. but It's only support stereo. dont support mono. So, If I directly use chan_alsa open default. It's will fault. and openwrt20.02's /dev/snd/* in auduo group. asterisk can not visit them.
so, It has two problem.

  1. permission denied
  2. mono problem.

I reference two topic. I think they are usefully.

#[Asterisk chan_alsa: /dev/snd/ permission denied]https://forum.openwrt.org/t/asterisk-chan-alsa-dev-snd-permission-denied/51598

#[[solved] Asterisks locks alsa device if chan_alsa is loaded]https://forum.openwrt.org/t/solved-asterisks-locks-alsa-device-if-chan-alsa-is-loaded/32006

root@OpenWrt:~# chmod -R 777 /dev/snd/
root@OpenWrt:~# cat /etc/asound.conf
pcm.!dmix {
        type dmix
        ipc_key 1024
        ipc_key_add_uid yes
        slave {
                pcm "hw:0,0"
                period_time 0
                period_size 2048
                buffer_size 16384
                format S16_LE
                rate 48000
        }
}

pcm.!dsnoop {
        type dsnoop
        ipc_key 2048
        ipc_key_add_uid yes
        slave {
                pcm "hw:0,0"
                period_time 0
                period_size 2048
                buffer_size 16384
                format S16_LE
                rate 4800
        }
}

pcm.asymed {
        type asym
        playback.pcm "dmix"
        capture.pcm "dsnoop"
}

pcm.!default {
        type plug
        slave.pcm "asymed"
}

pcm.dsp0 {
        type plug
        slave.pcm "asymed"
}

ctl.mixer0 {
        type hw
        card 0
}

I compile asterisk18 to openwrt 20.02. and pjsip working normal. and make modify for alsa. module load chan_alsa.so no warning message. maybe they are right.

but, when I call chan_alsa, asterisk server exited.

root@OpenWrt:/etc# /etc/init.d/asterisk restart
Command failed: Not found
root@OpenWrt:/etc# asterisk -dddddvvvvr
Seeding global EID '0c:cf:89:23:f7:55' from 'br-lan' using 'siocgifhwaddr'
Parsing /etc/asterisk/asterisk.conf
Asterisk 18.2.2, Copyright (C) 1999 - 2018, Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 18.2.2 currently running on OpenWrt (pid = 4734)
Core debug was OFF and is now 5.
OpenWrt*CLI> module load chan_alsa.so
Loaded chan_alsa.so
  == Registered channel type 'Console' (ALSA Console Channel Driver)
 Loaded chan_alsa.so => (ALSA Console Channel Driver)
[Apr 28 06:46:44] ERROR[4784]: netsock2.c:303 ast_sockaddr_resolve: getaddrinfo("OpenWrt", "(null)", ...): Name does not resolve
[Apr 28 06:46:44] WARNING[4784]: acl.c:890 resolve_first: Unable to lookup 'OpenWrt'
    -- Executing [9000@from-internal:1] Dial("PJSIP/6001-00000000", "Console/Alsa,30") in new stack
  << Call placed to 'Alsa' on console >>
  << Auto-answered >>
    -- Called Console/Alsa
    -- ALSA/default answered PJSIP/6001-00000000
       > 0x10e1a60 -- Strict RTP learning after remote address set to: 192.168.0.101:4016
    -- Channel ALSA/default joined 'simple_bridge' basic-bridge <f95376f6-b54b-4f67-9875-e81d91d9f68b>
    -- Channel PJSIP/6001-00000000 joined 'simple_bridge' basic-bridge <f95376f6-b54b-4f67-9875-e81d91d9f68b>
[Apr 28 06:46:44] WARNING[4806][C-00000001]: chan_alsa.c:571 alsa_indicate: Don't know how to display condition 26 on ALSA/default
[Apr 28 06:46:44] WARNING[4806][C-00000001]: chan_alsa.c:571 alsa_indicate: Don't know how to display condition 26 on ALSA/default
       > 0x10e1a60 -- Strict RTP switching to RTP target address 192.168.0.101:4016 as source
OpenWrt*CLI>
Disconnected from Asterisk server
Asterisk cleanly ending (0).
Executing last minute cleanups
Asterisk ending (0).
root@OpenWrt:/etc#

they have [Apr 28 06:46:44] WARNING[4806][C-00000001]: chan_alsa.c:571 alsa_indicate: Don't know how to display condition 26 on ALSA/default message. I know before application, I get this message too. but asterisk still working. but it's exit now. I think it's still alsa problem. I will how to modify them?