AnsweredAssumed Answered

[IMX8MMINILPD4-EVK - Audio] PyAudio/Alsa lib segment fault (core dumped) with root user

Question asked by Tu Ma on Aug 5, 2019

Hi,

I am using pyaudio on iMX8MM board that runs yocto-L4.14.98_2.0.0_ga.

But it's always be crashed after creating audio interface by codes:

   import pyaudio

   pyaudio.PyAudio()

 

Debug stack shows:

#0 __GI_raise (sig=sig@entry=6) at /usr/src/debug/glibc/2.27-r0/git/sysdeps/unix/sysv/linux/raise.c:51
#1 0x0000ffffbf3011b0 in __GI_abort () at /usr/src/debug/glibc/2.27-r0/git/stdlib/abort.c:79
#2 0x0000ffffbf2f98b8 in __assert_fail_base (fmt=0xffffbf3f0218 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0xffffbee4b988 "bitofs % 8 == 0",
file=file@entry=0xffffbee4b958 "../../../alsa-lib-1.1.5/src/pcm/pcm_local.h", line=line@entry=572, function=function@entry=0xffffbee49ff0 "snd_pcm_channel_area_addr")
at /usr/src/debug/glibc/2.27-r0/git/assert/assert.c:92
#3 0x0000ffffbf2f9934 in __GI___assert_fail (assertion=0xffffbee4b988 "bitofs % 8 == 0", file=0xffffbee4b958 "../../../alsa-lib-1.1.5/src/pcm/pcm_local.h", line=572,
function=0xffffbee49ff0 "snd_pcm_channel_area_addr") at /usr/src/debug/glibc/2.27-r0/git/assert/assert.c:101
#4 0x0000ffffbedaf24c in ?? () from /usr/lib/libasound.so.2
#5 0x0000ffffbee09f7c in ?? () from /usr/lib/libasound.so.2
#6 0x00000000005dea80 in ?? ()

 

Or:

#0 0x0000ffffbedd47ac in snd_pcm_area_silence () from /usr/lib/libasound.so.2
#1 0x0000ffffbee09f7c in ?? () from /usr/lib/libasound.so.2
#2 0x00000000005ddd10 in ?? ()

 

And this issue only occurs with root user. I created regular user (uid: 1000) for testing, pyaudio.PyAudio() worked.

Have anyone got similar?

 

Update: The cause maybe in audio group, any user that has audio group permission will encounter this issue. When remove it from audio group, the problem disappears. But I need this permission to use mic, speaker.

 

Thanks,

Outcomes