Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue while playing audio on kernel 5.4 #65

Open
grassead opened this issue Nov 24, 2020 · 14 comments
Open

Issue while playing audio on kernel 5.4 #65

grassead opened this issue Nov 24, 2020 · 14 comments

Comments

@grassead
Copy link

grassead commented Nov 24, 2020

Hello,

With BuildRoot mainline (nitrogen8mm_defconfig + alsa + tinyalsa, kernel 5.4 boundary devices, boundary_defconfig), I tried to play audio on my nitrogen8m-mini board with aplay (alsa) and tinyplay (tinyalsa) and I am facing an error.

The audio device seems to be listed by the kernel (ALSA device list: #0: wm8960-audio), but with aplay and tinyplay are exiting on error after about 10s (and no audio played).

# aplay /ring_sound.wav
Playing WAVE '/ring_sound.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: pcm_write:2058: write error: Input/output error

# tinyplay /ring_sound.wav
playing '/ring_sound.wav': 2 ch, 48000 hz, 16 bit
error playing sample

With the same board (but different kernel version) I am able to play sound with Android (with UI, not tested with aplay nor tinyplay).

I think I am missing something on BR,
Could you please help me? (I need to play audio to verify that my driver integration is OK on mainline)

Thanks,

@gibsson
Copy link
Member

gibsson commented Nov 25, 2020

Hi,

Please try building Buildroot exactly as explained here:
https://boundarydevices.com/buildroot-2020-08-for-imx-platforms/

Audio was working with this config. Maybe the kernel was more up to date in our external layer though.

Regards,
Gary

@grassead
Copy link
Author

grassead commented Nov 25, 2020

Hi Gary,

Same error with this version.

# aplay /ring_sound.wav
Playing WAVE '/ring_sound.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: pcm_write:2061: write error: Input/output error

Trying to play a video (in the tuto): no sound
Trying to play an audio file using: "gst-launch-1.0 -v uridecodebin file:///ring_sound.wav ! audioconvert ! audioresample ! autoaudiosink: no sound and gst-launch never finish (on my PC, this pipeline ends at the end of the audiofile)

Note: I am using an headset + micro (I don't have HP to connect directly to the board).

Thanks

@gibsson
Copy link
Member

gibsson commented Nov 25, 2020

Hi,
Please try this branch then:
https://github.com/boundarydevices/linux-imx6/tree/boundary-imx_5.4.x_2.2.0
If it doesn't work there must be something wrong with the setup.
I usually test with headset as well.
Regards

@grassead
Copy link
Author

Hi,

Same with this version:

Linux version 5.4.72 (adgra@adgra-XPS-15-9570)

aplay /ring_sound.wav
Playing WAVE '/ring_sound.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: pcm_write:2061: write error: Input/output error

@gibsson
Copy link
Member

gibsson commented Nov 25, 2020

Hi,
I just tried the latest Linux version and it works as expected:

root@nfs:~# uname -r
5.4.72-g3b0d9a0a12eb
root@nfs:~# aplay song.wav 
Playing WAVE 'song.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

Have you tried the prebuilt Buildroot images from the blog post?
IIRC I tried playing BigBuckBunny and checked the audio back then.

@grassead
Copy link
Author

Could you please send me the wav file you are using (maybe my file is corrupted / special)?

I will try the prebuilt image.

Thanks,

@gibsson
Copy link
Member

gibsson commented Nov 25, 2020

@grassead
Copy link
Author

Same with the jenkins version and your file :(

(Linux version 5.4.60 (jenkins@ae899e375adb))

#aplay /song.wav
Playing WAVE '/song.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: pcm_write:2061: write error: Input/output error

@grassead
Copy link
Author

I have a nitrogen8m_mini board "rev30 06-28-2019"

@gibsson
Copy link
Member

gibsson commented Nov 25, 2020

I have an older version of the board (rev20). Please copy/paste your bootlog into pastebin.
Also, please make sure to have latest UBoot (just in case).

@grassead
Copy link
Author

Complete dmesg:
dmesg.txt

I think I will take some time to investigate this (after mainlining my patches on kernel).

Thanks,

@gibsson
Copy link
Member

gibsson commented Nov 25, 2020

I've seen people havin issues with SDMA with newer kernel and old U-Boot/ATF. Please make sure you have the latest.

@grassead
Copy link
Author

Same issue with latest u-boot (U-Boot SPL 2018.07-01626-g338e38fa4e (Nov 25 2020 - 17:17:56 +0100).

Thanks,

@dcrawford1
Copy link

Sorry to post to an old issue, but I am seeing the same problem with the Boundary imx8m plus EVK. When I run with a recent "Boundary XWayland 3.2 (gatesgarth)" yocto release the song.wav plays fine over my headphones. But with the recent Boundary 2021.05 release I get no audio and this error:

# aplay /opt/song.wav
Playing WAVE '/opt/song.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: pcm_write:2058: write error: Input/output error

The 5.4.110 kernels between my yocto and buildroot were almost identical. But, just to eliminate the kernel I copied the Image and imx8mp-a0-nitrogen8mp.dtb out of yocto and into the buildroot /boot dir (The kernel modules were still from buildroot) But, I still get the same error from aplay. I am guessing there is some important user space difference here between yocto and buildroot. Maybe alsa libraries (I have no idea)?

Here are the versions I am testing with:

=> ver
U-Boot 2020.10-52977-g903a2c2264 (Aug 19 2021 - 16:41:22 -0700), Build: jenkins-uboot_v2020.10-134

aarch64-linux-gnu-gcc (Linaro GCC 6.4-2018.05) 6.4.1 20180425 [linaro-6.4-2018.05 revision 7b15d0869c096fe39603ad63dc19ab7cf035eb70]
GNU ld (Linaro_Binutils-2018.05) 2.27.0.20161229
# uname -a
Linux buildroot 5.4.110+ge5cde7b05e54 #1 SMP PREEMPT Wed Apr 14 00:16:51 UTC 2021 aarch64 GNU/Linux
# cat /etc/os-release
NAME=Buildroot
VERSION=2021.05.1
ID=buildroot
VERSION_ID=2021.05.1
PRETTY_NAME="Buildroot 2021.05.1"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants