Arecord: pcm_read:2103 read error: input/output error

I am getting such error on after setting up the matrix voice on a raspberry pi 3 b.
I have installed the kernel module.

Command: arecord -D hw:2,0 -d 5 --rate 16000 -c8 --format S16_LE test.wav
Error I am getting: arecord: pcm_read:2103 read error: input/output error

Can anyone help solve the problem?

Can you share the output of :

uname -a
lsmod | grep matrix
sudo dpkg -l | grep matrix
ls -l /etc/ | grep asound

Thanks

@yoelrc88

Hello,

I’ll provide more details. The matrix voice that is not working is a the one I used before without a problem. I have gave it to another person and the person is experiencing such problems. I will let them further post the information what you asked for.

Is there a special step that needs to be done before using a used matrix voice with a new raspberry pi?
FYI. We are both using raspberry pi 3 b. They may reply a little bit late as they are in a different country.

Thanks!

Not really, you can switch the Voice between Raspberry Pis with different SD cards and it should work.

Looking forward to the details.

-Yoel

The output as shown below:

Please install the kernell modules:

sudo apt-get install matrixio-kernel-modules 
sudo reboot

and try to record again

I can answer this on be half of my friend @mooncaptian. They have already installed the kernel module via option 2 (i.e., Cloning & compiling from sources) described in https://github.com/matrix-io/matrixio-kernel-modules. They have commented out dtoverlay=matrixio from the /boot/config.txt to test the hardware as described in MATRIX Creator/Voice Hardware Test.

Do you want them to redo the command below after enabling the kernel module again (uncomment dtoverlay=matrixio and reboot device)?

uname -a
lsmod | grep matrix
sudo dpkg -l | grep matrix
ls -l /etc/ | grep asound

No, thanks

Normally is easier to install the kernel modules form using the package installation. But, if you want to use the ‘from source’ installation is ok. Do you have the kernel modules repository up to date? Please, double check and do git pull followed by an install in case it was not updated.

The repository they used is up to date for sure. We know that as we are planning to tweak the fir coefficients which was added recently.

Are there any other command results they need to provide to find out what the problem is?

Thank you for your help.

Yes, make sure you have the file asound.conf file in /etc/. In the screenshot they uploaded above, it looks the file some how is not there. The content of the file should be :

I added asound.conf. Then there was pcm_read:2103: read error:I/O error again when I did arecord -D hw:2,0…
It succeeded in recording a wav with arecord -D hw:1,0…, but the wav file sounds uncorrectly.
then when i did arecord -D hw:0,0…,there happened main:788:audi open error.

I normally install the package for the kernel modules, I will try to reproduce this error installing from source. I will let you know.

pi@test-arecord:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 2: SOUND [MATRIXIO SOUND], device 0: matrixio.mic.0 snd-soc-dummy-dai-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
pi@test-arecord:~ $ sudo dpkg -l | grep matr
ii  libmatrixio-creator-hal:armhf   0.3.6                        armhf        Hardware Abstraction Layer for MATRIX.
ii  libmatrixio-malos:armhf         0.1.3                        armhf        Libraries of MATRIX abstraction layer for MOS
ii  libmatrixio-protos:armhf        0.1.5                        armhf        Protocolbuffers for MATRIX abstraction layer
ii  matrixio-creator-init           0.4.12                       armhf        Install scripts that can program the MATRIX Creator FPGA and SAM3 IMU.
ii  matrixio-openocd                1.0.1                        armhf        Open on-chip JTAG debug solution for ARM and MIPS systems
ii  matrixio-protobuf               3.5.0                        armhf        Protocol Buffers - Google's data interchange format. (From GRPC 3.5.0)
ii  matrixio-xc3sprog               1.1.1                        armhf        Spartan3, XCF and CPLD JTAG programmer and other utilities.
pi@test-arecord:~ $ lsmod | grep matr
matrixio_codec         16384  1
matrixio_pcm          278528  1
snd_soc_core          188416  2 matrixio_pcm,matrixio_codec
matrixio_uart          16384  0
matrixio_core          16384  2 matrixio_pcm,matrixio_uart
snd_pcm                98304  5 matrixio_pcm,snd_pcm_dmaengine,snd_bcm2835,snd_soc_core,snd_dummy
pi@test-arecord:~ $ arecord -D hw:2,0 -d 10 --rate 16000 -c8 --format S16_LE test.wav
Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Channels 8
^CAborted by signal Interrupt...
pi@test-arecord:~ $ ls -l
total 752
drwxr-xr-x 8 pi pi   4096 Jul 18 15:15 matrixio-kernel-modules
-rw-r--r-- 1 pi pi 761900 Jul 18 15:45 test.wav
pi@test-arecord:~ $ arecord -D hw:2,0 -d 5 --rate 16000 -c8 --format S16_LE test.wav
Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Channels 8

I tested using the latest version of Raspbian Lite and it worked, even without the asound file. So, I could not reproduce the issue.

Have you tried to start from a clean Raspbian image?

They already tried from clean Raspbian several times. Is there a way to confirm that it is a hardware problem? If that’s possible we would like to confirm that and move on to buying a new device. But if we can fix it, that would be even better.

If the error they are getting is still this one above, I don’t think is a hardware problem. If they could share full console ouput and steps followed would be nice.

If they want the can test for hardware problems using this guide MATRIX Creator/Voice Hardware Test . There is also another specific to test the microphones Hardware Test: Microphones 🎤

@yoelrc88 They already tried the first link. Would it be helpful if they post all the outputs they get from the first link?

To get the correct output (on a currently working matrix voice I have) from the first link (MATRIX Creator/Voice Hardware Test), I had to disable to kernel module. Should @mooncaptian to disable the kernel module and follow the first link and post all the outputs here?

@mooncaptian could you post the output you get from the second link as well?

Thanks.

Yes, please, that could be useful.

Thank you

The result that I disabled kernel module and tried the first link:


Then I enabled kernel module and tested it agian:

Then I tested the second link:

Then I enabled kernel moodule and tried the second link:

So is it possible to be a hardware issue?

@yoelrc88 Hello, could you check the screenshots @mooncaptian has uploaded?

Thanks!

I uploaded again, can you see them?

The result that I disabled kernel module and tried the first link:

Then I enabled kernel module and tested it agian:

Then I tested the second link:

Then I enabled kernel moodule and tried the second link: