Skip to content

Conversation

@johannesk
Copy link
Contributor

@johannesk johannesk commented Nov 16, 2019

These two commits enable the simultaneous use of a JustBoom DAC and JustBoom Digi board, such that both simultaneously produce the same audio output. The first commit is necessary since the sound/soc layer does not yet support multicodec setups with one codec being the master. All existing multicodec drivers have all codecs as slave and the soc as master. I tested all changes using a pi zero with extra long pin headers, where both an JustBoom DAC Zero and a JustBoom Digi Zero is connected.

When using multiple codecs, at most one codec should generate the master
clock. All codecs except the first are therefore configured for slave
mode.
@pelwell
Copy link
Contributor

pelwell commented Nov 18, 2019

I have a few problems with this PR:

  1. sound/soc/soc-core.c is an unmodified (*) upstream file. A change such as you are proposing should be sent to the relevant maintainers and mailing lists - use git format-patch to produce a patch file, the run scripts/get_maintainer.pl on it to found out where to send it.
  2. Does it really need 260 lines of code? Quite a bit of that card driver file looks more like codec driver software.
  3. How does this work on the mechanical front? The boards don't look very stackable.
  4. There are ordering and whitespace issues in the README and Makefile.

@shawaj
Copy link

shawaj commented Nov 18, 2019

Just weighing in about number 3...the zero boards are stackable using one of the through board headers used on the official PoE and the Sense HAT.

The Digi HAT and DAC HAT have non-populated headers which allow you to stack boards on top of each other if you were to solder a header in.

Last, but not least, we are doing a board revision soon to change the HAT boards to use the same header as the zero boards so they will be more easilly stackable.

@pelwell
Copy link
Contributor

pelwell commented Nov 18, 2019

@shawaj Is this dual-headed approach something you are going to be promoting?

@shawaj
Copy link

shawaj commented Nov 19, 2019

@pelwell yes we intend to promote it in the future

fengguang pushed a commit to 0day-ci/linux that referenced this pull request Nov 21, 2019
When using multiple codecs, at most one codec should generate the master
clock. All codecs except the first are therefore configured for slave
mode. Before this patch all codecs in a multicodec setup had to be
slaves. This is needed when e.g., connecting multiple sound hats for
simultaneous playback to the raspberry pi I2S output and one of the
sound hats generates the I2S clocks
(raspberrypi/linux#3337).

I checked the raspberry pi kernel tree for multicodec usage with
`fgrep num_codecs -R sound/soc/` and verified that all existing
multicodec drivers with hardcoded format have indeed configured all
codecs for slave mode. Doing a similar check on the current for-5.5 tree
is more difficult since .num_codecs is now hidden behind a preprocessor
macro.

Signed-off-by: Johannes Krude <[email protected]>
@johannesk
Copy link
Contributor Author

To answer the raised questions:

  1. I submitted the sound/soc/soc-core.c patch to upstream and I am waiting for for approval or discussion there (https://mailman.alsa-project.org/pipermail/alsa-devel/2019-November/158962.html).
  2. The driver contains platform specific codec code which is similar to other sound hat drivers to setup e.g. the pi clock. It is twice as much code in comparison to other drivers since it configures not only one but two codecs.
  3. In my setup I stack the zero hats by soldering long pin headers (similar to https://www.ebay.de/i/232311298260), but long extension headers might also work (https://www.reichelt.com/de/en/raspberry-pi-40-pin-stacking-header-rm-2-54-rpi-header-40-p223626.html).
  4. I fixed the ordering, but I am unsure about the whitespace issues. There already seems to be a mix of spaces and tabs in the Kconfig file. Are there any whitespace issues left?

@pelwell
Copy link
Contributor

pelwell commented Nov 22, 2019

The overlay and README look fine - the checker has no complaints.

Please run git format-patch HEAD~2 and scripts/checkpatch.pl 000* (assuming no other patch files are lying around), then fix the errors that are reported.

@johannesk
Copy link
Contributor Author

The pull request now follows the Linux kernel coding style.

The upstream patch did not receive any response within 12 days. Can you give any hints on how to get upstream to look at this patch?

@pelwell
Copy link
Contributor

pelwell commented Dec 6, 2019

I'd just post a follow-up message asking politely for a review.

In the meantime I've added Signed-off-by: lines and merged the patches into 4.19.

popcornmix added a commit to raspberrypi/firmware that referenced this pull request Dec 11, 2019
kernel: dwc_otg: checking the urb->transfer_buffer too early
See: raspberrypi/linux#3341

kernel: overlays: Make mcp342x run-time compatible
See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=258294

kernel: Add Support for simultaneous use of JustBoom DAC and JustBoom Digi based Audio boards
See: raspberrypi/linux#3337

kernel: drm/vc4: Correct disabling of render nodes
See: raspberrypi/linux#3365

firmware: power: Use Pi4 PMIC values on Pi3+

firmware: Fix filtered handling of array variables
See: #1296

firmware: Update libfdt to v1.5.1+
See: raspberrypi/userland#582

firmware: dtoverlay: Extend DT parameter syntax

firmware: memorymap: Include FW revision in start.elf

userland: mmal: Support 64 bit clients
See: raspberrypi/userland#586
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Dec 11, 2019
kernel: dwc_otg: checking the urb->transfer_buffer too early
See: raspberrypi/linux#3341

kernel: overlays: Make mcp342x run-time compatible
See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=258294

kernel: Add Support for simultaneous use of JustBoom DAC and JustBoom Digi based Audio boards
See: raspberrypi/linux#3337

kernel: drm/vc4: Correct disabling of render nodes
See: raspberrypi/linux#3365

firmware: power: Use Pi4 PMIC values on Pi3+

firmware: Fix filtered handling of array variables
See: raspberrypi/firmware#1296

firmware: Update libfdt to v1.5.1+
See: raspberrypi/userland#582

firmware: dtoverlay: Extend DT parameter syntax

firmware: memorymap: Include FW revision in start.elf

userland: mmal: Support 64 bit clients
See: raspberrypi/userland#586
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants