mp3放在内存盘里播放Widora系统立即崩溃

用widora_dlna_patches分枝上的包, 在Mac上编译的openwrt-widora, 用mplayer 播放mp3时很快出现内核崩溃, 感觉象是alsa驱动有问题。研究了一下发现:

  • 如果把mp3放在/tmp目录里(实际是内存盘), 则立即出现崩溃

  • 如果放在sd卡上,好象基本OK(除了偶尔有点卡).

附带了我编译的固件:

1532626622789-openwrt-ramips-mt7688-widora32128-squashfs-sysupgrade.bin (7 MB)

以下是崩溃时的LOG:

root@lasermark_8115:~# mplayer /tmp/xhqg.mp3 
MPlayer 1.0rc2-4.8.3 (C) 2000-2007 MPlayer Team
CPU: SGI MIPS

Playing /tmp/xhqg.mp3.
Audio file file format detected.
Clip info:
 Title: 
 Artist: 
 Album: 
 Year: 
 Comment: 
 Genre: Unknown
==========================================================================
Requested audio codec family [mp3] (afm=mp3lib) not available.
Enable it at compilation.
Requested audio codec family [ffmp3] (afm=ffmpeg) not available.
Enable it at compilation.
Opening audio decoder: [libmad] libmad mpeg audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3)
==========================================================================
[  328.640000] ****** wm8960_postinit ******
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
[  328.830000] CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 800b1710, ra == 800b19c0
[  328.840000] Oops[#1]:
[  328.840000] CPU: 0 PID: 1420 Comm: mplayer Not tainted 3.18.29 #23
[  328.840000] task: 86ada6c0 ti: 86b98000 task.ti: 86b98000
[  328.840000] $ 0   : 00000000 80008b84 20000002 87932aa0
[  328.840000] $ 4   : 00000001 40087468 40087468 7fee69b0
[  328.840000] $ 8   : 00000001 84080018 800b1970 00000000
[  328.840000] $12   : 7fee6980 773c93a0 00ae5da0 7fee69a0
[  328.840000] $16   : 87932aa0 7fee69b0 00000000 40087468
[  328.840000] $20   : 00000000 00adc518 00000000 00680000
[  328.840000] $24   : 00b039b8 773abd00                  
[  328.840000] $28   : 86b98000 86b99ea0 00642cc0 800b19c0
[  328.840000] Hi    : 00000000
[  328.840000] Lo    : 00001800
[  328.840000] epc   : 800b1710 do_vfs_ioctl+0x380/0x5e0
[  328.840000]     Not tainted
[  328.840000] ra    : 800b19c0 SyS_ioctl+0x50/0x94
[  328.840000] Status: 1100e403	KERNEL EXL IE 
[  328.840000] Cause : 00800008
[  328.840000] BadVA : 00000000
[  328.840000] PrId  : 00019655 (MIPS 24KEc)
[  328.840000] Modules linked in: pppoe ppp_async iptable_nat pppox ppp_generic nf_nat_ipv4 nf_conntrack_ipv6 nf_conntrack_ipv4 ipt_REJECT ipt_MASQUERADE xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_id xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_CT uvcvideo uinput slhc nf_reject_ipv4 nf_nat_masquerade_ipv4 nf_nat_ftp nf_nat nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack_ftp nf_conntrack iptable_raw iptable_mangle iptable_filter ip_tables crc_ccitt snd_soc_mt76xx_machine snd_soc_mt76xx_pcm snd_soc_mt76xx_i2s snd_soc_mt76xx_i2s_ctl i2c_wm8960 snd_soc_wm8960 ralink_gdma videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common videodev i2c_ralink i2c_mt7621 snd_soc_core mt_wifi i2c_dev ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_raw ip6table_mangle ip6table_filter ip6_tables x_tables nfsv3 nfs snd_compress snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_rawmidi snd_seq_device snd_hwdep snd input_core soundcore loop vfat fat lockd sunrpc grace autofs4 nls_utf8 nls_iso8859_1 nls_cp437 regmap_spi regmap_i2c i2c_core regmap_core lzo_decompress lzo_compress ipv6 dma_shared_buffer mmc_block usb_storage sdhci_pltfm sdhci mtk_sd mmc_core ohci_platform ohci_hcd ehci_platform ehci_hcd sd_mod scsi_mod ext4 jbd2 mbcache exfat drv_regopt usbcore nls_base usb_common crc16 crypto_hash
[  328.840000] Process mplayer (pid: 1420, threadinfo=86b98000, task=86ada6c0, tls=776bb440)
[  328.840000] Stack : a0000000 3fd1d53a 86b99f10 7fee6a18 3e0ea47a 00000000 4e45f75c 3fc1d48f
	  0041f0a0 0041f09c 00000018 0000004c 86b99f28 0066c4a8 00001800 00000000
	  00642cc0 00adc518 87932aa0 87932aa0 7fee69b0 40087468 00000000 800b19c0
	  00000000 80052530 00000000 00000000 7fee69b0 40087468 00000000 00000000
	  00642cc0 80006b5c 00000012 00000000 7fe92820 00000001 773c93a0 00ae5da0
	  ...
[  328.840000] Call Trace:
[  328.840000] [<800b1710>] do_vfs_ioctl+0x380/0x5e0
[  328.840000] [<800b19c0>] SyS_ioctl+0x50/0x94
[  328.840000] [<80006b5c>] handle_sys+0x11c/0x140
[  328.840000] 
[  328.840000] 
Code: 02038023  0802c653  2410ff86 <96440000> 34028000  3084f000  14820048  3c022000  24440001 
[  329.120000] ---[ end trace 35e0c7ccf0284ff8 ]---
[  329.430000] VFS: Close: file count is 0
[  329.430000] VFS: Close: file count is 0
[  329.430000] VFS: Close: file count is 0
[  329.510000] playback free_dma_buffer
[  329.520000] ptri2s_config->mmap_index:0
[  330.560000] CPU 0 Unable to handle kernel paging request at virtual address ffffffc8, epc == 80026874, ra == 80027314
[  330.570000] Oops[#2]:
[  330.570000] CPU: 0 PID: 1 Comm: procd Tainted: G      D        3.18.29 #23
[  330.570000] task: 87828000 ti: 8782c000 task.ti: 8782c000
[  330.570000] $ 0   : 00000000 00000001 00000000 00000000
[  330.570000] $ 4   : 8782dee0 00000000 fffffe80 00000001
[  330.570000] $ 8   : 00000000 84080018 80027834 80330000
[  330.570000] $12   : 7fe92af0 7784b340 00000000 00000000
[  330.570000] $16   : 8782dee0 00000000 87828000 fffffe80
[  330.570000] $20   : 8782def8 fffffff6 00000001 20000000
[  330.570000] $24   : 0041d528 77799518                  
[  330.570000] $28   : 8782c000 8782de50 87828178 80027314
[  330.570000] Hi    : 00000238
[  330.570000] Lo    : 000000ae
[  330.570000] epc   : 80026874 wait_consider_task+0x24/0x9f4
[  330.570000]     Tainted: G      D       
[  330.570000] ra    : 80027314 do_wait+0xd0/0x1e4
[  330.570000] Status: 1100e403	KERNEL EXL IE 
[  330.570000] Cause : 00800008
[  330.570000] BadVA : ffffffc8
[  330.570000] PrId  : 00019655 (MIPS 24KEc)
[  330.570000] Modules linked in: pppoe ppp_async iptable_nat pppox ppp_generic nf_nat_ipv4 nf_conntrack_ipv6 nf_conntrack_ipv4 ipt_REJECT ipt_MASQUERADE xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_id xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_CT uvcvideo uinput slhc nf_reject_ipv4 nf_nat_masquerade_ipv4 nf_nat_ftp nf_nat nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack_ftp nf_conntrack iptable_raw iptable_mangle iptable_filter ip_tables crc_ccitt snd_soc_mt76xx_machine snd_soc_mt76xx_pcm snd_soc_mt76xx_i2s snd_soc_mt76xx_i2s_ctl i2c_wm8960 snd_soc_wm8960 ralink_gdma videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common videodev i2c_ralink i2c_mt7621 snd_soc_core mt_wifi i2c_dev ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_raw ip6table_mangle ip6table_filter ip6_tables x_tables nfsv3 nfs snd_compress snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_rawmidi snd_seq_device snd_hwdep snd input_core soundcore loop vfat fat lockd sunrpc grace autofs4 nls_utf8 nls_iso8859_1 nls_cp437 regmap_spi regmap_i2c i2c_core regmap_core lzo_decompress lzo_compress ipv6 dma_shared_buffer mmc_block usb_storage sdhci_pltfm sdhci mtk_sd mmc_core ohci_platform ohci_hcd ehci_platform ehci_hcd sd_mod scsi_mod ext4 jbd2 mbcache exfat drv_regopt usbcore nls_base usb_common crc16 crypto_hash
[  330.570000] Process procd (pid: 1, threadinfo=8782c000, task=87828000, tls=7785f440)
[  330.570000] Stack : 8782df28 80012af4 77843334 800189ec 004c4b3f 00000000 00000000 7782e1ac
	  8782dee0 00000000 87828000 fffffe80 8782def8 fffffff6 00000001 80027314
	  00000000 0000000b 0000000b 0000001d 01f0da0f 0000004d 00000000 00000005
	  00000000 7fe92ae8 7784a000 7784a000 77843338 77843330 77843338 80027800
	  7fe92af4 800533e8 8003e820 7fe92808 00000003 00000005 00000000 00000000
	  ...
[  330.570000] Call Trace:
[  330.570000] [<80026874>] wait_consider_task+0x24/0x9f4
[  330.570000] [<80027314>] do_wait+0xd0/0x1e4
[  330.570000] [<80027800>] SyS_wait4+0xb4/0xe8
[  330.570000] [<80006b5c>] handle_sys+0x11c/0x140
[  330.570000] 
[  330.570000] 
Code: afb3002c  afb20028  afb10024 <8cc30148> 24020010  10620020  00c08021  8c820000  00808821 
[  330.860000] ---[ end trace 35e0c7ccf0284ff9 ]---
[  331.180000] VFS: Close: file count is 0
[  331.180000] VFS: Close: file count is 0
[  331.180000] VFS: Close: file count is 0
[  331.200000] VFS: Close: file count is 0
[  331.200000] watchdog watchdog0: watchdog did not stop!
[  331.200000] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[  331.200000] 
[  331.200000] Rebooting in 3 seconds..

更新一下: 重新启动一下, 论坛的固件好象可以airplay了, 问题算解决了, 我估计可能编译的源码和论坛的有区别, 有空再去研究. 谢谢。

@mango

我刚试了论坛里放出的固件, 32MFLASH/128MRAM的那个版本. arecord录音有声音, 但mplayer播放/tmp下的mp3仍然导致系统崩溃,另外shairplay/port不能播放的问题也在。

说实话,我不需要录音功能, arecord能不能工作对我来说完全不重要, 我只想把家里的两台老音箱变成wifi音箱. :slight_smile:

mango 说:

@jazz-rabbit
你这个固件是不是改了音频的底层?我测试任意一个mp3,用madplay播放都会死机,而我们正常发布的固件不会这样
arecord -f cd /tmp/1 必死
拔TF卡,也崩溃
!


这三个情况在我们近期的固件是没有的。确认一下

如果用如下命令行,arecord 记录的wav文件大小会超过44, 长度会随时间而增长, 但录到是静音, 有点象capture被设置静音了一样。

arecord -D default -c 1 -t wav -d 5 -f cd /mnt/mmc/1.wav

@jazz-rabbit 你可以从wiki下载一个固件,用arecord和aplay做做对比,这个是最基本的,这个正常了再说其他的播放软件。

还有就是我这里拨插mmc卡也不会引起系统崩溃,只要是播放过/tmp下文件(哪怕是madplay播放的), 一用mplayer会系统崩溃。另外的就是用pulseaudio也不能工作,我从一台机器发出paplay test.wav, 板子上跑的pulseaudio立马显示killed被强制退出来。shairplay/port都一样, 连接上没问题,一播放就失败。

@mango
没有,是淘宝买的一块neo (W7)顶配板子。用来软件实验的,没改。

mango 说:

@jazz-rabbit 测试aplay和arecord录音播放都正常?你的log里都已经报了错误,执行后正常是可以将刚才录的声音回放出来。确认一下。

我说的是系统不会崩溃哦, 我插的是iphone的耳麦到板上的声音孔,十来秒钟,arecord就自动退出了。好象没有录下东西. /tmp/1长度为44

对了,还有一点需要你确定下,你的硬件底板是不是自己添加了12MHZ晶振用来给wm8960提供时钟?

@jazz-rabbit 测试aplay和arecord录音播放都正常?你的log里都已经报了错误,执行后正常是可以将刚才录的声音回放出来。确认一下。

mango 说:

@jazz-rabbit 这样,你手里的测试arecord -f cd /tmp/1 录音和apply /tmp/1测试,这是最基本的音频底层,我这里测试会直接死机。

不会死机,很正常.

!

@jazz-rabbit 这样,你手里的测试arecord -f cd /tmp/1 录音和apply /tmp/1测试,这是最基本的音频底层,我这里测试会直接死机。

@mango
没有改底层模块. 只是编来自已私下玩的, 还没去关注驱动部分. 代码版本和最新的openwrt-widora(master)及packages(dlna_patches)基本完全一致 (引导完毕后改了少许几行uci脚本用于修改机器名和wifi名的).

我和你的情况还不一样,同样的固件, madplay却很正常, 不会象mplayer一样死掉。可以播放/tmp里的mp3无崩溃现象.

如下图:
!

你可能不能直接用自已编译的madplay来播放. 我在mac上用的工具链版本和你可能有所不同。

试下这下面的madplay包:

@jazz-rabbit
你这个固件是不是改了音频的底层?我测试任意一个mp3,用madplay播放都会死机,而我们正常发布的固件不会这样
arecord -f cd /tmp/1 必死
拔TF卡,也崩溃
!


这三个情况在我们近期的固件是没有的。确认一下