This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

alsa audio open error

Dear Ti E2E Community,

I facing the below error, am using am335x & ti sdk 8

Something wrong when execute arecord & aplay :

arecord and aplay does not work for the first time & it works after throwing error after 5 times

Couple of times I get the below error:

root@lifeline:/# arecord -D VINL8 -f S16_LE | aplay -D VOUTR8
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
^CAborted by signal Interrupt...
Aborted by signal Interrupt...
root@lifeline:/# arecord -D VINL8 -f S16_LE | aplay -D VOUTR8
ALSA lib /home/jenkins/amsdk-nightly-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa8t2hf-vfp-neon-oe-linux-gnueabi/alsa-lib/1.0.27.2-r0/alsa-lib-1.0.27.2/src/pcm/pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
arecord: main:722: audio open error: Invalid argument
aplay: playback:2715: read error
root@lifeline:/# arecord -D VINL8 -f S16_LE | aplay -D VOUTR8
ALSA lib /home/jenkins/amsdk-nightly-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa8t2hf-vfp-neon-oe-linux-gnueabi/alsa-lib/1.0.27.2-r0/alsa-lib-1.0.27.2/src/pcm/pcm_dshare.c:710:(snd_pcm_dshare_open) unable to open slave
aplay: main:722: audio open error: Invalid argument
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
root@lifeline:/# arecord -D VINL8 -f S16_LE | aplay -D VOUTR8
ALSA lib /home/jenkins/amsdk-nightly-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa8t2hf-vfp-neon-oe-linux-gnueabi/alsa-lib/1.0.27.2-r0/alsa-lib-1.0.27.2/src/pcm/pcm_dshare.c:710:(snd_pcm_dshare_open) unable to open slave
aplay: main:722: audio open error: Invalid argument
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
root@lifeline:/# arecord -D VINL8 -f S16_LE | aplay -D VOUTR8
ALSA lib /home/jenkins/amsdk-nightly-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa8t2hf-vfp-neon-oe-linux-gnueabi/alsa-lib/1.0.27.2-r0/alsa-lib-1.0.27.2/src/pcm/pcm_dshare.c:710:(snd_pcm_dshare_open) unable to open slave
aplay: main:722: audio open error: Invalid argument
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
root@lifeline:/# arecord -D VINL8 -f S16_LE | aplay -D VOUTR8
ALSA lib /home/jenkins/amsdk-nightly-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa8t2hf-vfp-neon-oe-linux-gnueabi/alsa-lib/1.0.27.2-r0/alsa-lib-1.0.27.2/src/pcm/pcm_dshare.c:710:(snd_pcm_dshare_open) unable to open slave
aplay: main:722: audio open error: Invalid argument
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
root@lifeline:/# arecord -D VINL8 -f S16_LE | aplay -D VOUTR8
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

But there is no answer...

Could someone give me some clues?

Kindly do the needful as early as possible

