i.MX8QXP PWM audio module

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX8QXP PWM audio module

Jump to solution
1,081 Views
mosaddek_hossai
Contributor III

Hallo Nxp Community,

Currently I am integrating pwm sound module in i.MX8QXP custom board. I have used the driver from https://github.com/sasamy/imx-snd-pwm. This driver is also compatible with iMX8QXP.

Device Tree:
&pwm2 {
compatible = "fsl,imx-snd-pwm";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm_audio_gpio>;
interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
status = "okay";
};

The driver has initialized the interface.

The Kernal panics when an audio is played. The error log is given below:

aplay -vv buttonclick.wav 
[  212.040466] BUG: scheduling while atomic: alsa-sink-snd_p/2324/0x00000004
[  212.047829] SError Interrupt on CPU0, code 0xbf000002 -- SError
[  212.047835] CPU: 0 PID: 2324 Comm: alsa-sink-snd_p Tainted: G        W         4.19.35-1.1.0+g7aa22c77f19c #1
[  212.047837] Hardware name: Freescale i.MX8QXP STHU (DT)
[  212.047839] pstate: 40000005 (nZcv daif -PAN -UAO)
[  212.047841] pc : imx_pcm_trigger+0x104/0x298
[  212.047843] lr : imx_pcm_trigger+0xec/0x298
[  212.047844] sp : ffff000021333c20
[  212.047846] x29: ffff000021333c20 x28: ffff800834aa9800 
[  212.047852] x27: 0000000000000000 x26: 0000000000000000 
[  212.047859] x25: ffff80083477fa00 x24: ffff80083b5c1800 
[  212.047865] x23: ffff80083b620000 x22: 0000000000000080 
[  212.047872] x21: ffff80083b5c27b8 x20: 0000000000000000 
[  212.047876] x19: ffff80083b5c2780 x18: 00000000000003d5 
[  212.047882] x17: 0000000000000000 x16: 0000000000000000 
[  212.047889] x15: 0000000000000400 x14: 000000000000016d 
[  212.047895] x13: 0000000000000400 x12: 0000000000000400 
[  212.047901] x11: 0000000000000000 x10: 0000000000000910 
[  212.047908] x9 : ffff000021333980 x8 : ffff800834aaa170 
[  212.047914] x7 : ffff80083ff4c880 x6 : 00000000000001a8 
[  212.047918] x5 : 0000000000000000 x4 : 0000000000000000 
[  212.047924] x3 : 0000000000000000 x2 : 0000000000000000 
[  212.047929] x1 : ffff800834aa9800 x0 : ffff00001f8d0000 
[  212.047936] Kernel panic - not syncing: Asynchronous SError Interrupt
[  212.047942] CPU: 0 PID: 2324 Comm: alsa-sink-snd_p Tainted: G        W         4.19.35-1.1.0+g7aa22c77f19c #1
[  212.047944] Hardware name: Freescale i.MX8QXP STHU (DT)
[  212.047945] Call trace:
[  212.047947]  dump_backtrace+0x0/0x158
[  212.047951]  show_stack+0x14/0x20
[  212.047953]  dump_stack+0x90/0xb4
[  212.047954]  panic+0x120/0x27c
[  212.047956]  nmi_panic+0x6c/0x70
[  212.047958]  arm64_serror_panic+0x74/0x80
[  212.047961]  is_valid_bugaddr+0x0/0x8
[  212.047963]  el1_error+0x7c/0xdc
[  212.047965]  imx_pcm_trigger+0x104/0x298
[  212.047969]  snd_pcm_do_start+0x30/0x38
[  212.047971]  snd_pcm_action_single+0x44/0x98
[  212.047972]  snd_pcm_action+0x100/0x108
[  212.047974]  snd_pcm_action_lock_irq+0x38/0x60
[  212.047978]  snd_pcm_common_ioctl+0x7c8/0xec8
[  212.047980]  snd_pcm_ioctl+0x28/0x40
[  212.047982]  do_vfs_ioctl+0xb8/0x890
[  212.047985]  ksys_ioctl+0x78/0xa8
[  212.047987]  __arm64_sys_ioctl+0x1c/0x28
[  212.047989]  el0_svc_common+0x84/0xf0
[  212.047993]  el0_svc_handler+0x2c/0x80
[  212.047994]  el0_svc+0x8/0xc
[  212.048012] SMP: stopping secondary CPUs
[  212.048016] Kernel Offset: disabled
[  212.048018] CPU features: 0x0,20802008
[  212.048019] Memory Limit: none
[  212.280168] ---[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]---
 
Do you have any idea what is causing the problem, and How it can be handled? Please let me know a working solution,  @igorpadykov @jonas_karlsson 
 
Kind Regards,
Hossain



0 Kudos
1 Solution
1,072 Views
igorpadykov
NXP Employee
NXP Employee
3 Replies
1,067 Views
mosaddek_hossai
Contributor III

Fixed the bug.

0 Kudos
1,073 Views
igorpadykov
NXP Employee
NXP Employee

Hi mosaddek_hossai

 

pwm2 dts example can be found on

https://github.com/alliedvision/linux_imx8_apalis/blob/master/arch/arm64/boot/dts/freescale/fsl-imx8...

https://github.com/alliedvision/linux_imx8_apalis/blob/master/arch/arm64/boot/dts/freescale/fsl-imx8...

Toradex build steps
https://developer.toradex.com/software/linux/linux-software/build-apalis-imx8-boot-imagelinux-from-s...

"pwm sound module" is not oficially supported in nxp bsps, however one can try to debug it using

description of ALSA subsystem in  i.MX Linux Reference Manual​

 

Best regards
igor

1,050 Views
mosaddek_hossai
Contributor III

Working Patch file for i.MX8qxp Audio PWM module. Change the Frequency and Period according to user specification.

0 Kudos