Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/dev/spidev1.0 not selectable in Webinterface #1110

Closed
1 task done
ChR-iSz opened this issue Dec 6, 2020 · 19 comments
Closed
1 task done

/dev/spidev1.0 not selectable in Webinterface #1110

ChR-iSz opened this issue Dec 6, 2020 · 19 comments

Comments

@ChR-iSz
Copy link
Contributor

ChR-iSz commented Dec 6, 2020

  • I confirm that this is an issue rather than a question.

Bug report

Second LED Stripe on Raspberry 4 GPIO /dev/spidev1.0 not selectable from Webinterface

Steps to reproduce

Add dtoverlay=spi1-3cs in /boot/config.txt to enable the seconds SPI Device

What is expected?

In Webinterface: LED Hardware -> Controller Type -> ws2801 -> SPI Path -> /dev/spidev1.0 selectable.

What is actually happening?

In Webinterface: LED Hardware -> Controller Type -> ws2801 -> SPI Path -> Only /dev/spidev0.0, and /dev/spidev0.1 selectable.

System

Raspberry PI 4 -> Hyperion.ng -> Your version: 2.0.0-alpha.7

@Lord-Grey
Copy link
Collaborator

Currently, only those two values are selectable.
We are currently exploring to have the list generated dynamically, but that is still in the making.

Until then you add the additional GPIOs into the "output"

./libsrc/leddevice/schemas/schema-ws2801.json

and do a Pull request.

Note: You with also extend other devices where GPIO selections are provided.

@Arthur-Koo
Copy link

I've tried that on Pi3 with additional line 'core_freq=250' in boot.txt. There is output from GPIO 20, but the light doesn't change.

@Lord-Grey
Copy link
Collaborator

And did you check the log output for errors?
You might want starting Hyperion in debug mode and share the log output...

@ChR-iSz
Copy link
Contributor Author

ChR-iSz commented Dec 10, 2020

I've tried that on Pi3 with additional line 'core_freq=250' in boot.txt. There is output from GPIO 20, but the light doesn't change.

Output from GPIO 20 (Mosi) and ... ?

Do you use a WS2812(b) Stripe, or WS2801 ?

Do you mean boot.txt or config.txt ?

@Arthur-Koo
Copy link

  1. 2812B.
  2. Add 'core_freq=250' into config.txt to avoid GPU freq issue with SPI which will cause reboot on Pi3.
  3. Add dtoverlay=spi1-3cs or spi1-2cs in /boot/config.txt. Add spidev1.0/spidev1.1 option to 2812B SPI. Then the 2812B SPI LED linked to GPIO 20 (Mosi) and assigned to spidev1.0/spidev1.1 can light on, but it does not work properly, just light without effect, and then auto reboot after several seconds.
    I guess it may be because of UART/BT conflict on Pi3. But I haven't yet debug it for it's not eager to use multiple stripes.

@ChR-iSz
Copy link
Contributor Author

ChR-iSz commented Dec 11, 2020

@Arthur-Koo
you know, that you must edit the WS2812 Schema file, and not this from this pull request #1112 here ?

wrong:
./libsrc/leddevice/schemas/schema-ws2801.json

right
./libsrc/leddevice/schemas/schema-ws2812spi.json

And, you must turn off the audio out in config.txt. Comment in this line:

wrong
dtparam=audio=on

right
# dtparam=audio=on

and turn on the stable clock time:
force_turbo=1

@penfold42
Copy link
Contributor

2812 won’t work on SPI1 - there’s no DMA support and a pitiful TX buffer

@Arthur-Koo
Copy link

Arthur-Koo commented Dec 14, 2020

@Arthur-Koo
you know, that you must edit the WS2812 Schema file, and not this from this pull request #1112 here ?

wrong:
./libsrc/leddevice/schemas/schema-ws2801.json

right
./libsrc/leddevice/schemas/schema-ws2812spi.json

And, you must turn off the audio out in config.txt. Comment in this line:

wrong
dtparam=audio=on

right
# dtparam=audio=on

and turn on the stable clock time:
force_turbo=1