Many Thanks in advance

  • I will forward this to the sw team.
  • Dear SW Team,

    Could you please provide any inputs w.r.t the above query



    Awaiting for your replies
    Thanks in advance
  • Hello Srini,

    How do you set-up and route the channels?
    Could you share the etc/asound.conf?

    Best regards,
    Kemal
  • Srini,

    Can you please resend your last post, because it seems to have been blocked by the spam filter.
  • Dear Biser,

    No Problem,

    Dear Kemal,

    Hope you are doing good, am very happy that you are addressing this thread

    For your reference, I have hereby attached the asound.conf(modified for routing)

    I the stereo codec (UDA1345TS) Sound card, I have created four devices ie., VINL8, VINR8, VOUTL8 & VOUTR8 using dsnoop & dshare in asound.conf

    And made use of these four devices for my application as described below

    Application design
    ----------------------
    GSM MIC [Analog Data]->GSM_PCM_OUT [Digital Data]->SDIN[Digital Data]->OUTP[Analog Data] ->VINR[Analog Data] ->I2S[Digital Data]-> VOUTR[Analog Data]-> Board Speaker[Analog Data]
    GSM Speaker [Analog Data] <- GSM_PCM_IN[Digital Data] <- SDOUT[Digital Data] <- MICLP [Analog Data]<- VOUTL [Analog Data]<- I2S [Digital Data] <-VINL[Analog Data]<-Board MIC [Analog Data]

    Kindly do the needful as early as possible

    Many Thanks in advance

    #This configuration for 3.14 kernel
    pcm.card0 {
      type hw
      card 0
    }
    
    ctl.card0 {
      type hw
      card 0
    }
    
    
    ###Dshare 
    
    pcm.VOUTL8 {
            type dshare
            ipc_key 6678293
            ipc_key_add_uid yes
            slave {
                    pcm "hw:0,0"
    		        rate 8000
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
            }
            bindings {
                    0 0
            }
    }
    
    pcm.VOUTR8 {
            type dshare
            ipc_key 6678293
            ipc_key_add_uid yes
            slave {
                    pcm "hw:0,0"
    		        rate 8000
    		        buffer_size 4097
                    period_size 1000
             	    period_time 125000
    		
            }
            bindings {
                    0 1
            }
    }
    ### Dsnoop splited channels
    pcm.VINL8 {
            type dsnoop
            ipc_key 32
            slave {
    
    	            pcm "hw:0,0"
    	            rate 8000
                    buffer_size 4097    
                    period_size 1000
                    period_time 125000
    
             channels 2
         }
         bindings.0  0
    }
    
    pcm.VINR8 {
         type dsnoop
         ipc_key 32
         slave {
    	            pcm "hw:0,0"
    	            rate 8000
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
             channels 2
         }
         bindings.0  1
    }
    
    
    
    ###Dshare 16k 
    
    pcm.VOUTL16 {
            type dshare
            ipc_key 6678293
            ipc_key_add_uid yes
            slave {
                    pcm "hw:0,0"
                    rate 16000
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
            }
            bindings {
                    0 0
            }
    }
    
    pcm.VOUTR16 {
            type dshare
            ipc_key 6678293
            ipc_key_add_uid yes
            slave {
                    pcm "hw:0,0"
                    rate 16000
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
    
            }
            bindings {
                    0 1
            }
    }
    ### Dsnoop splited channels
    pcm.VINL16 {
         type dsnoop
         ipc_key 32
         slave {
    
                    pcm "hw:0,0"
                    rate 16000
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
             channels 2
         }
         bindings.0  0
    }
    
    pcm.VINR16 {
         type dsnoop
         ipc_key 32
         slave {
    
                    pcm "hw:0,0"
                    rate 16000
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
             channels 2
         }
         bindings.0  1
    }
    
    
    ###Dshare 32k
    
    pcm.VOUTL32 {
            type dshare
            ipc_key 6678293
            ipc_key_add_uid yes
            slave {
                    pcm "hw:0,0"
                    rate 32000
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
            }
            bindings {
                    0 0
            }
    }
    
    pcm.VOUTR32 {
            type dshare
            ipc_key 6678293
            ipc_key_add_uid yes
            slave {
                    pcm "hw:0,0"
                    rate 32000
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
    
            }
            bindings {
                    0 1
            }
    }
    ### Dsnoop splited channels
    pcm.VINL32 {
         type dsnoop
         ipc_key 32
         slave {
    
                    pcm "hw:0,0"
                    rate 32000
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
             channels 2
         }
         bindings.0  0
    }
    
    pcm.VINR32 {
         type dsnoop
         ipc_key 32
         slave {
    
                    pcm "hw:0,0"
                    rate 32000
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
             channels 2
         }
         bindings.0  1
    }
    
    
    ###Dshare 44k
    
    pcm.VOUTL44 {
            type dshare
            ipc_key 6678293
            ipc_key_add_uid yes
            slave {
                    pcm "hw:0,0"
                    rate 44100
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
            }
            bindings {
                    0 0
            }
    }
    
    pcm.VOUTR44 {
            type dshare
            ipc_key 6678293
            ipc_key_add_uid yes
            slave {
                    pcm "hw:0,0"
                    rate 44100
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
    
            }
            bindings {
                    0 1
            }
    }
    ### Dsnoop splited channels
    pcm.VINL44 {
         type dsnoop
         ipc_key 32
         slave {
    
                    pcm "hw:0,0"
                    rate 44100
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
             channels 2
         }
         bindings.0  0
    }
    
    pcm.VINR44 {
         type dsnoop
         ipc_key 32
         slave {
    
                    pcm "hw:0,0"
                    rate 44100
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
             channels 2
         }
         bindings.0  1
    }
    
    ###Dshare 48k
    pcm.VOUTL48 {
            type dshare
            ipc_key 6678293
            ipc_key_add_uid yes
            slave {
                    pcm "hw:0,0"
                    rate 48000
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
            }
            bindings {
                    0 0
            }
    }
    
    pcm.VOUTR48 {
            type dshare
            ipc_key 6678293
            ipc_key_add_uid yes
            slave {
                    pcm "hw:0,0"
                    rate 48000
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
    
            }
            bindings {
                    0 1
            }
    }
    
    ### Dsnoop splited channels
    pcm.VINL48 {
         type dsnoop
         ipc_key 32
         slave {
    
                    pcm "hw:0,0"
                    rate 48000
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
             channels 2
         }
         bindings.0  0
    }
    
    pcm.VINR48 {
         type dsnoop
         ipc_key 32
         slave {
    
                    pcm "hw:0,0"
                    rate 48000
                    buffer_size 4097
                    period_size 1000
                    period_time 125000
    
             channels 2
         }
         bindings.0  1
    }
    
    
    
    pcm.!default VOUTR8
    pcm.!default VOUTL8
    pcm.!default VOUTR16
    pcm.!default VOUTL16
    pcm.!default VOUTR32
    pcm.!default VOUTL32
    pcm.!default VOUTR44
    pcm.!default VOUTL44
    pcm.!default VOUTR48
    pcm.!default VOUTL48
    
    
    

  • Could you attach these two logs.

    root@lifeline:~# ps > notworking.log
    root@lifeline:~# arecord -D VINL8 -f S16_LE | aplay -D VOUTR8 #execute arecord & aplay until it start to work
    root@lifeline:~# ps > working.log
  • Dear Kemal,

    Thanks a lot for your prompt responses,

    Please find the attached logs:

    PID   USER     TIME   COMMAND
        1 root       0:00 init [5]
        2 root       0:00 [kthreadd]
        3 root       0:00 [ksoftirqd/0]
        4 root       0:00 [kworker/0:0]
        5 root       0:00 [kworker/0:0H]
        6 root       0:00 [kworker/u2:0]
        7 root       0:00 [khelper]
        8 root       0:00 [kdevtmpfs]
        9 root       0:00 [kworker/u2:1]
       43 root       0:00 [kworker/0:1]
      178 root       0:00 [writeback]
      181 root       0:00 [bioset]
      182 root       0:00 [crypto]
      184 root       0:00 [kblockd]
      269 root       0:00 [khubd]
      393 root       0:00 [kswapd0]
      394 root       0:00 [fsnotify_mark]
      466 root       0:00 [irq/150-mmc0]
      468 root       0:00 [kworker/u2:2]
      497 root       0:00 [irq/32-TI-am335]
      515 root       0:00 [mmcqd/1]
      516 root       0:00 [mmcqd/1boot0]
      517 root       0:00 [mmcqd/1boot1]
      523 root       0:00 [deferwq]
      524 root       0:00 [irq/86-44e0b000]
      525 root       0:00 [kworker/u2:3]
      560 root       0:00 [kworker/0:2]
      571 root       0:00 [kworker/0:1H]
      572 root       0:00 [jbd2/mmcblk0p3-]
      573 root       0:00 [ext4-rsv-conver]
      593 root       0:00 /sbin/ifplugd
      594 root       0:00 [kworker/0:3]
      614 root       0:00 /lib/udev/udevd -d
      802 root       0:00 /lib/udev/udevd -d
      803 root       0:00 /lib/udev/udevd -d
      992 root       0:00 udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0
     1060 root       0:00 [ext4-rsv-conver]
     1090 root       0:00 [jbd2/mmcblk0p6-]
     1091 root       0:00 [ext4-rsv-conver]
     1106 root       0:00 /sbin/syslogd -n -O /media/userdata/messages -S
     1109 root       0:00 /bin/login --
     1110 root       0:00 /sbin/getty 38400 tty1
     1111 root       0:00 /sbin/klogd -n
     1113 root       0:00 [jbd2/mmcblk0p7-]
     1114 root       0:00 [ext4-rsv-conver]
     1149 root       0:00 -sh
     1160 root       0:00 ps
    

     

    PID   USER     TIME   COMMAND
        1 root       0:00 init [5]
        2 root       0:00 [kthreadd]
        3 root       0:00 [ksoftirqd/0]
        4 root       0:00 [kworker/0:0]
        5 root       0:00 [kworker/0:0H]
        6 root       0:00 [kworker/u2:0]
        7 root       0:00 [khelper]
        8 root       0:00 [kdevtmpfs]
        9 root       0:00 [kworker/u2:1]
       43 root       0:00 [kworker/0:1]
      178 root       0:00 [writeback]
      181 root       0:00 [bioset]
      182 root       0:00 [crypto]
      184 root       0:00 [kblockd]
      269 root       0:00 [khubd]
      393 root       0:00 [kswapd0]
      394 root       0:00 [fsnotify_mark]
      466 root       0:00 [irq/150-mmc0]
      468 root       0:00 [kworker/u2:2]
      497 root       0:00 [irq/32-TI-am335]
      515 root       0:00 [mmcqd/1]
      516 root       0:00 [mmcqd/1boot0]
      517 root       0:00 [mmcqd/1boot1]
      523 root       0:00 [deferwq]
      524 root       0:00 [irq/86-44e0b000]
      525 root       0:00 [kworker/u2:3]
      560 root       0:00 [kworker/0:2]
      571 root       0:00 [kworker/0:1H]
      572 root       0:00 [jbd2/mmcblk0p3-]
      573 root       0:00 [ext4-rsv-conver]
      593 root       0:00 /sbin/ifplugd
      594 root       0:00 [kworker/0:3]
      617 root       0:00 /lib/udev/udevd -d
      801 root       0:00 /lib/udev/udevd -d
      802 root       0:00 /lib/udev/udevd -d
     1026 root       0:00 udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0
     1067 root       0:00 [ext4-rsv-conver]
     1089 root       0:00 [jbd2/mmcblk0p6-]
     1091 root       0:00 [ext4-rsv-conver]
     1095 root       0:00 /sbin/syslogd -n -O /media/userdata/messages -S
     1101 root       0:00 /sbin/klogd -n
     1102 root       0:00 /bin/login --
     1103 root       0:00 /sbin/getty 38400 tty1
     1115 root       0:00 [jbd2/mmcblk0p7-]
     1116 root       0:00 [ext4-rsv-conver]
     1151 root       0:00 -sh
     1154 root       0:00 arecord -D VINL8 -f S16_LE
     1155 root       0:00 aplay -D VOUTR8
     1156 root       0:00 ps
    

    And two more points, I would like to share with you is 

    1. As per my application design, Am trying to do the loopback as per the below commands manually,  I face the error some times as per the logs shown below, but after the below errors as shown in the below logs, then again If I rerun manually it works fine

    arecord -D VINL8 -f S16_LE | aplay -D VOUTL8 &

    arecord -D VINR8 -f S16_LE | aplay -D VOUTR8 &

    logs:

    ====

    root@lifeline:/# arecord -D VINL8 -f S16_LE | aplay -D VOUTL8 &
    [1] 1171
    root@lifeline:/# ALSA lib /home/jenkins/amsdk-nightly-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa8t2hf-vfp-neon-oe-linux-gnueabi/alsa-lib/1.0.27.2-r0/alsa-lib-1.0.27.2/src/pcm/pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
    arecord: main:722: audio open error: Invalid argument
    aplay: playback:2715: read error

    [1]+ Done(1) arecord -D VINL8 -f S16_LE | aplay -D VOUTL8
    root@lifeline:/# arecord -D VINL8 -f S16_LE | aplay -D VOUTL8 &
    [1] 1173
    root@lifeline:/# Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
    Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

    root@lifeline:/# arecord -D VINR8 -f S16_LE | aplay -D VOUTR8 &
    [2] 1175
    root@lifeline:/# Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
    Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

    root@lifeline:/#

    2. When I put the above commands in the init script during bootup instead of running the below commands manually

    arecord -D VINL8 -f S16_LE | aplay -D VOUTL8 &

    arecord -D VINR8 -f S16_LE | aplay -D VOUTR8 &

    logs:

    ===

    INIT: version 2.88 booting
    Starting ifplugd service for dynamic IP assignment...
    Starting udev[ 2.144510] net eth0: initializing cpsw version 1.12 (0)

    [ 2.243122] net eth0: phy found : id is : 0x20005c90
    [ 2.248501] net eth0: PHY already attached
    [ 2.252915] net eth0: phy 4a101000.mdio:01 not found on slave 1
    Starting system message bus: [ 2.388906] random: dbus-daemon urandom read with 61 bits of entropy available
    Failed to start message bus: Failed to read directory "/etc/dbus-1/system.d": No such file or directory
    dbus.
    TUNSTALL INIT CONFIGURATIONS START
    #################################################################
    Running ntpdate to fetch current date and time from NTP server
    ##################################################################
    GSM_PWR_ON_3V3
    GSM_reset
    Got NTP server, IP: 192.168.82.40
    Configure PIN 50 as PWM PIN
    ALSA: Restoring mixer settings...
    GPIO pin =50
    GPIO register data =0x6
    [ 2.686421] GPIO 50 PHY address =0x44e10848
    PWM LED CONFIGURATION
    Vamp_C1 Configuration
    Vamp_C2 Configuration
    Stereo codec Configuration
    Audio amplifier Configuration
    1 Jan 00:19:58 ntpdate[616]: no servers can be used, exiting
    [ 2.841950] udevd[624]: starting version 182
    BATT_ON
    Monocodec driver configuration
    1 Jan 00:19:59 TUNSTALL INIT CONFIGURATIONS END
    ntpdate[625]: no servers can be used, exiting
    [ 2.989909] EXT4-fs (mmcblk0p3): re-mounted. Opts: data=ordered
    Programming MAX9860 Registers
    1 Jan 00:19:59 ntpdate[636]: no servers can be used, exiting
    Failed to set ntpdate after 3 re-tries!!!
    Simple mixer control 'Master',0
    Capabilities: pvolume pvolume-joined
    Playback channels: Mono
    Limits: Playback 0 - 63
    Mono: Playback 63 [100%]
    Simple mixer control 'DC Filter Enable',0
    Capabilities: pswitch pswitch-joined
    Playback channels: Mono
    Mono: Playback [on]
    ALSA lib /home/jenkins/amsdk-nightly-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa8t2hf-vfp-neon-oe-linux-gnueabi/alsa-lib/1.0.27.2-r0/alsa-lib-1.0.27.2/src/pcm/pcm_dshare.c:643:(snd_pcm_dshare_open) The dshare plugin supports only playback stream
    arecord: main:722: audio open error: Invalid argument
    Recording WAVE 'stdin' : aplay: playback:2715: Signed 16 bit Little Endian, Rate 8000 Hz, Mono
    Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
    read error
    urandom start: failed.
    [ 4.241547] libphy: 4a101000.mdio:01 - Link is Up - 100/Full
    [ 4.397655] remoteproc0: powering up wkup_m3
    [ 4.422118] remoteproc0: Booting fw image am335x-pm-firmware.elf, size 154420
    [ 4.430330] PM: CM3 Firmware Version = 0x190
    [ 4.652189] remoteproc0: remote processor wkup_m3 is now up
    [ 5.551042] random: nonblocking pool is initialized
    [ 11.702275] EXT4-fs (mmcblk0boot0): mounted filesystem without journal. Opts: (null)
    INIT: Entering runlevel: 5
    Starting syslogd/klogd: [ 12.389608] EXT4-fs (mmcblk0p6): mounted filesystem with ordered data mode. Opts: (null)
    done
    [ 12.690036] EXT4-fs (mmcblk0p7): mounted filesystem with ordered data mode. Opts: (null)

    lifeline login: root
    root@lifeline:~# cd /

     

    Kindly do the needful,

    Many Thanks in advance

  • Dear Kemal,

    Really appreciate for your efforts w.r.t this thread

    For time being, Could you please help me in creating the script by adding the below two commands in that script & invoked during bootup,  so that inspite of these errors, whenever that error is reported, to rerun the below commands in that script, until it start to work, instead of running manually

    arecord -D VINL8 -f S16_LE | aplay -D VOUTL8 &

    arecord -D VINR8 -f S16_LE | aplay -D VOUTR8 &

    Kindly do the needful as early as possible

    Many Thanks in advance

  • Dear Kemal,

    Extremely Sorry to push you hard, Could you please provide any valuable inputs or guidance w.r.t the above issue

    Many many Thanks in advance
  • Dear Kemal,

    Could you please provide any updates w.r.t the above issue, as I am having release next week

    Extremely sorry to push you hard once again

    Kindly do the needful as early as possible

    Many Thanks in advance

  • Could you check whether the issue is reproducible with the attached ALSA configuration file.

    arecord -D LEFT | aplay -D RIGHT

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/asound.conf

  • Dear Kemal,

    Many Thanks a lot for your prompt support,

    No problem, now it works for the first time, but if I give CTRL-C its reproducing the same errors, am not sure whether its right way of giving CTRL-C & more over in the above attached asound.conf, we have only two devices, but I require totally four devices ie., VINL, VINR VOUTR & VOUTL

    root@lifeline:/# arecord -D LEFT | aplay -D RIGHT
    ALSA lib /home/jenkins/amsdk-nightly-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa8t2hf-vfp-neon-oe-linux-gnueabi/alsa-lib/1.0.27.2-r0/alsa-lib-1.0.27.2/src/pcm/pcm_dshare.c:710:(snd_pcm_dshare_open) unable to open slave
    aplay: main:722: audio open error: Invalid argument
    Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
    root@lifeline:/# arecord -D LEFT | aplay -D RIGHT
    ALSA lib /home/jenkins/amsdk-nightly-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa8t2hf-vfp-neon-oe-linux-gnueabi/alsa-lib/1.0.27.2-r0/alsa-lib-1.0.27.2/src/pcm/pcm_dshare.c:710:(snd_pcm_dshare_open) unable to open slave
    aplay: main:722: audio open error: Invalid argument
    Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
    root@lifeline:/# arecord -D LEFT | aplay -D RIGHT
    Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
    Playing WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
    ^CAborted by signal Interrupt...
    aplay: pcm_write:1939: write error: Interrupted system call
    Aborted by signal Interrupt...
    arecord: pcm_read:2031: read error: Interrupted system call
    root@lifeline:/# arecord -D LEFT | aplay -D RIGHT
    ALSA lib /home/jenkins/amsdk-nightly-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa8t2hf-vfp-neon-oe-linux-gnueabi/alsa-lib/1.0.27.2-r0/alsa-lib-1.0.27.2/src/pcm/pcm_dshare.c:710:(snd_pcm_dshare_open) unable to open slave
    aplay: main:722: audio open error: Invalid argument
    Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
    root@lifeline:/# arecord -D LEFT | aplay -D RIGHT
    ALSA lib /home/jenkins/amsdk-nightly-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa8t2hf-vfp-neon-oe-linux-gnueabi/alsa-lib/1.0.27.2-r0/alsa-lib-1.0.27.2/src/pcm/pcm_dshare.c:710:(snd_pcm_dshare_open) unable to open slave
    aplay: main:722: audio open error: Invalid argument
    Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
    root@lifeline:/# arecord -D LEFT | aplay -D RIGHT

    Kindly do the needful as early as possible

    Awaiting for your replies,

    Many Thanks in advance

  • Dear Kemal,

    Could you please provide any inputs/guidance w.r.t the above issue why this error is seen if I give CTRL-C & rerun it once again (arecord -D LEFT | aplay -D RIGHT)

    gnueabi/alsa-lib/1.0.27.2-r0/alsa-lib-1.0.27.2/src/pcm/pcm_dshare.c:710:(snd_pcm_dshare_open) unable to open slave
    aplay: main:722: audio open error: Invalid argument

    If possible, Could you please help me in providing the asound.conf with stereo split into mono as I require four devices VINL, VINR & VOUTL & VOUTR

    ie., for running the below commands

    arecord -D VINL8 -f S16_LE | aplay -D VOUTL8 &
    arecord -D VINR8 -f S16_LE | aplay -D VOUTR8 &

    Kindly do the needful as early as possible

    Many thanks in advance
  • Try to add this:

    pcm.VOUTL8 {
    	type asym
    	playback.pcm "LEFT"
    }
    
    pcm.VOUTR8 {
    	type asym
    	playback.pcm "RIGHT"
    }
    
    pcm.VINL8 {
    	type asym
    	capture.pcm "LEFT"
    }
    
    pcm.VINR8 {
    	type asym
    	capture.pcm "RIGHT"
    }

  • Dear Kemal,

    Many Thanks a lot for your prompt responses & impressed by your prompt support

    Will surely try the above configuration & keep you updated

    I am facing one more issue Kemal, ie., overrrun & underrun, I hope this issue is due to improper definition of buffer_size in the ALSA application, inorder to fix this issue, am trying to define the buffer_size = period_size * periods correctly, am trying to understand the terminologies of the period_size & period

    I am trying to define the buffer_size in alsa application, where buffer_size is calculated using period_size & periods

    1. Could you please help me out to how to define the period_size & periods as per the below link w.r.t MCASP

    FramesPeriods - AlsaProject
    www.alsa-project.org

    I am trying to find out how to calculate the buffer_size which is dependent on 2*period_size
    But Still I don't understand what is don't understand what 'period_size' and a 'period' is?

    I have even tried posting the query () but still am not convinced w.r.t the inputs provided in the above thread

    As am configuring for the below parameters

    Sound format : I2S

    Sampling rate : 8Khz

    Channels : Mono

    16 bits per sample

    BCLK = 250 Khz

    MCLK = 2Mhz


    2. For example , Could you also please explain, the below link, how & on what basis BUFF_SIZE to 4096 has been defined

    processors.wiki.ti.com/.../Sitara_Linux_Audio_Sample_Application_Overview
    #define BUFF_SIZE 4096


    3. Could you please let me know on what basis & how these values are derived are they unique to eDMA buffers??

    static const struct snd_pcm_hardware edma_pcm_hardware = {

    29 .info = SNDRV_PCM_INFO_MMAP |

    30 SNDRV_PCM_INFO_MMAP_VALID |

    31 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME |

    32 SNDRV_PCM_INFO_NO_PERIOD_WAKEUP |

    33 SNDRV_PCM_INFO_INTERLEAVED,

    34 .buffer_bytes_max = 128 * 1024,

    35 .period_bytes_min = 512,

    36 .period_bytes_max = 64 * 1024,

    37 .periods_min = 2,

    38 .periods_max = 19,

    39 };

    Could you also please help me in knowing how & on what basis the below values are derived, Hope this is in ALSA layer of Kernel & it is independent of EDMA??

    static struct snd_pcm_hardware pcm_hardware_playback = {
    66 .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
    67 SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
    68 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME|
    69 SNDRV_PCM_INFO_BATCH),
    70 .formats = DAVINCI_PCM_FMTBITS,
    71 .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |
    72 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 |
    73 SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
    74 SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |
    75 SNDRV_PCM_RATE_KNOT),
    76 .rate_min = 8000,
    77 .rate_max = 96000,
    78 .channels_min = 2,
    79 .channels_max = 384,
    80 .buffer_bytes_max = 128 * 1024,
    81 .period_bytes_min = 32,
    82 .period_bytes_max = 8 * 1024,
    83 .periods_min = 16,
    84 .periods_max = 255,
    85 .fifo_size = 0,
    86 };
    87
    88 static struct snd_pcm_hardware pcm_hardware_capture = {
    89 .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
    90 SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
    91 SNDRV_PCM_INFO_PAUSE |
    92 SNDRV_PCM_INFO_BATCH),
    93 .formats = DAVINCI_PCM_FMTBITS,
    94 .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |
    95 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 |
    96 SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
    97 SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |
    98 SNDRV_PCM_RATE_KNOT),
    99 .rate_min = 8000,
    100 .rate_max = 96000,
    101 .channels_min = 2,
    102 .channels_max = 384,
    103 .buffer_bytes_max = 128 * 1024,
    104 .period_bytes_min = 32,
    105 .period_bytes_max = 8 * 1024,
    106 .periods_min = 16,
    107 .periods_max = 255,
    108 .fifo_size = 0,
    109 };


    Kindly do the needful as early as possible

    Many Thanks in advance

  • Dear Kemal,

    Could you please provide any inputs or suggestions w.r.t the buffer_size

    Kindly do the needful
    Many Thanks in advance
  • e2e.ti.com/.../1676501 this answer is pretty exhaustive. Try to ask someone who has a audio background for this.