jgarff / rpi_ws281x

Userspace Raspberry Pi PWM library for WS281X LEDs
BSD 2-Clause "Simplified" License
1.77k stars 621 forks source link

"Can't open device file /tmp/mailbox-XXXX: No such device or address" - Kernel 4.1.6 #41

Closed Gadgetoid closed 8 years ago

Gadgetoid commented 9 years ago

It looks like Kernel 4.1.6 has introduced some changes which have broken the use of Mailbox functionality in this library. I've updated to the latest Raspbian, Linux 4.1.6-v7+ #810 and am no longer able to get it working.

The error seems to be with opening the device after creation, despite creation seemingly happening fine and not throwing any errors:

Can't open device file /tmp/mailbox-XXXX: No such device or address

I've seen at least one other report of this problem in respect to our Unicorn HAT library, and another seemingly related problem on this thread here: https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=117547

I've tried stabbing in the dark to see if I can get it working again- but I'm a little out of my depth!

Gadgetoid commented 9 years ago

Turns out the fix for this is to prefer /dev/vcio and fall back to creating a mailbox device when it doesn't exist. I've tested this on Pi 2, Kernel 4.1.6 and it appears to work. Relevant code here: https://github.com/pimoroni/unicorn-hat/commit/5c03f81b72eb2e44c58f850db4e3fad90dc3d7a7

tejonbiker commented 9 years ago

Thanks you very much, it's now working :D

marcuscraske commented 9 years ago

Thank you so much, working here on the Pi 2 on 4.1.6 too!

Is /dev/vcio used on the Pi for memory mapping access to the GPIO?

usefulthink commented 9 years ago

@limpygnome iirc, the memory-mapped I/O related to DMA and PWM-Setup (you could call that GPIO-handling) is done using raw physical memory (/dev/mem).

/dev/vcio (or the previous version using /tmp/mailbox-xxxx devices) is a feature provided by the video-core, where the driver borrows memory to store the PWM-data to be transferred to the PWM-module using DMA.

(this is how I understood and researched it so far, please correct me if I got something wrong here)

jgarff commented 8 years ago

I just created a rpi2 branch which supports newer kernels and the Raspberry Pi 2. This is a testing branch, so please give it a shot and let me know if you run into problems. Thanks.

tsuckow commented 8 years ago

On an rpi it never seems to get past init.

Seems to get stuck waiting for CM_PWM_CTL_BUSY

jgarff commented 8 years ago

Did you sync the rpi2 branch, and is this happinging on a pi2?

tsuckow commented 8 years ago

RPI 1B running Arch linux arm pi (alarmpi)

The main branch doesn't work anymore because of the mailbox issue. The rpi2 branch gets past that but hangs on the CM_PWM_CTL_BUSY tight loop.

Edit: At some point, I will try to do a clean Arch install. For now I am running raspbian so I can demo at the Barnes & Noble Mini Maker Faire.

Edit2: rpi2 branch works on Raspbian

jgarff commented 8 years ago

Please make sure your audio device isn't being used. The raspberry pi uses the PWM controller for the analog audio, so it's not possible to use both at the same time. Not sure if Arch is enabling audio by default.

wefalk commented 8 years ago

Still get error: "Can't open device file /tmp/mailbox-10709: No such device or address" on rpi2 branch

System: Linux raspberrypi 4.1.7-v7+ #817 SMP PREEMPT Sat Sep 19 15:32:00 BST 2015 armv7l GNU/Linux

hjoertel commented 8 years ago

I stumbled here as well when trying to control ws2812 LED stripes using the PiZero. PiZero came with kernel 4.1.13. I did only change mailbox.h definitions for the vcio driver major number and the ioctl code.

keerthanamanivannan commented 8 years ago

Hey hjoertel, same here. I'm trying to run this library on RPi Zero with neopixel ws2812 ring. I'm getting this error: Can't open device file /tmp/mailbox-12666: No such device or address Can't open device file /tmp/mailbox-12666: No such device or address Can't open device file /tmp/mailbox-12666: No such device or address

What did you change the vcio driver major number to? And what's this change in ioctl code?

wefalk commented 8 years ago

Hi hjortel:

What I did was to enable the use of the device tree from within raspi-config. That fixed it! No other changes.

Hope it works for you, please let me know either way…

wefalk

From: Keerthana Subramanian Manivannan [mailto:notifications@github.com] Sent: Wednesday, July 20, 2016 2:08 PM To: jgarff/rpi_ws281x Cc: William Falk; Comment Subject: Re: [jgarff/rpi_ws281x] "Can't open device file /tmp/mailbox-XXXX: No such device or address" - Kernel 4.1.6 (#41)

Hey hjoertel, same here. I'm trying to run this library on RPi Zero with neopixel ws2812 ring. I'm getting this error: Can't open device file /tmp/mailbox-12666: No such device or address Can't open device file /tmp/mailbox-12666: No such device or address Can't open device file /tmp/mailbox-12666: No such device or address

What did you change the vcio driver major number to? And what's this change in ioctl code?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/jgarff/rpi_ws281x/issues/41#issuecomment-234049961, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOqA2NA38uxTwIDxNlNsGPQIDo91-4ziks5qXnIAgaJpZM4FxDTO.

keerthanamanivannan commented 8 years ago

Hi wefalk, How'd you enable device trees from raspi-config? I go to Advanced options and there's no device tree option.. I just enabled the spi and i2c ones. rebooted and I'm still getting the /tmp/mailbox errors.

keerthanamanivannan commented 8 years ago

And did you also get the /tmp/mailbox error? How did you fix it?

wefalk commented 8 years ago

I was getting the error until turning on the device tree, then the error disappeared…

And did you also get the /tmp/mailbox error? How did you fix it?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/jgarff/rpi_ws281x/issues/41#issuecomment-234058001, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOqA2LRx5MmkOWH9wsJ0B5JNA2O-jQXrks5qXnjIgaJpZM4FxDTO.

keerthanamanivannan commented 8 years ago

Wait, how'd you turn on the device tree?

wefalk commented 8 years ago

Perhaps it does not exist on the Pi Zero, it did work on the Pi 2. I have no experience with the Zero at this point.

Best of luck

wefalk

From: Keerthana Subramanian Manivannan [mailto:notifications@github.com] Sent: Wednesday, July 20, 2016 2:36 PM To: jgarff/rpi_ws281x Cc: William Falk; Comment Subject: Re: [jgarff/rpi_ws281x] "Can't open device file /tmp/mailbox-XXXX: No such device or address" - Kernel 4.1.6 (#41)

Hi wefalk, How'd you enable device trees from raspi-config? I go to Advanced options and there's no device tree option..

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/jgarff/rpi_ws281x/issues/41#issuecomment-234057780, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOqA2BChpECTeKJdO8ws1xvkYhTCjkY5ks5qXnibgaJpZM4FxDTO.

keerthanamanivannan commented 8 years ago

oh ok thanks. I'm just poking around here and there trying to fix the mailbox error. Hoping @hjoertel or @jgarff will give me answers to fix it!

wefalk commented 8 years ago

Good luck!

Get Outlook for iOShttps://aka.ms/o0ukef

On Wed, Jul 20, 2016 at 2:52 PM -0500, "Keerthana Subramanian Manivannan" notifications@github.com<mailto:notifications@github.com> wrote:

oh ok thanks. I'm just poking around here and there trying to fix the mailbox error. Hoping @hjoertelhttps://github.com/hjoertel or @jgarffhttps://github.com/jgarff will give me answers to fix it!

You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/jgarff/rpi_ws281x/issues/41#issuecomment-234061933, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOqA2BaiVcRrMN1zhtSryO4qxdpDH0Wyks5qXnxqgaJpZM4FxDTO.

hjoertel commented 8 years ago

Am Mittwoch, 20. Juli 2016, 12:52:10 schrieb Keerthana Subramanian Manivannan:

oh ok thanks. I'm just poking around here and there trying to fix the mailbox error. Hoping @hjoertel or @jgarff will give me answers to fix it!

Hi Keerthana,

sorry for letting this topic open. It's working for month now and I don't know what I did to get it working. Unfortunately I'm just not able to look at it. If you can wait 7 to 8 days? When I#m back at my PC I'll look what i will find. Please check http://oertel-halle.de/projects/LEDstripes where I wrote down something I did.

regards Heinz

mit freundlichen Grüßen Heinz-Jürgen Oertel

jgarff commented 8 years ago

Which distro are you running? It seems that it's lacking some Broadcom kernel support which is required to get to the right type of non-cacheable memory. I know that the default raspbian image supports it, you might try running that instead. You also need to remember to run as root.