Repository navigation
Conversation
Bluetooth LC-3 codec uses 24kHz for standard quality, so add the new rate to the known-rates list for PCM offload support. Signed-off-by: Yong Zhi <yong.zhi@intel.com>
|
This breaks aplay in every test across the Zephyr/IPC4 board: "unable to install hw_params" or "invalid argument", "Unsupported audio format",... https://sof-ci.01.org/linuxpr/PR4966/build2620/devicetest/index.html The stable-v2.2 branch is fine: |
It fails fast :), thanks for the quick feedback, did not observe the failure on my board though, checking why it chose 44.1k now |
Maybe related to: Wild guess. |
|
I am not able to find a satisfying explanation, tried the same cmd as shown in the log https://sof-ci.01.org/linuxpr/PR4966/build2621/devicetest/index.html?model=MTLP_SDW_AIOC&testcase=check-playback-10sec And snd_pcm_hw_params_choose() found 48K correctly, the aplay exit without error: (use sof-dev kernel directly on my DUT failed to boot, so only tested on https://chromium.googlesource.com/chromiumos/third_party/kernel/+/refs/heads/chromeos-6.1) |
| #define SNDRV_PCM_RATE_384000 (1U<<14) /* 384000Hz */ | ||
| #define SNDRV_PCM_RATE_705600 (1U<<15) /* 705600Hz */ | ||
| #define SNDRV_PCM_RATE_768000 (1U<<16) /* 768000Hz */ | ||
| #define SNDRV_PCM_RATE_24000 (1U<<5) /* 24000Hz */ |
There was a problem hiding this comment.
You cannot do this.
Bit 7 was 48KHz before this patch, now it is 44.1KHz.
This will have catastrophic consequences with anything which uses audio.
There was a problem hiding this comment.
It should be possible to do this actually, SNDRV_PCM_RATE_ is kernel internal define
|
This has been discussed a reasonable number of times upstream before, for example: https://mailman.alsa-project.org/pipermail/alsa-devel/2013-July/064453.html Historically, there has been some push back on including 24kHz, and the suggestion has been to use RATE_KNOT and constraints instead. That said 384k also got some push back: https://mailman.alsa-project.org/pipermail/alsa-devel/2016-January/103502.html And then was finally accepted in commit 4cc4531 ("ALSA: pcm: add support for 352.8KHz and 384KHz sample rate"). But definitely you want to send a change like this upstream first before doing much that depends on it. |
|
Thanks @ujfalusi @charleskeepax and @marc-hb for your inputs. For the CI error, I tried sof-dev branch on Ubuntu, still am not able to repro, so I think it's not caused by this PR. |
Only this PR is causing such "unsupported audio formats" all across the board. No other PR or daily test has any remotely similar failures. So, this PR is definitely triggering these failures. That does not mean this PR is incorrect but it is for sure the trigger. What I find especially interesting is: this PR does not fail with the stable-v2.2 FW branch, which happens to use topology v1. All other branches fail and they use topology v2. Maybe not a coincidence? sof-test depends heavily on ALSA libraries and topology parsing, so there is probably some dependency or even hardcoding there. |
|
@marc-hb, my guess is that tplg1 sets only Re-defining BITs is not going to be an easy task between kernel, user space, topology compiler and applications. All need to be have the same understanding of the bits. Update: alsa-lib references: |
|
Hi, @marc-hb @ujfalusi , thanks, now I was reminded that I have updated alsa-lib with alsa-project/alsa-lib#396 on my build machine to test 24K, that's why I did not see the CI error. There is an implicit dependency between snd_pcm_rates defined in tplg_local.h and SNDRV_PCM_RATE defined kernel side include/sound/pcm.h. |
This is exactly for this type of reasons that validation exists :-)
So this is the "implicit ABI" that we were all suspecting the whole time, thanks! "Implicit ABI" = really time-consuming so very bad. A very cheap, low-tech fix of incredible value is... adding a comment in the source warning about the other places where these bits are duplicated. Such a comment is basic copy/paste/diverge hygiene in general but it's obviously much more important when it's an ABI across different components versioned separately. Very sad to see zero comment in any of these places. |
|
@yongzhi1 I think it's safe to say this PR is not aligned with the directions provided before by maintainers. There's no line of sight to extend the enums for frequencies, so my recommendation is to move on and use the RATE_CONTINUOUS and constraints. |
Ack, let me close this and experiment with the RATE_CONTINUOUS and constraints. Thanks for the code review!! |
Bluetooth LC-3 codec uses 24kHz for standard quality, so add the new rate to the known-rates list for PCM offload support.