Skip to content
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

Failed to record call #507

Closed
vunghi021198 opened this issue Mar 3, 2024 · 9 comments · Fixed by #508
Closed

Failed to record call #507

vunghi021198 opened this issue Mar 3, 2024 · 9 comments · Fixed by #508
Assignees
Labels
bug/limitation elsewhere Bug/limitation in the ROM or another project bug Bug in BCR itself

Comments

@vunghi021198
Copy link

Screenshot_20240303-135134.png

Screenshot_20240303-135133.png

Screenshot_20240303-135216.png

I've been having this issue on 1.60 only. Same setup as shown in screenshot till 1.59, same ROM, no issue recording. Hope you can look into this. Thank you.

@chenxiaolong
Copy link
Owner

chenxiaolong commented Mar 3, 2024

If you change the sample rate to 48000 Hz, does it still fail?

EDIT: If you wouldn't mind, could you please install https://play.google.com/store/apps/details?id=com.parseus.codecinfo, find the opus.encoder entry, and post a screenshot of it?

@chenxiaolong chenxiaolong self-assigned this Mar 3, 2024
@vunghi021198
Copy link
Author

If you change the sample rate to 48000 Hz, does it still fail?

Oh my god how silly of me, I dont know since when did it change to 16000, used to be 48000 since 1.40, somehow updating from 1.59 to 1.60 changed the sample rate to 16000. Everything works normally now on 48000. Thank you and sorry for wasting some of your time.

@chenxiaolong
Copy link
Owner

It's not a waste of my time at all :)

1.60 changed the default from 48000 Hz to 16000 Hz. During the update, if you never changed the sample rate in the past, then BCR would use the new default value. It seems that your device doesn't support 16000 Hz for some reason. (If you wouldn't mind posting some additional details, it might help with understanding why--please see my previous edited comment.)

Since 16000 Hz is clearly problematic, I will revert the change and set the default back to 48000 Hz in version 1.62.

@chenxiaolong chenxiaolong added bug Bug in BCR itself bug/limitation elsewhere Bug/limitation in the ROM or another project labels Mar 3, 2024
@vunghi021198
Copy link
Author

vunghi021198 commented Mar 3, 2024

It's not a waste of my time at all :)

1.60 changed the default from 48000 Hz to 16000 Hz. During the update, if you never changed the sample rate in the past, then BCR would use the new default value. It seems that your device doesn't support 16000 Hz for some reason. (If you wouldn't mind posting some additional details, it might help with understanding why--please see my previous edited comment.)

Since 16000 Hz is clearly problematic, I will revert the change and set the default back to 48000 Hz in version 1.62.

I'm not sure what kind of additional details I can give, if you mean my device, it's Redmi K20 Pro (raphael)
Let me grab that codec thing also

@chenxiaolong
Copy link
Owner

Thanks! Sorry, by "additional details", I only meant the codec info

@vunghi021198
Copy link
Author

Thanks! Sorry, by "additional details", I only meant the codec info

Screenshot_20240303-145322.png

Screenshot_20240303-145405.png

Here are the two I can find

@chenxiaolong
Copy link
Owner

Thanks! That confirms it then. The device only supports 48000 Hz.

That's incredibly weird though. c2.android.opus.encoder is the default Opus encoder shipped in Android. The encoder has supported multiple sample rates in every version of Android since 2018. I guess Redmi must have disabled the other sample rates for some reason.

@vunghi021198
Copy link
Author

Thanks! That confirms it then. The device only supports 48000 Hz.

That's incredibly weird though. c2.android.opus.encoder is the default Opus encoder shipped in Android. The encoder has supported multiple sample rates in every version of Android since 2018. I guess Redmi must have disabled the other sample rates for some reason.

This is a Redmi series, more like a flagship killer tier so mostly some of the higher end features will be cutoff to reduce the cost and the selling price.

chenxiaolong added a commit that referenced this issue Mar 3, 2024
Some devices unfortunately disable common sample rates that are normally
supported in AOSP's software encoders. This commit reworks all of BCR's
MediaCodec-based formats to query for the list of supported sample
rates instead of relying on a hardcoded list. If BCR's default sample
rate for a format is not supported, the closest supported sample rate
will be used. The same applies for Android upgrades that remove support
for the sample rate previously chosen by the user.

These queries are fast enough to be unnoticeable on Pixel devices.
Hopefully other OEMs don't make modifications that slow this down, like
they do for so many other things.

Fixes: #507

Signed-off-by: Andrew Gunnerson <[email protected]>
@chenxiaolong
Copy link
Owner

chenxiaolong commented Mar 3, 2024

This will be fixed by #508, which changes BCR's behavior so that only the sample rates supported by the device are listed. This will be included in the next version of BCR (version 1.62).

chenxiaolong added a commit that referenced this issue Mar 3, 2024
Some devices unfortunately disable common sample rates that are normally
supported in AOSP's software encoders. This commit reworks all of BCR's
MediaCodec-based formats to query for the list of supported sample
rates instead of relying on a hardcoded list. If BCR's default sample
rate for a format is not supported, the closest supported sample rate
will be used. The same applies for Android upgrades that remove support
for the sample rate previously chosen by the user.

These queries are fast enough to be unnoticeable on Pixel devices.
Hopefully other OEMs don't make modifications that slow this down, like
they do for so many other things.

Fixes: #507

Signed-off-by: Andrew Gunnerson <[email protected]>
chenxiaolong added a commit that referenced this issue Mar 3, 2024
Some devices unfortunately disable common sample rates that are normally
supported in AOSP's software encoders. This commit reworks all of BCR's
MediaCodec-based formats to query for the list of supported sample
rates instead of relying on a hardcoded list. If BCR's default sample
rate for a format is not supported, the closest supported sample rate
will be used. The same applies for Android upgrades that remove support
for the sample rate previously chosen by the user.

These queries are fast enough to be unnoticeable on Pixel devices.
Hopefully other OEMs don't make modifications that slow this down, like
they do for so many other things.

Fixes: #507

Signed-off-by: Andrew Gunnerson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/limitation elsewhere Bug/limitation in the ROM or another project bug Bug in BCR itself
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants