mpd-full + upmpdcli: out of memory with certain audio files
Nobody has claimed this yet.
- Dominant language
- Makefile
- Stars
- 4.6k
- Forks
- 4k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 134
Description
Maintainer: @thess @ignisf
Environment: Oolite v5.1 board (CPU: QCA9531, RAM: 128 MB), mips24_kc, SNAPSHOT r6712-7e32e86, ar71xx/generic, kernel 4.9.91, Upmpdcli 1.4.6 libupnpp 0.17.2, Music Player Daemon 0.21.25 (0.21.25)
Description:
The system goes in "out of memory" when I try to stream certain FLAC files (44,1 kHz 24bit) using upmpdcli + mpd in combination with BubbleUPnP (Android version). If the same audio files are reproduced locally (i.e., using mpc and reading them from an USB stick connected to the board, so not using upmpdcli) everything is fine.
Mpd logs show these messages when the board reaches the out of memory condition:
alsa_output: Underrun on ALSA device "hw:CARD=x20,DEV=0"
alsa_output: Decoder is too slow; playing silence to avoid xrun
When the system is in the out of memory condition, I need to reboot the board since everything is unresponsive. Sometimes is the system to kill MPD, as shown in the following dmesg logs:
[ 3226.622712] hostapd invoked oom-killer: gfp_mask=0x2420848(GFP_NOFS|__GFP_NOFAIL|__GFP_HARDWALL|__GFP_MOVABLE), nodemask=0, order=0, oom_score_adj=0
[ 3226.636662] CPU: 0 PID: 1341 Comm: hostapd Not tainted 4.9.91 #0
[ 3226.642898] Stack : 804f767a 00000034 00000000 00000001 87c99c4c 804792a7 8042942c 0000053d
[ 3226.651644] 804f37c0 ffffffff 00000001 00200000 00000001 800a957c 00000000 00000004
[ 3226.660352] 00000006 8048b2b4 8042ce1c 8692f984 00000000 800d736c 804f767a 00000088
[ 3226.669071] 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 3226.677779] 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 3226.686470] ...
[ 3226.689026] Call Trace:
[ 3226.691574] [<8006b530>] show_stack+0x70/0x8c
[ 3226.696112] [<80112a70>] dump_header.isra.5+0x80/0x174
[ 3226.701477] [<800dce34>] oom_kill_process+0xac/0x404
[ 3226.706620] [<800dd6d4>] out_of_memory+0x3c4/0x3e8
[ 3226.711599] [<800e0c78>] __alloc_pages_nodemask+0x92c/0x9a8
[ 3226.717362] [<800d92b0>] pagecache_get_page+0x268/0x354
[ 3226.722794] [<801455fc>] __getblk_gfp+0xfc/0x378
[ 3226.727605] [<8017267c>] squashfs_read_data+0x25c/0x6f0
[ 3226.733022] [<801767e0>] squashfs_readpage_block+0x400/0x5d0
[ 3226.738888] [<801743f0>] squashfs_readpage+0x540/0x680
[ 3226.744211] [<800e534c>] __do_page_cache_readahead+0x21c/0x274
[ 3226.750261] [<800db8cc>] filemap_fault+0x2a0/0x5cc
[ 3226.755243] [<800f94cc>] __do_fault+0x68/0x108
[ 3226.759863] [<800fca34>] handle_mm_fault+0x448/0xb2c
[ 3226.765051] [<8007183c>] __do_page_fault+0x23c/0x468
[ 3226.770229] [<80066380>] ret_from_exception+0x0/0x10
[ 3226.775357] Mem-Info:
[ 3226.777749] active_anon:22307 inactive_anon:16 isolated_anon:0
[ 3226.777749] active_file:313 inactive_file:315 isolated_file:0
[ 3226.777749] unevictable:0 dirty:0 writeback:0 unstable:0
[ 3226.777749] slab_reclaimable:198 slab_unreclaimable:1274
[ 3226.777749] mapped:85 shmem:27 pagetables:89 bounce:0
[ 3226.777749] free:4094 free_pcp:13 free_cma:0
[ 3226.810729] Node 0 active_anon:89228kB inactive_anon:64kB active_file:1252kB inactive_file:1260kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:340kB dirty:0kB writeback:0kB shmem:108kB writeback_tmp:0kB unstable:0kB pages_scanned:25523 all_unreclaimable? yes
[ 3226.835803] Normal free:16376kB min:16384kB low:20480kB high:24576kB active_anon:89228kB inactive_anon:64kB active_file:1252kB inactive_file:1260kB unevictable:0kB writepending:0kB present:131072kB managed:124880kB mlocked:0kB slab_reclaimable:792kB slab_unreclaimable:5096kB kernel_stack:520kB pagetables:356kB bounce:0kB free_pcp:52kB local_pcp:52kB free_cma:0kB
[ 3226.868907] lowmem_reserve[]: 0 0
[ 3226.872357] Normal: 80*4kB (UME) 93*8kB (UME) 65*16kB (UME) 16*32kB (ME) 27*64kB (UME) 14*128kB (UME) 8*256kB (UME) 2*512kB (ME) 1*1024kB (M) 1*2048kB (E) 1*4096kB (M) = 16376kB
655 total pagecache pages
[ 3226.891376] 0 pages in swap cache
[ 3226.894801] Swap cache stats: add 0, delete 0, find 0/0
[ 3226.900212] Free swap = 0kB
[ 3226.903188] Total swap = 0kB
[ 3226.906163] 32768 pages RAM
[ 3226.909067] 0 pages HighMem/MovableOnly
[ 3226.913034] 1548 pages reserved
[ 3226.916281] [ pid ] uid tgid total_vm rss nr_ptes nr_pmds swapents oom_score_adj name
[ 3226.925126] [ 518] 0 518 296 15 3 0 0 0 ubusd
[ 3226.934053] [ 525] 0 525 225 10 3 0 0 0 askfirst
[ 3226.943231] [ 783] 0 783 306 27 4 0 0 0 logd
[ 3226.952059] [ 858] 0 858 413 46 4 0 0 0 netifd
[ 3226.961068] [ 894] 0 894 355 39 3 0 0 0 odhcpd
[ 3226.970074] [ 953] 0 953 266 11 3 0 0 0 dropbear
[ 3226.979262] [ 1148] 0 1148 300 11 3 0 0 0 ntpd
[ 3226.988088] [ 1233] 51 1233 2559 116 5 0 0 0 pulseaudio
[ 3226.997460] [ 1341] 0 1341 424 38 4 0 0 0 hostapd
[ 3227.006534] [ 1484] 453 1484 328 34 4 0 0 0 dnsmasq
[ 3227.015644] [ 1509] 0 1509 283 62 3 0 0 0 dropbear
[ 3227.024833] [ 1510] 0 1510 301 11 4 0 0 0 ash
[ 3227.033566] [ 1540] 0 1540 283 26 3 0 0 0 dropbear
[ 3227.042754] [ 1541] 0 1541 301 11 4 0 0 0 ash
[ 3227.051497] [ 1648] 0 1648 25422 21812 28 0 0 0 mpd
[ 3227.060230] [ 1788] 89 1788 1568 156 4 0 0 0 upmpdcli
[ 3227.069417] [ 1804] 0 1804 300 17 3 0 0 0 top
[ 3227.078148] Out of memory: Kill process 1648 (mpd) score 678 or sacrifice child
[ 3227.085741] Killed process 1648 (mpd) total-vm:101688kB, anon-rss:87032kB, file-rss:216kB, shmem-rss:0kB
[ 3228.235104] oom_reaper: reaped process 1648 (mpd), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
I don't know if it is a problem of mpd or upmpdcli, the strange thing is that, from USB, the files are reproduced correctly.
I am a linux newbe, please forgive me if I have made some mistakes in this issue report.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is identified. Start by reproducing the failure with the reported OpenWrt, MPD, upmpdcli, and BubbleUPnP versions, then compare streaming through upmpdcli with local playback via mpc. Done means identifying whether MPD or upmpdcli causes the memory growth and recording a confirmed fix or handoff.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100