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

Demo application for accel operation. #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TE-N-ShengjiuWang
Copy link

This 'caccel' applicaton is a demo to show how to
call the new introduced accel interface.

The kernel patch is:
ALSA: compress_offload: introduce accel operation mode

As there is conflict when using the API of alsa-lib,
add alsa_wrap file to separate the header files:
alsa/asoundlib.h
sound/asound.h

command for conversion to 48kHz:
caccel -i in.wav -o out.wav -r 48000

goto end_process_err;
}

if (ioctl(fd_accel, SNDRV_COMPRESS_TASK_STOP, &task.seqno) < 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

STOP ioctl should not wait for result. STATUS or poll() should be used to wait for the task operation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

@perexg
Copy link
Member

perexg commented Oct 24, 2024

Thank you for this example code, but the abstraction should be added to tinycompress library like we do for standard playback/capture modes.

@@ -21,7 +21,7 @@
#include <linux/types.h>
#include <sound/asound.h>
#include <sound/compress_params.h>
#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 2, 0)
#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 3, 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh! GH doesnt let comment on patchlog...
I guess it would make sense to say, move the header to version 0.3.0...

@@ -253,8 +253,16 @@ union snd_codec_options {
struct snd_dec_wma wma_d;
struct snd_dec_alac alac_d;
struct snd_dec_ape ape_d;
struct {
__u32 out_sample_rate;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be folded into previos patch as both are coming from kernel header

@@ -1,11 +1,14 @@
bin_PROGRAMS = cplay crecord
bin_PROGRAMS = cplay crecord caccel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we always build caccel?

@vinodkoul
Copy link
Contributor

Thank you for this example code, but the abstraction should be added to tinycompress library like we do for standard playback/capture modes.

yes, that is the primary comment for this change

Merge header file compress_offload.h for the changes
of adding accel operation.
Merge header file compress_params.h for the changes
of adding src codec.

update libtinycompress for adding accel operations.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
This 'caccel' applicaton is a demo to show how to
call the new introduced accel interface.

The kernel patch is:
ALSA: compress_offload: introduce accel operation mode

As there is conflict when using the API of alsa-lib,
add alsa_wrap file to separate the header files:
alsa/asoundlib.h
sound/asound.h

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
@TE-N-ShengjiuWang
Copy link
Author

@perexg @vinodkoul I have update the commits, mainly for tinycompress library.

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