Skip to content

[Android] pcm_readi failed with 'cannot read/write stream data: I/O error' #33

@maomaoispan

Description

@maomaoispan

Hello, thank you very much for this project, it is very good.

I am using this project to make a sound recognition system, which runs normally under the iOS system.
But under the Android system, it works normally at the beginning. After about dozens of seconds, no data is received. ChunkId can be obtained normally, but chunk is empty. The official example project runs in the same situation.

Android Studio log:

2025-02-28 10:00:38.642   369-11674 android.ha...mpl.ranchu android.hardware.audio.service       W  pcmRead:221 pcm_readi failed with 'cannot read/write stream data: I/O error' (-1)
2025-02-28 10:00:38.642   369-11674 android.ha...mpl.ranchu android.hardware.audio.service       E  pcmRead:222 failure: -1
2025-02-28 10:00:38.656   369-11671 android.ha...mpl.ranchu android.hardware.audio.service       D  TinyalsaSource::read:143 pcm_readi was late delivering frames, inserting 15963 us of silence
2025-02-28 10:00:38.672   369-11671 android.ha...mpl.ranchu android.hardware.audio.service       D  TinyalsaSource::read:143 pcm_readi was late delivering frames, inserting 15963 us of silence
2025-02-28 10:00:38.688   369-11671 android.ha...mpl.ranchu android.hardware.audio.service       D  TinyalsaSource::read:143 pcm_readi was late delivering frames, inserting 15963 us of silence
2025-02-28 10:00:38.704   369-11671 android.ha...mpl.ranchu android.hardware.audio.service       D  TinyalsaSource::read:143 pcm_readi was late delivering frames, inserting 15963 us of silence
2025-02-28 10:00:38.720   369-11671 android.ha...mpl.ranchu android.hardware.audio.service       D  TinyalsaSource::read:143 pcm_readi was late delivering frames, inserting 15963 us of silence
2025-02-28 10:00:38.736   369-11671 android.ha...mpl.ranchu android.hardware.audio.service       D  TinyalsaSource::read:143 pcm_readi was late delivering frames, inserting 15963 us of silence
2025-02-28 10:00:38.746   369-11674 android.ha...mpl.ranchu android.hardware.audio.service       W  pcmRead:221 pcm_readi failed with 'cannot read/write stream data: I/O error' (-1)
2025-02-28 10:00:38.746   369-11674 android.ha...mpl.ranchu android.hardware.audio.service       E  pcmRead:222 failure: -1

I don't know if I have set it wrong or if there is a memory leak. Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High priority issue.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions