-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Add BoomBerry support and support for mcp7940x family of RTC #1397
Conversation
Aaron, I'm going to refrain from saying anything negative...... Who is making/selling these Boomberry DAC HAT's? Are they just straight copies of HifiBerry Digi+ and DAC+? |
I've been waiting for @pelwell to give you a clip around the ear for combining DAC and RTC in one pull request..... LOL Aaron, do you have a donkey in this derby? Can't see any BoomBerry boards in your web shop? Can't seem to get anything back from Google either? Are they HiFiBerry DAC+ and Digi clones? Would appear so from driver. (I'm not sure the fustercluck machine driver is the way to go, Digi WM8804 and DAC PCM5122 from one machine driver, and duplication of existing code, anyway.) This is what I do for Geekroo Digi. It gets the Geekroo name in alcacap output, which is usually all the clone manufacturer is concerned about, it not saying HiFiBerry... I'd be tempted to do the same for this BoomBerry Digi and something similar for the BoomBerry DAC board, with hifiberry_dacplus machine driver, assuming it is a clone? |
I forgotten DanielM's github monicker. Need to check he is happy with overriding/setting those names from dt, in his machine driver..... |
@clivem not just straight copies of HiFiBerry no, although obviously using some of the same chips. Apart from chips they are a different design with different features. Idea of single driver is ease of use for end users really. Hopefully @pelwell will forgive me for my poor pull request ettiquette :-) |
Where can I read about these features, or better yet, buy these boards? Is anyone actually using them out in the wild? Where are they being sold?
Which might be a valid line of thought, but for the fact that the dt is loading the module and the users point of entry is "dtoverlay=...." in config.txt, and you have a separate dt file for dac and digi, right? |
@clivem - not being sold yet, so nowhere to read about the features just yet. About the driver - there are two separate dt files yes, but I still think that it makes more sense this way from a user perspective than to have a larger number of separate drivers. And also having more than one driver adds to extra config in terms of supporting the full range of cards in music player distributions etc (as well as a more confusing array of options for the user to choose from in those distributions). Think it makes more sense from all perspectives to have a single driver for these to support the entire range. |
@shawaj If you don't want to confuse the users, then why not just use the existing drivers, that are already supported by the music player distros? "dtoverlay=hifiberry_digi" and "dtoverlay=hifiberry-dacplus". I cant see that new machine driver is adding anything that wasn't there already. Maybe I didn't look closely enough at the machine driver code you submitted, for the extra features. (I though it was a cut and paste job, from the existing berry_digi and berry_dacplus, into a single new file.) |
@clivem - to me, that seems far more confusing from an end user perspective |
I'm obviously missing something here. That you can support a card using an existing driver and overlay, already in use by the distros, without adding one line of code or dt config, but you choose not to, confuses the hell out of me..... |
Isn't that exactly what is already done with iqaudio / hifiberry etc? If going down your route it would make far more sense to have a generic chip driver and everyone use that. That doesn't seem to be the general consensus, based on what already exists in the distros... Unless I'm missing something here too, I am not really seeing your issue with this. |
@shawaj I'll duck out of this conversation now, as I sure don't have a horse in this race, and hopefully Phil or Dom will explain why it would be OK to have as many dt configs as you want, but from a code maintainability point of view, unless a new card adds something that cannot be supported by an existing soc machine driver, it does not make sense to duplicate code that is already there. |
No worries Clive - thanks for your input. I see where you are coming from but I don't agree with what you're saying for a number of reasons, not least because of what already exists within the distros (among other reasons). |
@pelwell think I have now fixed the mess I created with the multiple commits. Let me know if that now looks ok |
rpi-4.4.y is current branch now. I'm not sure why you have added non-dt initialisation code. Should be dt only now! I still have an issue that there is no new code in that machine driver, just duplication of existing code, but at least HiFiBerry DanielM now gets credit...... |
When that looks OK either you or I can cherry-pick to 4.4. For other readers: the current replication of code is less than ideal, but I don't think Aaron should be expected to fix the mess. As long as the code is clear, up-to-date and includes suitable attributions I'm prepared to accept it. |
Thanks very much |
@pelwell this is all done now :-) |
You're almost there. You missed a few niceties about the overlay README format (80-column max, two blank lines between, etc.) and the overlays (the RTC had no parameter to enable it, there was a stray semicolon, and the frag0 label has to be added), but otherwise it is plausible. Probably as a result of merging then separating the drivers the startup and shutdown functions moved w.r.t. the hifiberry original, so I moved them back to aid comparison. Can you tell me why you removed the assignment to the .dev field of the snd_soc_card structure? (This isn't a rhetorical question - you may have a good reason for it, but you may not). My fixups (excluding the .dev issue) can be found here: https://gist.github.com/pelwell/2d88bd7875b9066437aaf6887e0cd4b0 When you have read and understood my changes, tested that it all compiles (it wouldn't have done before) and works, then update the PR. You can use |
@pelwell fixed all those issues now. About the .dev issue, are you referring to this line - |
Yes I am. |
it is on lines 128 (dac) and 180 (digi) |
Ah yes - meld had grouped it in with another difference so it wasn't obvious. I see that the whitespace on the digi startup/shutdown functions has changed from tabs to spaces, and that there are a number of other whitespace issues - trailing whitespace and DOS line-endings on the .dts files. git show HEAD^ will highlight the errors. If you are making a change, it would be nice if you could move the initialisation of the .dev fields back where they were to aid any future merge. |
strange about the whitespace errors as I am working on debian 8. anyway, all fixed now for you (including moving the .dev fields) |
@pelwell - thanks for merging. what did you want to do about the cherry-pick to 4.4.y? Also, meant to say, if you do have an idea of what you are wanting to do in terms of "fixing the mess" in terms of code replication etc. we wouldn't mind helping with that if that is at all beneficial. |
I've just done the cherry-pick to 4.4.y. As for rationalising the number of near-duplicate drivers, the answer has to be to merge them all into a generic/superset driver, using the compatible strings to enable any per-board features. By keeping the code as similar as possible you have made this easier. @clivem is in the process of doing that for the IQaudIO driver, so either that code or something based on it would probably be part of the effort. Unless you want to have a go at making some of the changes yourself, the main thing you can do is co-operate come the time. |
@pelwell Can you apply this to rpi-4.4.y, on top of the cherry pick from rpi-4.1.y. |
@shawaj Clive appears to be correct - the snd_soc_limit_volume call takes a |
In 4.1.y ... In 4.4.y ... Use codec ref in 4.1.y and card ref in 4.4.y..... |
Pushed. |
I am seeing the same in 4.1.y at line 171 as what we have - https://github.com/raspberrypi/linux/blob/rpi-4.1.y/sound/soc/bcm/hifiberry_dacplus.c Is this just a difference for 4.4.y? |
It is - the ALSA API changed with 4.4. |
oh sorry, only just saw comments above! |
kernel: Add Support for BoomBerry Audio boards See: raspberrypi/linux#1397 kernel: Add support for the Digital Dreamtime Akkordion music player See: raspberrypi/linux#1406 kernel: Add support for mcp7940x family of RTC See: raspberrypi/linux#1397 firmware: vcilcs: Warn as message queue approaches fullness See: #449 firmware: dtoverlay: Copy overrides before applying firmware: dtmerge: Pack the merged DTB before writing firmware: arm_ldconfig: Fix detection of kernel8.img firmware: arm_loader: Enable DT by default, read addresses back from stub See: #579 firmware: ldconfig: Add [none] section as a convenience as config.txt filter firmware: pwm_sdm: Bugfixes See: https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=136445 firmware: gencmd: Add command to read current and historical throttled state
kernel: Add Support for BoomBerry Audio boards See: raspberrypi/linux#1397 kernel: Add support for the Digital Dreamtime Akkordion music player See: raspberrypi/linux#1406 kernel: Add support for mcp7940x family of RTC See: raspberrypi/linux#1397 firmware: vcilcs: Warn as message queue approaches fullness See: raspberrypi/firmware#449 firmware: dtoverlay: Copy overrides before applying firmware: dtmerge: Pack the merged DTB before writing firmware: arm_ldconfig: Fix detection of kernel8.img firmware: arm_loader: Enable DT by default, read addresses back from stub See: raspberrypi/firmware#579 firmware: ldconfig: Add [none] section as a convenience as config.txt filter firmware: pwm_sdm: Bugfixes See: https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=136445 firmware: gencmd: Add command to read current and historical throttled state
kernel: Add Support for BoomBerry Audio boards See: raspberrypi/linux#1397 kernel: Add support for the Digital Dreamtime Akkordion music player See: raspberrypi/linux#1406 kernel: Add support for mcp7940x family of RTC See: raspberrypi/linux#1397 firmware: vcilcs: Warn as message queue approaches fullness See: raspberrypi#449 firmware: dtoverlay: Copy overrides before applying firmware: dtmerge: Pack the merged DTB before writing firmware: arm_ldconfig: Fix detection of kernel8.img firmware: arm_loader: Enable DT by default, read addresses back from stub See: raspberrypi#579 firmware: ldconfig: Add [none] section as a convenience as config.txt filter firmware: pwm_sdm: Bugfixes See: https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=136445 firmware: gencmd: Add command to read current and historical throttled state
kernel: Add Support for BoomBerry Audio boards See: raspberrypi/linux#1397 kernel: Add support for the Digital Dreamtime Akkordion music player See: raspberrypi/linux#1406 kernel: Add support for mcp7940x family of RTC See: raspberrypi/linux#1397 firmware: vcilcs: Warn as message queue approaches fullness See: raspberrypi#449 firmware: dtoverlay: Copy overrides before applying firmware: dtmerge: Pack the merged DTB before writing firmware: arm_ldconfig: Fix detection of kernel8.img firmware: arm_loader: Enable DT by default, read addresses back from stub See: raspberrypi#579 firmware: ldconfig: Add [none] section as a convenience as config.txt filter firmware: pwm_sdm: Bugfixes See: https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=136445 firmware: gencmd: Add command to read current and historical throttled state
Add full support for BoomBerry audio cards.
On the RTC, the rtc-ds1307 driver specifies both the mcp7941x and the mcp7940x RTC families but only one is listed in overlays area. Thought it made sense to add explicit support for both.
(P.S. apologies in advance for number of commits - working in the browser due to lack of normal computer ATM - but I think with a new feature on GH you can squash and merge easily anyway from your side?)