Yes. I've updated the WS2812spi Schema file and got the result.

@Arthur-Koo
Copy link

2812 won’t work on SPI1 - there’s no DMA support and a pitiful TX buffer

I think that's the reason.

And there may be solutions, right?

@penfold42
Copy link
Contributor

Use SPI0
or PWM via the rpi_281x
or an external arduino

@Arthur-Koo
Copy link

Use SPI0
or PWM via the rpi_281x
or an external arduino

But from the wiki https://github.com/notro/spi-bcm2708/wiki & https://elinux.org/RPi_SPI I cannot get any information that there's no DMA support for SPI1.

@ChR-iSz
Copy link
Contributor Author

ChR-iSz commented Dec 14, 2020

So, i add a WS2812b on spidev1.0 (Mosi only) on RPI 4 and only green and blue light works. Red not. I tested with the hyperion NG RGB assist on top right toolbar.

Red is showing white (strange).
Possible i must rebuild with spidev1.3 🤷‍♂️

@ChR-iSz
Copy link
Contributor Author

ChR-iSz commented Dec 14, 2020

@Arthur-Koo

Which rate you use in hyperion ng ws2812spi config ?

2857143 ?

@penfold42
Copy link
Contributor

Use SPI0
or PWM via the rpi_281x
or an external arduino

But from the wiki https://github.com/notro/spi-bcm2708/wiki & https://elinux.org/RPi_SPI I cannot get any information that there's no DMA support for SPI1.

This came up here:
jgarff/rpi_ws281x#400
It’s covered in the many 100s page long Broadcom documentation

You only need DMA for WS2812 LEDs
WS2801 should be ok without DMA.

@Arthur-Koo
Copy link

@Arthur-Koo

Which rate you use in hyperion ng ws2812spi config ?

2857143 ?

from 3000000 to 4000000

@Arthur-Koo
Copy link

Arthur-Koo commented Dec 15, 2020

Use SPI0
or PWM via the rpi_281x
or an external arduino

But from the wiki https://github.com/notro/spi-bcm2708/wiki & https://elinux.org/RPi_SPI I cannot get any information that there's no DMA support for SPI1.

This came up here:
jgarff/rpi_ws281x#400
It’s covered in the many 100s page long Broadcom documentation

You only need DMA for WS2812 LEDs
WS2801 should be ok without DMA.

I've found that sentence for UART, and the line for SPI is "Again the SPIs themselves have no throughput limitations in fact they can run with an SPI clock of 125 MHz. But doing so requires significant CPU involvement as they have shallow FIFOs and no DMA support."

@penfold42
Copy link
Contributor

That’s the section.

Can we close this issue now ?

@Arthur-Koo
Copy link

That’s the section.

Can we close this issue now ?

I think so, thanks!

@Alootje
Copy link

Alootje commented Dec 27, 2020

Not sure if this is the correct section to post my question, if not, please let me know.
Short question: is the quoted section also apllicable to APA102 LEDs connected to an RPi?

@Arthur-Koo
you know, that you must edit the WS2812 Schema file, and not this from this pull request #1112 here ?

wrong:
./libsrc/leddevice/schemas/schema-ws2801.json

right
./libsrc/leddevice/schemas/schema-ws2812spi.json

And, you must turn off the audio out in config.txt. Comment in this line:

wrong
dtparam=audio=on

right
# dtparam=audio=on

and turn on the stable clock time:
force_turbo=1

Background info:
Recently my RPi 3B passed away. On this Pi I had OSMC and Hyperion (not NG) running with two separate LED strings. One String behind the TV and one string attached to a secondary light beside the TV (movie of it in action: https://youtu.be/hfg9NIfXejQ). When no media is playing this secondary light also acts as a regular-ish light bulb.

To enable this from one RPi I enabled /dev/spidev1.0 by adding dtoverlay=spi1-3cs to the config.txt.
I'm experimenting with Hyperion NG on a RPi B+ (arm v6) and in the latest version of Hyperion NG only /dev/spidev0.0 and 0.1 are available.
I noticed this PR: #1112. Does this mean that this will be added to the next release of Hyperion NG?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants