ALSA giving VCHIQ atomic scheduling error


9 posts
by n_K » Mon Jun 18, 2012 9:15 pm
Hi.
I've got a RPi with 2 SD cards and 2 USB Drives, one with Arch and another with Gentoo...
The gentoo system works great! ALSA support is fine, everythings working... Arch on the other hand will not play nicely with ALSA at all and gives a dreaded 'VCHIQ scheduling while atomic' error. I've updated the kernel to the newest, used the arch kernel config file and even recompiled using my gentoo setup config file but it still does the exact same thing, and I've really no idea why or how to fix it, does anyone have any ideas?

I've also got an old lego webcam (it's a logitech on the inside) which works fine on every PC I use it on (It used to work on a 500Mhz AMD back in the day) but trying it on arch using mplayer, motion, xawtv, qv4l2... None of them work with it, generally just slows the system down to a crawl and gives 'v4l2 timeout' messages all over the terminal, yet I've got another webcam with a PAC207 SOC and that works OK using mplayer, but as far as I know it's got a (slightly) higher resolution than the lego webcam and I can't think why it won't work!

(And a final problem which is more an RPi problem not arch... Last one I promise :P) is booting the RPi.. I had an 8GB card which I've had to return due to it being flaky, so I'm left with a 2GB miniSD card and adapter (works fine) and an old 512MB toshiba SD card... The problem is with the toshiba SD card, when turning the RPi on there's possibly a 1 in 20 chance it will actually work, the other times either the green and red light stay on full brightness or the red light is on full brightness and the green led is only just lit slightly, and I have to remove the card and remove the power to the RPi for about 5 minutes before trying again. It's not a fast SD card and it works in every PC with an SD reader so the problem has to be with the RPi but I've really no clue as to why it happens at all :S

Anyway, great work to everyone that's worked on this awesome board and software for it :D
Posts: 10
Joined: Mon Jun 18, 2012 9:04 pm
by dom » Mon Jun 18, 2012 9:23 pm
n_K wrote:Hi.
The gentoo system works great! ALSA support is fine, everythings working... Arch on the other hand will not play nicely with ALSA at all and gives a dreaded 'VCHIQ scheduling while atomic' error. I've updated the kernel to the newest, used the arch kernel config file and even recompiled using my gentoo setup config file but it still does the exact same thing, and I've really no idea why or how to fix it, does anyone have any ideas?

Can you post the stacktrace?
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3998
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by n_K » Tue Jun 19, 2012 7:33 am
Sure, here it is when I compiled using the gentoo config;

[ 77.223068] snd_bcm2835_playback_open:97 Alsa open (0)
[ 87.341169] BUG: scheduling while atomic: VCHIQ-0/29/0x00000003
[ 87.341367] Modules linked in: ipv6 binfmt_misc
[ 87.341538] Backtrace:
[ 87.341675] [<c0011cb4>] (dump_backtrace+0x0/0x10c) from [<c0394428>] (dump_stack+0x18/0x1c)
[ 87.341887] r6:cd90e1a0 r5:cd958000 r4:00000000 r3:60000093
[ 87.342114] [<c0394410>] (dump_stack+0x0/0x1c) from [<c03944fc>] (__schedule_bug+0x54/0x60)
[ 87.342340] [<c03944a8>] (__schedule_bug+0x0/0x60) from [<c0398a60>] (__schedule+0x510/0x594)
[ 87.342551] r4:cd958000 r3:00000000
[ 87.342697] [<c0398550>] (__schedule+0x0/0x594) from [<c0398ff0>] (schedule+0x50/0x68)
[ 87.342921] [<c0398fa0>] (schedule+0x0/0x68) from [<c0399acc>] (__mutex_lock_interruptible_slowpath+0xf0/0x1d8)
[ 87.343193] [<c03999dc>] (__mutex_lock_interruptible_slowpath+0x0/0x1d8) from [<c0399be0>] (mutex_lock_interruptible+0x2c/0x34)
[ 87.343506] [<c0399bb4>] (mutex_lock_interruptible+0x0/0x34) from [<c0241514>] (vcos_mutex_lock+0x10/0x28)
[ 87.343778] [<c0241504>] (vcos_mutex_lock+0x0/0x28) from [<c02dca04>] (bcm2835_audio_write+0x3c/0x228)
[ 87.344035] [<c02dc9c8>] (bcm2835_audio_write+0x0/0x228) from [<c02dae30>] (snd_bcm2835_pcm_silence+0x28/0x2c)
[ 87.344322] [<c02dae08>] (snd_bcm2835_pcm_silence+0x0/0x2c) from [<c02d7e34>] (snd_pcm_playback_silence+0x160/0x2d8)
[ 87.344612] [<c02d7cd4>] (snd_pcm_playback_silence+0x0/0x2d8) from [<c02d82e8>] (snd_pcm_update_hw_ptr0+0x234/0x25c)
[ 87.344904] [<c02d80b4>] (snd_pcm_update_hw_ptr0+0x0/0x25c) from [<c02d83f0>] (snd_pcm_period_elapsed+0xe0/0x118)
[ 87.345184] [<c02d8310>] (snd_pcm_period_elapsed+0x0/0x118) from [<c02db34c>] (bcm2835_playback_fifo_irq+0xa0/0xc4)
[ 87.345457] r7:00001430 r6:000006f0 r5:00000001 r4:cc93eea0
[ 87.345682] [<c02db2ac>] (bcm2835_playback_fifo_irq+0x0/0xc4) from [<c02dba1c>] (audio_vchi_callback+0x1b8/0x1f8)
[ 87.345940] r8:c051f9c4 r7:c02db2ac r6:cc93eea0 r5:c053d3a8 r4:cc93e190
[ 87.346180] r3:cc93eee8
[ 87.346316] [<c02db864>] (audio_vchi_callback+0x0/0x1f8) from [<c023c858>] (shim_callback+0x5c/0x130)
[ 87.346554] r7:c051f9f8 r6:00000005 r5:00000023 r4:cc93e1f0
[ 87.346786] [<c023c7fc>] (shim_callback+0x0/0x130) from [<c023aa84>] (slot_handler_func+0xea8/0x12a8)
[ 87.347023] r4:cdacf610 r3:00000000
[ 87.347178] [<c0239bdc>] (slot_handler_func+0x0/0x12a8) from [<c024167c>] (vcos_thread_wrapper+0x50/0x9c)
[ 87.347443] [<c024162c>] (vcos_thread_wrapper+0x0/0x9c) from [<c0045388>] (kthread+0x8c/0x94)
[ 87.347664] r5:c051fa34 r4:cd82be54
[ 87.347813] [<c00452fc>] (kthread+0x0/0x94) from [<c002c36c>] (do_exit+0x0/0x724)
[ 87.348009] r6:c002c36c r5:c00452fc r4:cd82be54
[ 92.329290] vcos: [318]: bcm2835_audio_write:778 bcm2835_audio_write: failed on vchi_bulk_queue_transmit (status=-1)
[ 92.332424] snd_bcm2835_playback_close:167 Alsa close

