-
Notifications
You must be signed in to change notification settings - Fork 402
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
Enhanced Encoder support and new GPIO Pinout to enchance compatibility with I2S DAC #350
Conversation
Analytics script to post with bug reports
remove switch functionality from encoder program, since is covered by gpio-buttons.py added second rotary encoder channel for tracks adjusted GPIO pins
disable GPIOs which functions are covered by rotary encoders
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please upload this as separate e.g. gpio-buttons.py.roteryencoder.sample This will prevent to break it for all other how doesn't use rotery encoder. Maybe we should build a "setup script" to prevent more and more gpio-buttons.py.examples and nobody will get it. Would this help?
Which pins are blocked by the I2S DAC?
I work already on a prototype setup script.
Good suggestion. Please have a look at the new code. I think the setup script is a great idea. I had the impression may are confused by the options including myself (thinking I killed my DAC or my Pi or both ...). It also eases deployment, if no one has to fiddle around with the code anymore. Would you directly write code from the script or modify a configuration file? I would vote for the later. Generally all the DACs e.g. ebay ES9023, PCM5102A, ... or assemblies from Hifiberry or Justboom require GPIO 19, 21and 18 which is the fixed I2S interface of the processor. Hifiberry requires additionally GPIO 20 because the DAC do not have their own clock source and I2C for the HAT configuration. Depending on the exact model additional pins might be required. |
Fix voltage on RPi side for encoder KY040 connection Provide separate example of encoder compatible gpio button script Revert "make GPIO selection compatible with directly via I2S connected DACs" This reverts commit e03e4c7.
My prototype is like a questionnaire. and has not much logic inside of it. I want to write code from the script and not modify a config file. It work better for me. Normally you setup one the hardware and not change it anymore later. You can find it in my forked branch with my first prototype here: BTW the Hifiberry is using depending which product serveral gpio. I'm not sure if we will find a default setup for everyone. |
I had a look at it and I think it would be of great help. |
@martinclausen2 No only to setup once the hardware buttons. the resulting gpio-buttons.py will not be changed while updating phoniebox code. You only need to change it when e.g. commands to the playout_controls.sh will be changed or the playout controls will changed completely. Both I think are |
@martinclausen2 Take a look again. Just created the basic file creation logic. I need to think about how we can check that a user are not using the same number of multiple things. |
Ok, convinced. I would try the following approach:
It seems to me we need a compiled overview of what hardware needs which functionality. Maybe I can start that in the wiki. I wonder if it would be easier to maintain, if we had a generic code generator script that would process some kind of pre-python script and insert the selected configurations. I found the code somewhat hard to read. But may that adds to much complexity. |
Hi @marcohorstmann @martinclausen2 |
Hi @MiczFlor I guess documentation is the starting point anyway. I never build a code generator myself, so I am more then happy to take advice there. I just had the impression that users need more guidance to go beyond the core version. I will try to spend some time on a documentation about which hardware uses which resources. We can still then go one or the other way. |
Hi @marcohorstmann @martinclausen2 |
@MiczFlor @marcohorstmann The newer commit should not break the code for most users anymore. I am also happy to take care of it. |
@marcohorstmann Would you like to review this wiki page: Hardware Pinout Overview |
@martinclausen2 later this week. I‘m this week at a business trip and no time for crosscheck this. First impression is good |
Maybe, it would also support other users to have a place holder example in the button script for the Playlist-Button function (#340). |
Added a proposed button, encoder, amp GPIO layout - yet without the proposals of @Franzformator - to the wiki. Would a new layout something we could align on? |
Hi @martinclausen2 |
As far as I could see. It looks good. Good work @martinclausen2. |
Thank You @martinclausen2 !! Could you please add the "Play only if RFID is near the reader" GPIO - at least to the classic Pinout. This function needs only one Pin and I think several users will use it. I think we should put the "Playlist-Button" to a Wiki section with implementation examples. For this function you need several Pins, so collisions are inevitable. |
Thank you all for your feedback. I added the "Play only if near" GPIO and recommendations for the playlist buttons GPIOs. I also aligned my pull request with the documentation to generate the least breaking changes. |
Hi @martinclausen2 @marcohorstmann @Franzformator |
Hi @martinclausen2 @marcohorstmann @Franzformator |
Hi @MiczFlor @marcohorstmann @Franzformator I would vote for a link. Overview on the pinout page, links on the specialized pages. I added links to all relevant pages. I hope you like it. |
First of all thanks for the nice project!
I did a little work on the code to optime it for my needs. Please see yourself if there is anything useful for the community in the changes / fixes / new features.
Disabling the buttons with the same functionality as the encoders might not work for everyone. Maybe we can find a solution to persist GPIO assignment elsewhere to avoid setting them up each time a new version is deployed.
I2S DACs and GPIO
Change: Current GPIO assignment will block the use of external DACs with I2S interface. Therefore I suggest the reorganization of the GPIOs.
Rotary Encoder Support
New feature: Two encoders, one for volume, second for track (disabled GPIO buttons for track and volume)
Fix: added missing user, group and path to python for execution to sample systemd service configuration
Changes: Switches and switches in encoders are not clearly separated. I suggest to handle encoders in the encoders service and buttons in the buttons service exclusively.
Additionally I suggest to enable pull-ups on the encoder inputs to allow for encoders without an PCB containing pull-ups.
Status: changes are verified on a working system with 1.1.8.RC2