-
Notifications
You must be signed in to change notification settings - Fork 571
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 vela alsa lib interface #2970
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: yangyalei <[email protected]>
Signed-off-by: yangyalei <[email protected]>
[Experimental Bot, please feedback here] No, this PR does not fully meet the NuttX requirements. While it provides a summary and mentions testing, it lacks crucial details. Here's a breakdown of what's missing:
To meet the requirements, the PR needs to be revised to include the missing information. For example, the impact section should look like this (even if there's no impact):
The testing section needs actual logs and specific build/target details. |
This PR is related to apache/nuttx#15657 |
FAR struct bitsconv_data *bc; | ||
FAR struct bitsconv_data *bc_s16; | ||
FAR struct chmap_data *cm; | ||
FAR SpeexResamplerState *resampler; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comes from ALSA and needs to stay that way @yangyalei ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comes from ALSA and needs to stay that way @yangyalei ?
This is just a simple way to support format convert and resampling... This is not the standard implementation of ALSA; it's just a basic implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our format check complains here because of mixed case.. but I guess this name is enforced by some standard API and we should not change that to maintain compatibility? :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our format check complains here because of mixed case.. but I guess this name is enforced by some standard API and we should not change that to maintain compatibility? :-)
I used libspeexdsp (BSD license, tested performance is quite good) for resampling, but the interface definitions of libspeexdsp follow camel case naming convention. I have discussed this with @xiaoxiang781216, it's OK.
Thank you @yangyalei amazing work!! :-) |
|
||
config AUDIOUTILS_SPEEXDSP | ||
bool "Audio libspeexdsp Library" | ||
default n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
depends on ALLOW_BSD_COMPONENTS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the license of this code? is it somehow based on alsa-lib
? Is it GPL?
If this code is GPL then it can't be merged. GPL licensed code cannot be hosted in ASF projects.
it's rewrite from scratch, but follow alsa-lib public API, just like nuttx v4l2 driver framework: |
I will run a scan after merge |
const int16_t *src; | ||
int32_t *dst; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FAR
src = (const int16_t *)in_data; | ||
dst = (int32_t *)bc->bitsconv_buf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FAR
int32_t *src; | ||
int16_t *dst; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FAR
src = (int32_t *)in_data; | ||
dst = (int16_t *)bc->bitsconv_buf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FAR
in = (const int16_t *)in_data; | ||
out = (int16_t *)cm->chmap_buf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FAR
in = (const int32_t *)in_data; | ||
out = (int32_t *)cm->chmap_buf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FAR
* Public Functions | ||
****************************************************************************/ | ||
|
||
const char *snd_pcm_name(snd_pcm_t *pcm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FAR and in other places
return NULL; | ||
} | ||
|
||
const char *_snd_pcm_format_descriptions[] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file looks like highly inspired by https://github.com/alsa-project/alsa-lib/blob/master/src/pcm/pcm.c#L2001
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in order to maintain compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt that compatibility is a sufficient reason not to name this implementation as "derivative GPL work".
Even internal static functions are called the same like in alsa-lib.
I'm definitely not licences expert so I don't know if licensing this code to Apache is OK or not. But for sure caution is required here. GPL is like virus. |
If this is rewriten based on alsa-lib then this is a derivative work. If this is a derivative work of GPL, then this code is GPL. If this code is GPL then it can't be relicensed to Apache. That's how I understand copyleft licences. I would be happy if there is someone more competent than me and says otherwise. |
maybe we should ask ALSA project directly to have no doubts? if the interface is compatible but its a rewrite from scratch then should be no problem? how otherwise create alternatives? |
The code structure is very similar to alsa-lib, some code fragments are the same, many private functions has the same names. This is not just a compatible interface, but highly inspired on alsa-lib work. Asking the alsa-lib team won't change anything here if it's a derivative work of GPL. I doubt they relicence it to permisive license, I doubt if its even possible. If you want to avoid such problems you have to write EVERYTHING from scratch, the only thing you can take from GPL project are PUBLIC header interfaces. |
Summary
Add vela alsa lib interface
Impact
Introducing ALSA compatible audio subsystem on NuttX.
Testing
Use alsa lib interface play music in allwinnertech&BES platform