param_shmem: fix bug where params didn't stick

There was the case where a param was changed on the Linux side but the
change did not get saved on the DSP side because the param was not in
the local list of changed params on the DSP side. On save, the param
index is now refreshed, and param_get is called on all params that have
changed. This is a hacky workaround but resolves the problem for now.
This commit is contained in:
Julian Oes
2016-04-26 10:21:01 +02:00
parent 2fff2d4eac
commit e3c9135ac2
3 changed files with 40 additions and 8 deletions
+6 -2
View File
@@ -1,5 +1,3 @@
/****************************************************************************
*
* Copyright (c) 2015 Vijay Venkatraman. All rights reserved.
@@ -125,6 +123,8 @@ uint64_t sync_other_prev_time = 0, sync_other_current_time = 0;
extern void update_to_shmem(param_t param, union param_value_u value);
extern int update_from_shmem(param_t param, union param_value_u *value);
extern void update_index_from_shmem(void);
static int param_set_internal(param_t param, const void *val, bool mark_saved, bool notify_changes, bool is_saved);
unsigned char set_called_from_get = 0;
@@ -968,6 +968,10 @@ param_export(int fd, bool only_unsaved)
goto out;
}
/* First of all, update the index which will call param_get for params
* that have recently been changed. */
update_index_from_shmem();
while ((s = (struct param_wbuf_s *)utarray_next(param_values, s)) != NULL) {
int32_t i;