summaryrefslogtreecommitdiffstats
path: root/templates
AgeCommit message (Expand)AuthorFilesLines
2020-03-18Support Salvator-X/XS boardDuy Dang13-1/+75
2020-02-21Merge remote-tracking branch 'agl/next'Jan-Simon Möller2-17/+48
2020-02-18Update archiver feature regexpJan-Simon Moeller2-0/+2
2020-02-17agl-sota: Set initramfs fstype to cpio.gzLeon Anavi1-0/+1
2020-02-17zeus updates for dragonboard-410cScott Murray1-1/+1
2020-02-12Fix SOTA build for build other than qemuRonan Le Martret2-1/+24
2020-01-29templates/feature/agl-compositor: Allow to test experimental agl-compositorMarius Vlad1-0/+14
2020-01-27Update base local.conf.sampleScott Murray1-16/+47
2019-12-17Add agl-virt-xen featureJérémy Fanguède2-0/+4
2019-12-17Add agl-virt featureJérémy Fanguède2-0/+6
2019-12-06meta-agl-profile-graphical-html5: remove layer and AGL featureJacobo Aragunde Pérez3-19/+0
2019-12-05Follow move of agl-image-ivi-crosssdk to meta-agl-demoJan-Simon Moeller2-2/+2
2019-12-04Move packages from agl-core to agl-iviRonan Le Martret1-9/+18
2019-11-26agl-compositor: Add DISTRO_FEATURE to enable compositorDaniel Stone2-0/+14
2019-11-19raspberrypi4/50_local.conf.inc: Use Image formatLeon Anavi1-0/+5
2019-11-19ebisu: Update setup.sh to adopt multiple zip fileHarunobu Kurokawa1-1/+4
2019-11-05raspberrypi*/50_local.conf.inc: Update rpi 3/4Leon Anavi2-9/+0
2019-09-19raspberrypi*/50_local.conf.inc: Set Mesa versionLeon Anavi2-0/+7
2019-09-17Remove pulseaudio feature, not relevant any moreRonan Le Martret2-11/+0
2019-09-05Add nogfx build for h3ulcbJan-Simon Moeller3-0/+20
2019-09-04Revert "Add nogfx build for h3ulcb"Jan-Simon Moeller3-20/+0
2019-09-03Add nogfx build for h3ulcbJan-Simon Moeller3-0/+20
2019-08-2750_local.conf.inc: Extend DISTRO_FEATURES for sotaLeon Anavi1-0/+2
2019-08-06machine: Add readme for ebisuPierre Marzin1-0/+44
2019-07-24templates: Add templates for Raspberry Pi 4Leon Anavi2-0/+6
2019-07-24add markdown documentation for all machines and featuresStéphane Desneux46-8/+474
2019-07-23ebisu: Add the support of a custom setup scriptPierre Marzin1-5/+10
2019-07-23ebisu: Use a specified path to integrate binariesPierre Marzin1-4/+19
2019-07-23ebisu: Update setup fragment to copy binariesPierre Marzin1-4/+16
2019-07-23machine: Add new ebisu machinePierre Marzin3-0/+19
2019-06-26agl-hmi-framework: remove virtual/navigation over-rideScott Murray1-1/+0
2019-06-20Add cubox-i and nitrogen6x i.MX6 machinesScott Murray6-0/+23
2019-06-11Import aglsetup templates and config for BBEPaul Barker2-0/+7
2019-06-11Merge "feature/agl-ci-*: include agl-pipewire instead of agl-audio-4a-framework"Jan-Simon Moeller4-4/+4
2019-06-10Changes to support the repo clone reworkJan-Simon Möller18-34/+34
2019-06-10feature/agl-ci-*: include agl-pipewire instead of agl-audio-4a-frameworkGeorge Kiagiadakis4-4/+4
2019-05-23Move hmi-framework and eg-virt from meta-agl-devel to meta-aglJan-Simon Möller2-0/+14
2019-05-21Remove the 64bit rpi3 targetJan-Simon Möller2-4/+0
2019-04-29Merge "Add ARC HSDK board support"Jan-Simon Moeller2-0/+4
2019-04-29Merge "Remove inactive devices"Jan-Simon Moeller10-29/+0
2019-04-29Remove inactive devicesJan-Simon Möller10-29/+0
2019-04-26Add ARC HSDK board supportEvgeniy Didin2-0/+4
2019-04-23Fix imx6qdlsabreauto machine configurationBechir Mghirbi4-6/+4
2019-03-22Fix the wrong comment of base template fileKazumasa Mitsunari1-1/+1
2019-03-11Add initial feature for license scanning integrationJan-Simon Möller3-0/+7
2019-03-07Remove unused isafw featureJan-Simon Möller2-2/+0
2018-12-20Add instrument cluster profile definitionsScott Murray4-0/+8
2018-11-22Add ptest to ci and snapshot buildsJan-Simon Möller4-4/+4
2018-10-02Create a feature to activate pulseaudio in AGLRonan Le Martret1-0/+2
2018-10-02Fix image build with PR timestampRonan Le Martret1-2/+2
lass="p">(!err) { *type = item.type; *acc = item.acc; *count = item.count; } return err; } return -1; } static int AfbHalGetIntInfo(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, long *imin, long *imax, long *istep) { snd_ctl_hal_t *plughandle = (snd_ctl_hal_t*) ext->private_data; snd_ctl_elem_info_t *elemInfo = plughandle->infos[key]; snd_ctl_cb_t callback = plughandle->cbs[key]; if (elemInfo) { // Should be normalised to make everything 0-100% *imin = (long) snd_ctl_elem_info_get_min(elemInfo); *imax = (long) snd_ctl_elem_info_get_min(elemInfo); *istep = (long) snd_ctl_elem_info_get_min(elemInfo); return 0; } if (callback) { snd_ctl_get_int_info_t item; int err = callback(plughandle, CTLCB_GET_INTEGER_INFO, key, &item); if (!err) { *imin = item.imin; *imax = item.imax; *istep = item.istep; } return err; } return -1; } static int AfbHalGetEnumInfo(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int *items) { snd_ctl_hal_t *plughandle = (snd_ctl_hal_t*) ext->private_data; snd_ctl_elem_info_t *elemInfo = plughandle->infos[key]; snd_ctl_cb_t callback = plughandle->cbs[key]; if (elemInfo) *items = snd_ctl_elem_info_get_items(elemInfo); if (callback) callback(plughandle, CTLCB_GET_ENUMERATED_INFO, key, items); return 0; } static int AfbHalGetEnumName(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int item, char *name, size_t name_max_len) { snd_ctl_hal_t *plughandle = (snd_ctl_hal_t*) ext->private_data; snd_ctl_elem_info_t *elemInfo = plughandle->infos[key]; //name= snd_ctl_elem_info_get_item_name(elemInfo); return 0; } static int AfbHalReadInt(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, long *value) { snd_ctl_hal_t *plughandle = (snd_ctl_hal_t*) ext->private_data; snd_ctl_elem_info_t *elemInfo = plughandle->infos[key]; return 0; } static int AfbHalReadEnumerate(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int *items) { snd_ctl_hal_t *plughandle = (snd_ctl_hal_t*) ext->private_data; return 0; } static int AfbHalWriteInt(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, long *value) { snd_ctl_hal_t *plughandle = (snd_ctl_hal_t*) ext->private_data; return 0; } static int AfbHalWriteEnum(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, unsigned int *items) { snd_ctl_hal_t *plughandle = (snd_ctl_hal_t*) ext->private_data; return 0; } static int AfbHalEventRead(snd_ctl_ext_t *ext, snd_ctl_elem_id_t *id, unsigned int *event_mask) { snd_ctl_hal_t *plughandle = (snd_ctl_hal_t*) ext->private_data; return -EAGAIN; } static int AfbHalElemList(snd_ctl_ext_t *ext, unsigned int offset, snd_ctl_elem_id_t *id) { snd_ctl_hal_t *plughandle = (snd_ctl_hal_t*) ext->private_data; snd_ctl_elem_id_set_interface(id, SND_CTL_ELEM_IFACE_MIXER); snd_ctl_elem_id_set_name(id, plughandle->ctls[offset].ctlName); return 0; } static int AfbHalElemCount(snd_ctl_ext_t *ext) { snd_ctl_hal_t *plughandle = (snd_ctl_hal_t*) ext->private_data; int count = plughandle->ctlsCount; return count; } static void AfbHalClose(snd_ctl_ext_t *ext) { snd_ctl_hal_t *plughandle = (snd_ctl_hal_t*) ext->private_data; int err; for (int idx = 0; idx < plughandle->ctlsCount; idx++) { if (plughandle->ctls[idx].ctlName) free((void*) plughandle->ctls[idx].ctlName); } err = snd_ctl_close(plughandle->ctlDev); if (err) SNDERR("Fail Close sndctl: devid=%s err=%s", plughandle->devid, snd_strerror(err)); if (plughandle->devid) free(plughandle->devid); free(plughandle); } static snd_ctl_ext_callback_t afbHalCBs = { .close = AfbHalClose, .elem_count = AfbHalElemCount, .elem_list = AfbHalElemList, .find_elem = AfbHalElemFind, .get_attribute = AfbHalGetAttrib, .get_integer_info = AfbHalGetIntInfo, .get_enumerated_info = AfbHalGetEnumInfo, .get_enumerated_name = AfbHalGetEnumName, .read_integer = AfbHalReadInt, .read_enumerated = AfbHalReadEnumerate, .write_integer = AfbHalWriteInt, .write_enumerated = AfbHalWriteEnum, .read_event = AfbHalEventRead, }; SND_CTL_PLUGIN_DEFINE_FUNC(afbhal) { snd_config_iterator_t it, next; snd_ctl_hal_t *plughandle; int err; snd_ctl_cb_t AfbHalInitCB; const char *libname; plughandle = calloc(1, sizeof (snd_ctl_hal_t)); snd_config_for_each(it, next, conf) { snd_config_t *node = snd_config_iterator_entry(it); const char *id; // ignore comment en empty lines if (snd_config_get_id(node, &id) < 0) continue; if (strcmp(id, "comment") == 0 || strcmp(id, "type") == 0 || strcmp(id, "hint") == 0) continue; // devid should point onto a valid sound card if (strcmp(id, "devid") == 0) { const char *devid; if (snd_config_get_string(node, &devid) < 0) { SNDERR("Invalid string type for %s", id); return -EINVAL; } plughandle->devid = strdup(devid); // open control interface for devid err = snd_ctl_open(&plughandle->ctlDev, plughandle->devid, 0); if (err < 0) { SNDERR("Fail to open control device for devid=%s", plughandle->devid); return -EINVAL; } continue; } if (strcmp(id, "cblib") == 0) { if (snd_config_get_string(node, &libname) < 0) { SNDERR("Invalid libname string for %s", id); return -EINVAL; } plughandle->dlHandle = dlopen(libname, RTLD_NOW); if (!plughandle->dlHandle) { SNDERR("Fail to open callback sharelib=%s error=%s", libname, dlerror()); return -EINVAL; } AfbHalInitCB = dlsym(plughandle->dlHandle, "AfbHalInitCB"); if (!AfbHalInitCB) { SNDERR("Fail find 'AfbHalInitCB' symbol into callbacks sharelib=%s", libname); return -EINVAL; } err = (*AfbHalInitCB)(plughandle, CTLCB_INIT, 0, 0); if (err) { SNDERR("Fail AfbHalInitCB err=%d", err); return -EINVAL; } continue; } if (strcmp(id, "ctl") == 0) { const char *ctlConf; snd_config_type_t ctype; snd_config_iterator_t currentCtl, follow; snd_config_t *itemConf; ctype = snd_config_get_type(node); if (ctype != SND_CONFIG_TYPE_COMPOUND) { snd_config_get_string(node, &ctlConf); SNDERR("Invalid compound type for %s", node); return -EINVAL; } // loop on each ctl within ctls snd_config_for_each(currentCtl, follow, node) { snd_config_t *ctlconfig = snd_config_iterator_entry(currentCtl); snd_ctl_elem_info_t *elemInfo; const char *ctlLabel, *ctlName; // ignore empty line if (snd_config_get_id(ctlconfig, &ctlLabel) < 0) continue; // each clt should be a valid config compound ctype = snd_config_get_type(ctlconfig); if (ctype != SND_CONFIG_TYPE_COMPOUND) { snd_config_get_string(node, &ctlConf); SNDERR("Invalid ctl config for %s", ctlLabel); return -EINVAL; } err = snd_config_search(ctlconfig, "ctl", &itemConf); if (!err) { if (snd_config_get_integer(itemConf, (long*) &plughandle->ctls[plughandle->ctlsCount].ctlNumid) < 0) { SNDERR("Not Integer: ctl:%s numid should be a valid integer", ctlLabel); return -EINVAL; } // Make sure than numid is valid on slave snd card snd_ctl_elem_info_malloc(&elemInfo); snd_ctl_elem_info_set_numid(elemInfo, (int) plughandle->ctls[plughandle->ctlsCount].ctlNumid); plughandle->infos[plughandle->ctlsCount] = elemInfo; err = snd_ctl_elem_info(plughandle->ctlDev, elemInfo); if (err) { SNDERR("Not Found: 'numid=%d' for 'devid=%s'", plughandle->ctls[plughandle->ctlsCount].ctlNumid, plughandle->devid); return -EINVAL; } } err = snd_config_search(ctlconfig, "ctlcb", &itemConf); if (!err) { const char *funcname; void *funcaddr; if (snd_config_get_string(itemConf, &funcname) < 0) { SNDERR("Not string: ctl:%s cbname should be a valid string", ctlLabel); return -EINVAL; } if (funcname[0] != '@') { SNDERR("Not string: ctl:%s cbname=%s should be prefixed with '@' ", ctlLabel, funcname); return -EINVAL; } if (!plughandle->dlHandle) { SNDERR("No CB: ctl:%s cblib:/my/libcallback missing from asoundrc", ctlLabel); return -EINVAL; } funcaddr = dlsym(plughandle->dlHandle, &funcname[1]); if (!funcaddr) { SNDERR("NotFound CB: ctl:%s cbname='%s' no symbol into %s", ctlLabel, &funcname[1], libname); return -EINVAL; } plughandle->cbs[plughandle->ctlsCount] = funcaddr; } err = snd_config_search(ctlconfig, "name", &itemConf); if (err) { SNDERR("Not Found: 'name' mandatory in ctl config"); return -EINVAL; } if (snd_config_get_string(itemConf, &ctlName) < 0) { SNDERR("Not String: ctl:%s 'name' should be a valie string", ctlLabel); return -EINVAL; } plughandle->ctls[plughandle->ctlsCount].ctlName = strdup(ctlName); // move to next ctl if any plughandle->ctlsCount++; } // end for each ctl continue; } SNDERR("Unknown field %s", id); return -EINVAL; } // Create ALSA control plugin structure plughandle->ext.version = SND_CTL_EXT_VERSION; plughandle->ext.card_idx = 0; /* FIXME */ strcpy(plughandle->ext.id, "AFB-HAL-CTL"); strcpy(plughandle->ext.driver, "AFB-HAL"); strcpy(plughandle->ext.name, "AFB-HAL Control Plugin"); strcpy(plughandle->ext.mixername, "AFB-HAL Mixer Plugin"); strcpy(plughandle->ext.longname, "Automotive-Linux Sound Abstraction Control Plugin"); plughandle->ext.poll_fd = -1; plughandle->ext.callback = &afbHalCBs; plughandle->ext.private_data = (void*) plughandle; err = snd_ctl_ext_create(&plughandle->ext, name, mode); if (err < 0) { SNDERR("Fail Register sndctl for devid=%s", plughandle->devid); goto OnErrorExit; } // Plugin register controls update handlep before exiting *handlep = plughandle->ext.handle; return 0; OnErrorExit: free(plughandle); return -1; } SND_CTL_PLUGIN_SYMBOL(afbhal);