And here is using the stock 3.1.9-22 ARCH kernel;

snd_bcm2835_playback_open:97 Alsa open (0)
BUG: scheduling while atomic: VCHIQ-0/29/0x00000003
Modules linked in: snd_bcm2835 snd_pcm snd_page_alloc snd_timer snd soundcore ipv6 evdev
Backtrace:
Function entered at [<c0011870>] from [<c047819c>]
r6:cd90d420 r5:ffffffff r4:00000000 r3:40000093
Function entered at [<c0478184>] from [<c0478270>]
Function entered at [<c047821c>] from [<c04809a0>]
r4:00000000 r3:00000000
Function entered at [<c0480500>] from [<c0480edc>]
Function entered at [<c0480e8c>] from [<c0481a04>]
Function entered at [<c048192c>] from [<c0481b04>]
Function entered at [<c0481ad8>] from [<c0315278>]
Function entered at [<c0315268>] from [<bf06bf90>]
Function entered at [<bf06bf54>] from [<bf06a3bc>]
Function entered at [<bf06a394>] from [<bf062a78>]
Function entered at [<bf062918>] from [<bf062f2c>]
Function entered at [<bf062cf8>] from [<bf063024>]
Function entered at [<bf062f54>] from [<bf06a8d8>]
r7:000024f0 r6:000006f0 r5:00000001 r4:cc95d920
Function entered at [<bf06a838>] from [<bf06afa8>]
r8:c05a7cbc r7:bf06a838 r6:cc95d920 r5:bf06dc0c r4:cc95d810
r3:cc95d968
Function entered at [<bf06adf0>] from [<c0310744>]
r7:c05a7cf0 r6:00000005 r5:00000023 r4:cc95d7b0
Function entered at [<c03106e8>] from [<c030e9ec>]
r4:cda9f010 r3:00000000
Function entered at [<c030db44>] from [<c03153e0>]
Function entered at [<c0315390>] from [<c003e724>]
r5:c05a7d2c r4:cd829e64
Function entered at [<c003e698>] from [<c00261f4>]
r6:c00261f4 r5:c003e698 r4:cd829e64
vcos: [329]: bcm2835_audio_write:778 bcm2835_audio_write: failed on vchi_bulk_queue_transmit (status=-1)
snd_bcm2835_playback_close:167 Alsa close
Posts: 10
Joined: Mon Jun 18, 2012 9:04 pm
by dom » Tue Jun 19, 2012 8:59 am
Thanks.
So silence gets called from interrupt context? Didn't know that. Where is this described?
I'll take a look.

What app were you running to produce the audio?
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3998
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by n_K » Tue Jun 19, 2012 9:44 am
Using mplayer on both gentoo and arch.
Not sure if they were compiled with the same flags (gentoo mplayer came precompiled with it's own useflags and arch's is using the default package)
Posts: 10
Joined: Mon Jun 18, 2012 9:04 pm
by ratherDashing » Wed Jun 20, 2012 8:02 pm
dom wrote:Thanks.
So silence gets called from interrupt context? Didn't know that. Where is this described?
I'll take a look.

What app were you running to produce the audio?


i get a very similar issue using pianobar in raspbian. I can provide a ST if necessary but it is easily repeatable.
Posts: 39
Joined: Tue Jun 05, 2012 3:00 am
by dom » Thu Jun 21, 2012 1:10 pm
Thanks for report. I've fixed a problem in ALSA driver. Please update and retest.
http://elinux.org/R-Pi_Troubleshooting# ... g_firmware
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3998
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by pepedog » Thu Jun 21, 2012 2:23 pm
In queue on builder, look for version .23
Posts: 960
Joined: Fri Oct 07, 2011 9:55 am
by ratherDashing » Thu Jun 21, 2012 6:53 pm
dom wrote:Thanks for report. I've fixed a problem in ALSA driver. Please update and retest.
http://elinux.org/R-Pi_Troubleshooting# ... g_firmware


Seems to work now (I'm actually away from my raspberry pi but I can only assume it's playing happily to an empty house as I no longer get errors). Only error I get now with pianobar is:

Code: Select all
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front


every time:

Code: Select all
snd_bcm2835_playback_open:97 Alsa open (0)


gets printed to dmesg
Posts: 39
Joined: Tue Jun 05, 2012 3:00 am