Description
I have a game that runs fine on x86 Linux but when compiling it for ARM on my Raspberry Pi 2, it often crashes the whole operating system. The issue seems to be related to the ALSA driver because it only occurs when sound is enabled in the game. No sound, no crashes.
Here is what var/log/syslog
looks like after a crash. The interesting thing is probably at 13:29:32
because it is reporting Unable to handle kernel NULL pointer dereference at virtual address 00000000
at this point which could be related to #621.
Jul 10 13:26:37 raspberrypi kernel: [ 58.723345] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:26:37 raspberrypi kernel: [ 58.723388] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:26:47 raspberrypi kernel: [ 68.566732] bcm2835_audio_set_params:583 Alsa controls not supported
Jul 10 13:26:47 raspberrypi kernel: [ 68.566756] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:26:47 raspberrypi kernel: [ 68.568377] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:04 raspberrypi kernel: [ 84.908452] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:05 raspberrypi kernel: [ 85.988429] bcm2835_audio_set_params:583 Alsa controls not supported
Jul 10 13:27:05 raspberrypi kernel: [ 85.988455] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:05 raspberrypi kernel: [ 85.988490] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:08 raspberrypi kernel: [ 88.852333] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:21 raspberrypi kernel: [ 102.173166] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:23 raspberrypi kernel: [ 104.296299] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:23 raspberrypi kernel: [ 104.296777] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:27:24 raspberrypi kernel: [ 105.071317] bcm2835_audio_set_params:583 Alsa controls not supported
Jul 10 13:27:24 raspberrypi kernel: [ 105.071345] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:24 raspberrypi kernel: [ 105.071782] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:24 raspberrypi kernel: [ 105.071813] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:27:24 raspberrypi kernel: [ 105.226809] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:24 raspberrypi kernel: [ 105.227236] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:24 raspberrypi kernel: [ 105.557247] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:27:24 raspberrypi kernel: [ 105.557448] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:24 raspberrypi kernel: [ 105.557478] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:24 raspberrypi kernel: [ 105.557501] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:27:24 raspberrypi kernel: [ 105.701905] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:25 raspberrypi kernel: [ 105.845243] bcm2835_audio_set_params:583 Alsa controls not supported
Jul 10 13:27:25 raspberrypi kernel: [ 105.845268] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:25 raspberrypi kernel: [ 105.845339] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:25 raspberrypi kernel: [ 105.845369] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:27:25 raspberrypi kernel: [ 105.845462] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:25 raspberrypi kernel: [ 105.845491] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:25 raspberrypi kernel: [ 105.845514] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:27:25 raspberrypi kernel: [ 105.954211] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:25 raspberrypi kernel: [ 105.954827] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:27:25 raspberrypi kernel: [ 106.058414] bcm2835_audio_set_params:583 Alsa controls not supported
Jul 10 13:27:25 raspberrypi kernel: [ 106.058440] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:25 raspberrypi kernel: [ 106.058474] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:25 raspberrypi kernel: [ 106.058498] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:27:25 raspberrypi kernel: [ 106.426792] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:25 raspberrypi kernel: [ 106.426838] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:27:25 raspberrypi kernel: [ 106.571810] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:42 raspberrypi kernel: [ 123.087638] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:27:43 raspberrypi kernel: [ 124.494882] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:43 raspberrypi kernel: [ 124.494935] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:43 raspberrypi kernel: [ 124.494962] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:27:43 raspberrypi kernel: [ 124.651874] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:43 raspberrypi kernel: [ 124.651913] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:43 raspberrypi kernel: [ 124.794293] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:44 raspberrypi kernel: [ 124.954301] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:44 raspberrypi kernel: [ 124.954904] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:44 raspberrypi kernel: [ 124.954945] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:27:44 raspberrypi kernel: [ 125.104276] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:27:44 raspberrypi kernel: [ 125.261245] bcm2835_audio_set_params:583 Alsa controls not supported
Jul 10 13:27:44 raspberrypi kernel: [ 125.261272] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:44 raspberrypi kernel: [ 125.390072] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:45 raspberrypi kernel: [ 125.992627] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:45 raspberrypi kernel: [ 125.992673] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:27:45 raspberrypi kernel: [ 126.582654] bcm2835_audio_set_params:583 Alsa controls not supported
Jul 10 13:27:45 raspberrypi kernel: [ 126.582682] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:27:58 raspberrypi kernel: [ 139.324682] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:27:58 raspberrypi kernel: [ 139.534663] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:28:11 raspberrypi kernel: [ 152.097032] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:28:17 raspberrypi kernel: [ 158.224712] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:28:17 raspberrypi kernel: [ 158.224755] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:28:19 raspberrypi kernel: [ 159.963772] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:28:19 raspberrypi kernel: [ 159.963817] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:28:19 raspberrypi kernel: [ 159.963843] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:28:19 raspberrypi kernel: [ 159.964184] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:28:19 raspberrypi kernel: [ 160.124924] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:28:19 raspberrypi kernel: [ 160.279402] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:28:19 raspberrypi kernel: [ 160.279726] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:28:19 raspberrypi kernel: [ 160.279758] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:28:19 raspberrypi kernel: [ 160.279781] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:28:19 raspberrypi kernel: [ 160.426672] bcm2835_audio_set_params:583 Alsa controls not supported
Jul 10 13:28:19 raspberrypi kernel: [ 160.426698] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:28:19 raspberrypi kernel: [ 160.426801] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:28:19 raspberrypi kernel: [ 160.426835] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:28:19 raspberrypi kernel: [ 160.427258] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:28:19 raspberrypi kernel: [ 160.574714] bcm2835_audio_set_params:583 Alsa controls not supported
Jul 10 13:28:19 raspberrypi kernel: [ 160.574739] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:28:19 raspberrypi kernel: [ 160.574772] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:28:19 raspberrypi kernel: [ 160.725709] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:28:20 raspberrypi kernel: [ 160.835947] bcm2835_audio_set_params:583 Alsa controls not supported
Jul 10 13:28:20 raspberrypi kernel: [ 160.835971] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:28:20 raspberrypi kernel: [ 160.836439] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:28:20 raspberrypi kernel: [ 160.926598] bcm2835_audio_set_params:583 Alsa controls not supported
Jul 10 13:28:20 raspberrypi kernel: [ 160.926622] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:28:20 raspberrypi kernel: [ 160.926659] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:28:20 raspberrypi kernel: [ 160.926815] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:28:20 raspberrypi kernel: [ 161.454756] bcm2835_audio_set_params:583 Alsa controls not supported
Jul 10 13:28:20 raspberrypi kernel: [ 161.454782] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:28:20 raspberrypi kernel: [ 161.749707] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:28:20 raspberrypi kernel: [ 161.749752] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:28:59 raspberrypi kernel: [ 200.001649] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:29:19 raspberrypi kernel: [ 219.861713] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:29:20 raspberrypi kernel: [ 221.076686] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:29:25 raspberrypi kernel: [ 226.166698] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:29:26 raspberrypi kernel: [ 227.191703] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:29:32 raspberrypi kernel: [ 233.249388] Unable to handle kernel NULL pointer dereference at virtual address 00000000
Jul 10 13:29:32 raspberrypi kernel: [ 233.255890] bcm2835_audio_set_params:583 Alsa controls not supported
Jul 10 13:29:32 raspberrypi kernel: [ 233.255897] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:29:32 raspberrypi kernel: [ 233.255924] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:29:32 raspberrypi kernel: [ 233.256710] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:29:32 raspberrypi kernel: [ 233.257505] pgd = 80004000
Jul 10 13:29:32 raspberrypi kernel: [ 233.260208] [00000000] *pgd=00000000
Jul 10 13:29:32 raspberrypi kernel: [ 233.261711] bcm2835_audio_set_params:583 Alsa controls not supported
Jul 10 13:29:32 raspberrypi kernel: [ 233.261716] snd_bcm2835_pcm_prepare:329 error setting hw params
Jul 10 13:29:32 raspberrypi kernel: [ 233.261739] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 0
Jul 10 13:29:32 raspberrypi kernel: [ 233.263612]
Jul 10 13:29:32 raspberrypi kernel: [ 233.263806] Internal error: Oops: 5 [#1] SMP ARM
Jul 10 13:29:32 raspberrypi kernel: [ 233.265888] bcm2835_audio_set_ctls:556 Couldn't set the controls for stream 1
Jul 10 13:29:32 raspberrypi kernel: [ 233.275537] Modules linked in: arc4 ecb md4 md5 hmac nls_utf8 cifs snd_bcm2835 snd_pcm snd_seq snd_seq_device snd_timer snd bcm2835_gpiomem bcm2835_wdt evdev joydev uio_pdrv_genirq uio
Jul 10 13:29:32 raspberrypi kernel: [ 233.292104] CPU: 1 PID: 70 Comm: VCHIQ-0 Not tainted 4.4.14-v7+ #896
Jul 10 13:29:32 raspberrypi kernel: [ 233.298450] Hardware name: BCM2709
Jul 10 13:29:32 raspberrypi kernel: [ 233.301849] task: b9081140 ti: b9068000 task.ti: b9068000
Jul 10 13:29:32 raspberrypi kernel: [ 233.307256] PC is at __wake_up_common+0x30/0x90
Jul 10 13:29:32 raspberrypi kernel: [ 233.311787] LR is at __wake_up_locked+0x24/0x2c
Jul 10 13:29:32 raspberrypi kernel: [ 233.316319] pc : [<80063238>] lr : [<800632bc>] psr: a0050093
Jul 10 13:29:32 raspberrypi kernel: [ 233.316319] sp : b9069e18 ip : b9069e48 fp : b9069e44
Jul 10 13:29:32 raspberrypi kernel: [ 233.327788] r10: 00000001 r9 : 00000003 r8 : 00000000
Jul 10 13:29:32 raspberrypi kernel: [ 233.327794] r7 : 00000000 r6 : b7612118 r5 : b7612110 r4 : b7612114
Jul 10 13:29:32 raspberrypi kernel: [ 233.327799] r3 : 00000000 r2 : 00000001 r1 : 00000000 r0 : b7612114
Jul 10 13:29:32 raspberrypi kernel: [ 233.327808] Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel
Jul 10 13:29:32 raspberrypi kernel: [ 233.327833] Control: 10c5387d Table: 389d006a DAC: 00000055
Jul 10 13:29:32 raspberrypi kernel: [ 233.327840] Process VCHIQ-0 (pid: 70, stack limit = 0xb9068210)
Jul 10 13:29:32 raspberrypi kernel: [ 233.327848] Stack: (0xb9069e18 to 0xb906a000)
Jul 10 13:29:32 raspberrypi kernel: [ 233.327856] 9e00: 00000000 b7612114
Jul 10 13:29:32 raspberrypi kernel: [ 233.327868] 9e20: b7612110 60050013 00000000 b9341200 bac91c90 8095ea64 b9069e5c b9069e48
Jul 10 13:29:32 raspberrypi kernel: [ 233.327880] 9e40: 800632bc 80063214 00000000 b7612110 b9069e7c b9069e60 80063b60 800632a4
Jul 10 13:29:32 raspberrypi kernel: [ 233.327890] 9e60: 00000000 b7612100 00000000 bac91c90 b9069eb4 b9069e80 7f07be9c 80063b28
Jul 10 13:29:32 raspberrypi kernel: [ 233.327902] 9e80: 00000000 b9341200 00000014 00000000 00000000 3df6e9bc 3dfaef04 00000000
Jul 10 13:29:32 raspberrypi kernel: [ 233.327913] 9ea0: b75e6900 00000002 b9069ed4 b9069eb8 803d4154 7f07bde8 00000020 803d4080
Jul 10 13:29:32 raspberrypi kernel: [ 233.327924] 9ec0: 45043003 808a7f1c b9069f5c b9069ed8 803cc800 803d408c 00000000 80875408
Jul 10 13:29:32 raspberrypi kernel: [ 233.327935] 9ee0: 808618c4 b9081424 b9069f44 b9069ef8 805b4d08 8004988c fff9fee9 b9911ccc
Jul 10 13:29:32 raspberrypi kernel: [ 233.327947] 9f00: 805ed708 bac80194 bac80020 00000014 000c9cb0 00000003 00000014 bac80194
Jul 10 13:29:32 raspberrypi kernel: [ 233.327958] 9f20: fff9fee9 ffffffff 00000000 00000000 00000000 00000000 b906b8c0 8095ea64
Jul 10 13:29:32 raspberrypi kernel: [ 233.327970] 9f40: 803cb8f8 00000000 00000000 00000000 b9069fac b9069f60 80042678 803cb904
Jul 10 13:29:32 raspberrypi kernel: [ 233.327981] 9f60: 39718000 00000000 00000000 8095ea64 00000000 00000000 b9069f78 b9069f78
Jul 10 13:29:32 raspberrypi kernel: [ 233.327992] 9f80: 00000000 00000000 b9069f88 b9069f88 b906b8c0 8004258c 00000000 00000000
Jul 10 13:29:32 raspberrypi kernel: [ 233.328002] 9fa0: 00000000 b9069fb0 8000fbc8 80042598 00000000 00000000 00000000 00000000
Jul 10 13:29:32 raspberrypi kernel: [ 233.328013] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Jul 10 13:29:32 raspberrypi kernel: [ 233.328023] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
Jul 10 13:29:32 raspberrypi kernel: [ 233.328059] [<80063238>] (__wake_up_common) from [<800632bc>] (__wake_up_locked+0x24/0x2c)
Jul 10 13:29:32 raspberrypi kernel: [ 233.328077] [<800632bc>] (__wake_up_locked) from [<80063b60>] (complete+0x44/0x54)
Jul 10 13:29:32 raspberrypi kernel: [ 233.328118] [<80063b60>] (complete) from [<7f07be9c>] (audio_vchi_callback+0xc0/0x130 [snd_bcm2835])
Jul 10 13:29:32 raspberrypi kernel: [ 233.328161] [<7f07be9c>] (audio_vchi_callback [snd_bcm2835]) from [<803d4154>] (shim_callback+0xd4/0x118)
Jul 10 13:29:32 raspberrypi kernel: [ 233.328182] [<803d4154>] (shim_callback) from [<803cc800>] (slot_handler_func+0xf08/0x1858)
Jul 10 13:29:32 raspberrypi kernel: [ 233.328199] [<803cc800>] (slot_handler_func) from [<80042678>] (kthread+0xec/0x104)
Jul 10 13:29:32 raspberrypi kernel: [ 233.328219] [<80042678>] (kthread) from [<8000fbc8>] (ret_from_fork+0x14/0x2c)
Jul 10 13:29:32 raspberrypi kernel: [ 233.328233] Code: e1a0a002 e1a08003 e1560001 e59b7004 (e5914000)
Jul 10 13:29:32 raspberrypi kernel: [ 233.328245] ---[ end trace b848eb8e41ea8852 ]---
I've tested this with the latest kernel (Linux raspberrypi 4.4.14-v7+ #896 SMP Sat Jul 2 15:09:43 BST 2016 armv7l GNU/Linux
) on two different machines. They both aren't overclocked and run at 700mhz. So it shouldn't be a hardware fault.
When the error occurs it usually renders the system unusable. Even rebooting is often not possible any more after the error has occurred making this quite a nightmare to debug.
It only seems to happen when the sound driver is in a stress situation. Unfortunately, I wasn't able to isolate the problem so the only test program I can provide is the full game. You can grab it here: http://www.softwarefailure.de/tmp/demo.tar.gz (I'm sorry but it's a 70 MB file)
Just try to play the game and the kernel should crash pretty soon. Sometimes it takes a few minutes but normally it happens earlier.