err = context_init(&ctx, direction, argc, argv);
if (err < 0)
goto end;
- if (ctx.xfer.help)
+ if (ctx.xfer.help || ctx.xfer.dump_hw_params)
goto end;
err = context_pre_process(&ctx, direction, &expected_frame_count);
// TODO: Applying NO_PERIOD_WAKEUP should be done here.
+ if (xfer->dump_hw_params) {
+ logging(state, "Available HW Params of node: %s\n",
+ snd_pcm_name(state->handle));
+ snd_pcm_hw_params_dump(state->hw_params, state->log);
+ // TODO: there're more parameters which are not dumped by
+ // alsa-lib.
+ return 0;
+ }
+
return set_access_hw_param(state);
}
enum no_short_opts {
// 128 or later belong to non us-ascii character set.
OPT_XFER_TYPE = 128,
+ OPT_DUMP_HW_PARAMS,
};
static int allocate_paths(struct xfer_context *xfer, char *const *paths,
{"file-type", 1, 0, 't'},
// For mapper.
{"separate-channels", 0, 0, 'I'},
+ // For debugging.
+ {"dump-hw-params", 0, 0, OPT_DUMP_HW_PARAMS},
};
char *s_opts;
struct option *l_opts;
xfer->cntr_format_literal = arg_duplicate_string(optarg, &err);
else if (key == 'I')
xfer->multiple_cntrs = true;
+ else if (key == OPT_DUMP_HW_PARAMS)
+ xfer->dump_hw_params = true;
else if (key == '?')
return -EINVAL;
else {
unsigned int samples_per_frame;
bool help:1;
bool quiet:1;
+ bool dump_hw_params:1;
bool multiple_cntrs:1; // For mapper.
snd_pcm_format_t sample_format;