-
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
bcm2708-i2s lacks mmap support #1004
Comments
MMAP support was present in the inital version of bcm2708-i2s but shortly afterwards removed in commit 62c05a0. It's not quite clear to me what the strange issues actually were/are. Ping @koalo, could you elaborate on this? Ragnar Jensen provides a Wolfson/Cirrus card kernel build with MMAP support enabled and it seems to be working very well. I just did a few tests with my Cirrus kernel build (based on top of rpi-4.0.y) with MMAP enabled and it worked fine, too. With MMAP aplay is able to play back 24bit WAVs which won't work without MMAP support. This is the patch I used when testing:
I think we should do some more testing with the various cards (I only have Wolfson/Cirrus cards here), maybe MMAP works fine with the current kernel tree and it's just a matter of adding back the info flags. |
If that's all it takes, I can add a custom DT property to enable MMAP support and expose it via a dtparam setting. |
I do not know how exactly MMAP is implemented, but it seems to rely on some kind of advanced memory management of the DMA engine or maybe there is still a bug in the driver itself or ALSA. |
The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004
I've pushed a commit that makes the MMAP support conditional on a DT property. After rebuilding and copying the kernel, modules and overlays to your SD card, add:
to |
See: raspberrypi/linux#1004 firmware: dtoverlay: Make most errors non-fatal firmware: board_info: Use the boardrev after correction See: #434 firmware: audioserv: Force volume to full when in passthrough mode See: raspberrypi/linux#997
See: raspberrypi/linux#1004 firmware: dtoverlay: Make most errors non-fatal firmware: board_info: Use the boardrev after correction See: raspberrypi/firmware#434 firmware: audioserv: Force volume to full when in passthrough mode See: raspberrypi/linux#997
The latest firmware (Hexxeh/rpi-firmware@9ad0e75) contains the updated module and overlay. Please try it and comment on your findings. |
Thanks a lot for the explanation and the commit! @pelwell could you include the commit in the 4.0 tree as well? I did several tests with my Cirrus card and the driver rebased First I played a testfile, tried with different samplerates Immediately afterwards I recorded an audio file. Tried with 44.1 After recording I played back the recorded file, also sometimes I did some 15 play-record-play runs and didn't see any of the The only issue I ran into was playback not starting together with a
entry in dmesg. But I think that's unrelated to MMAP support, I saw |
The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004
Pushed. |
Adds the required initializations for I2S to the board file of mach-bcm2708. Signed-off-by: Florian Meier <[email protected]> bcm2708-i2s: Enable MMAP support via a DT property and overlay The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: raspberrypi#1004
Adds the required initializations for I2S to the board file of mach-bcm2708. Signed-off-by: Florian Meier <[email protected]> bcm2708-i2s: Enable MMAP support via a DT property and overlay The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004
Adds the required initializations for I2S to the board file of mach-bcm2708. Signed-off-by: Florian Meier <[email protected]> bcm2708-i2s: Enable MMAP support via a DT property and overlay The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004
Adds the required initializations for I2S to the board file of mach-bcm2708. Signed-off-by: Florian Meier <[email protected]> bcm2708-i2s: Enable MMAP support via a DT property and overlay The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004
Adds the required initializations for I2S to the board file of mach-bcm2708. Signed-off-by: Florian Meier <[email protected]> bcm2708-i2s: Enable MMAP support via a DT property and overlay The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004
I am still not sure this is 'proper' mmap support but I'll give it a whirl for some test files I have. I wonder if @martinezjavier (who I believe very kindly added mmap support to the bcm2835 GPU driver) would mind looking over the code to say yes or no whether it looks like it supports mmap properly, or if we need to do more work here... |
Adds the required initializations for I2S to the board file of mach-bcm2708. Signed-off-by: Florian Meier <[email protected]> bcm2708-i2s: Enable MMAP support via a DT property and overlay The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004
Adds the required initializations for I2S to the board file of mach-bcm2708. Signed-off-by: Florian Meier <[email protected]> bcm2708-i2s: Enable MMAP support via a DT property and overlay The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004
Adds the required initializations for I2S to the board file of mach-bcm2708. Signed-off-by: Florian Meier <[email protected]> bcm2708-i2s: Enable MMAP support via a DT property and overlay The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004
Adds the required initializations for I2S to the board file of mach-bcm2708. Signed-off-by: Florian Meier <[email protected]> bcm2708-i2s: Enable MMAP support via a DT property and overlay The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004
Adds the required initializations for I2S to the board file of mach-bcm2708. Signed-off-by: Florian Meier <[email protected]> bcm2708-i2s: Enable MMAP support via a DT property and overlay The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004
Adds the required initializations for I2S to the board file of mach-bcm2708. Signed-off-by: Florian Meier <[email protected]> bcm2708-i2s: Enable MMAP support via a DT property and overlay The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004
Thanks for this. I want to use a Hifiberry Amp+ to run two independent mono streams for a multi room solution (one mapped to the left output and one to the right output). The easiest route to do this is via the alsa dmix plugin which (I understand) needs MMAP. The i2s-mmap overlay has enabled proper use of dmix and is confirmed working fine for my use case on a RPi B+ (running mpd). Let me know if you would like me to assist by undertaking any further tests. Thanks again |
Adds the required initializations for I2S to the board file of mach-bcm2708. Signed-off-by: Florian Meier <[email protected]> bcm2708-i2s: Enable MMAP support via a DT property and overlay The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004
Adds the required initializations for I2S to the board file of mach-bcm2708. Signed-off-by: Florian Meier <[email protected]> bcm2708-i2s: Enable MMAP support via a DT property and overlay The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004
@BBUK Thanks for the feedback. Unless we reopen the original problem of why enabling MMAP support by default is problematic, I can't think of anything else for you to test. |
@BBUK Can you post details of dmix usage so we can replicate please? I'd like to check this on our boards too. |
Adds the required initializations for I2S to the board file of mach-bcm2708. Signed-off-by: Florian Meier <[email protected]> bcm2708-i2s: Enable MMAP support via a DT property and overlay The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004
Adds the required initializations for I2S to the board file of mach-bcm2708. Signed-off-by: Florian Meier <[email protected]> bcm2708-i2s: Enable MMAP support via a DT property and overlay The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: #1004 Signed-off-by: Matthias Reichl <[email protected]>
Code ported from bcm2708-i2s driver in Raspberry Pi tree. RPi commit 7ee829f ("bcm2708-i2s: Enable MMAP support via a DT property and overlay") The i2s driver used to claim to support MMAP, but that feature was disabled when some problems were found. Add the ability to enable this feature through Device Tree, using the i2s-mmap overlay. See: raspberrypi#1004 Signed-off-by: Matthias Reichl <[email protected]>
See: raspberrypi/linux#1004 firmware: dtoverlay: Make most errors non-fatal firmware: board_info: Use the boardrev after correction See: raspberrypi#434 firmware: audioserv: Force volume to full when in passthrough mode See: raspberrypi/linux#997
@popcornmix Any idea why this overlay (i2s-mmap) is not available anymore in 4.9? |
Any idea why this overlay (i2s-mmap) is not available anymore in 4.9?
bcm2835-i2s now supports MMAP by default so this overlay is no longer
needed.
|
Sounds good. Do you have any idea where is this enabled now in the source? |
Sounds good. Do you have any idea where is this enabled now in the source?
sound/soc/soc-generic-dmaengine-pcm.c
All I2S devices using soc-generic-dmaengine implicitly have MMAP
capabilities.
see dmaengine_pcm_set_runtime_hwparams:
...
hw.info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED;
|
Thanks @HiassofT . That makes sense. |
If the driver supports mmap then ALSA will do sensible automatic rate and sample size conversion.
The problem (apart from it should support mmap as most drivers seem to) is it isn't obvious to those using I2S based sound cards why a lot of things don't work properly. I've now seen quite a few posts on the R-Pi forums and elsewhere. Just two examples: https://www.hifiberry.com/forums/topic/jackd/ and https://www.raspberrypi.org/forums/viewtopic.php?f=98&t=111982&p=769781#p769781
It would be great to add this if we can.
The text was updated successfully, but these errors were encountered: