您尚未登录。

#1 全志 SOC » 这几天看到Q群都在讨论全志的X3 (A33 with DDR), 其实也没有啥创新,但是解决用户的痛点 » 2020-03-16 10:03:36

红白机
回复: 6

解决用户痛点的产品就是好产品,

虽然没有啥创新,

我看全志 A7/A8 还能再战十年。

#2 Re: NB-IoT/2G模块/4G模块/GPRS模块/GPS/北斗 » nbiot + gsm + 室外定位 + 室内定位 + 录音 » 2020-03-02 14:41:17

室内定位不知道现在用何种技术, 录音是用触发模式吗?检测到高于某分贝才开启录音吧?

#3 Re: NB-IoT/2G模块/4G模块/GPRS模块/GPS/北斗 » nbiot + gsm + 室外定位 + 室内定位 + 录音 » 2020-03-02 14:19:37

同时满足恐怕没有, nbiot 和其他功能是互斥的,

nbiot 致力于低功耗, 一次通讯,长时间休眠, 而且通讯的数据量都很小。

#4 Re: 全志 SOC » 尝试从零构建F1C100s开发环境 » 2020-02-26 17:01:09

王佳伟 说:

谢谢你的链接,我用连接下了压缩包,然后在unbuntu上解压了,但是我打开文件夹输入git branch -a的时候出现了
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
的现象,然后也没找到 nano-v2018.01 这一个分支

再执行: git pull origin nano-v2018.01

估计是widora 那个加速器不支持拉取分支。

#6 Re: 华芯微特 » 为抗击疫情,支援湖北,现急需温度探头厂家,有推荐的吗? » 2020-02-25 16:49:49

大爱! 帮顶一下。

韩国日本已经完全放飞自我了,现在真担心出口转内销了,出入境得抓严了。

#9 Re: 全志 SOC » F1C200S入坑手记 » 2020-02-22 09:15:52

英语这么好, 怪不得可以在墙外怼白皮。

#11 Re: 全志 SOC » 本来想在全志V3s试一下Qt5.9, 结果发现每个动态链接库都是很大个, libQt5Core高达 5M » 2020-02-21 08:54:28

QtCore 是一个巨无霸一样的存在, 特喜欢 QString, 真正的字符串类, 啥功能都能完成。

#17 Re: 华芯微特 » 华芯微特正式复工啦!!! » 2020-02-17 14:34:16

我们也是今天复工, 万万没想不到过了年, 口罩,防护服,体温枪成了硬通货, 早知道提前囤一屋子,哪里还要上毛线班。

#21 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 搜了一圈, 还是没找到50PIN RGB TTL 液晶接口转 40PIN LVDS 接口转换板 » 2020-02-17 14:22:15

sea18c 说:

调试成功了吗?



QQ图片20211220185149.jpg

大家新年好,今天刚刚开工,焊了两片,
调试成功, 全志 V3s  + 天马TM101JDHP01 LVDS 1280x800 显示正常,
IPS屏的效果非常好,和手机一样。

#24 Re: 全志 SOC » Allwinner H3 Projector with custom Android 4.4.2 called Levision. HELP » 2020-01-16 15:00:54

你得想办法进入 android的recovery模式,这种模式下面才能升级 update.zip

#25 Re: 全志 SOC » 入坑荔枝派zero,希望大神帮忙解决一些基础问题 » 2020-01-16 14:42:15

你有没有用到 DRAM ?如果没有用就只能在 SRAM跑, 链接地址也只能是这个范围之内了。

搜了一下v3s手册, 确实没有关于8k偏移的说明,但是这个值是固定的,全志所有芯片都是这样。

#26 Re: 8051/STC8/AT89C51/N76E003 » 请教N76E003单片机经常死机,怎么在看门狗中断打印死在什么地方? » 2020-01-16 14:20:45

danile 说:

好像不死了,这样更可怕。

关了看门狗, 现在不死机?

#27 Re: 8051/STC8/AT89C51/N76E003 » 请教N76E003单片机经常死机,怎么在看门狗中断打印死在什么地方? » 2020-01-16 14:13:01

CORTEX-M3 有几种模式,所以可以打印PC地址吧? 而8051只有一种模式?是不是这样?

#28 Re: 全志 SOC » 编译索智(Sochip) S3 SDK (zeta) 【提供DXP格式原理图与PCB,感谢 @playflash】 » 2020-01-16 14:08:49

Sk吴 说:

S3:触摸屏怎么实现双击功能。

触摸的双击是 GUI 软件实现的。

具体你可以翻下 uC/GUI, littlevgl 的代码。

#29 Re: 全志 SOC » 发现淘宝有卖F1C100S源码的 » 2020-01-16 14:06:28

嗯, 1499 不贵, 作者不知道加了多少班才捣鼓出来的。

#30 Re: 全志 SOC » 求助,刚学习V3s,请问怎么设置从flash启动 » 2020-01-16 13:51:05

把 TF 卡里面的 8k 偏移的数据擦掉就行了, BROM 在 TF卡找不到合法的数据就去找SPI FLASH.

#31 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 搜了一圈, 还是没找到50PIN RGB TTL 液晶接口转 40PIN LVDS 接口转换板 » 2020-01-16 11:23:22

hzsteven 说:

搞好了,开售吧,每个人单兵作战,重复成本开销太大。

好, 只是JLC不能贴FPC, 不知道哪家贴片厂比较靠谱一点。

#37 Re: NXP i.MX6UL/6ULL » 请教,交叉编译器gcc和文件系统里的gcc是一回事吗? » 2020-01-15 10:11:47

文件系统需要统一的gcc版本, 也就是 libc 和你的  app用同一个gcc, 如果你的 app 静态链接, 连这个gcc都不需要一致。

kernel(zImage)和 ko文件得用同一个 gcc 版本编译。

其他随意, 没有强制要求。

#40 Re: 华芯微特 » 从零开发SWM181之----构建裸机控制台框架 [收到来自华芯微特--韬哥的SWM181CBT6开发板] » 2020-01-11 15:17:38

发现并没有特定的串口引脚,芯片内部有一个神奇的数字信号引脚分配器——>PORTCON。
对于部分数字输入输出功能,可以配置到任意 I/O 引脚,以方便板级布局。

这个不错, 貌似ESP32也是这样。

#42 VMWare/Linux/Ubuntu/Fedora/CentOS/U-BOOT » 转发一个opengl 渲染到缓冲区,写到文件的 demo » 2020-01-11 09:10:01

红白机
回复: 6

offscreen.c

/* http://stackoverflow.com/questions/3191978/how-to-use-glut-opengl-to-render-to-a-file/14324292#14324292 */

/* Turn output methods on and off. */
#ifndef PPM
#define PPM 1
#endif
#ifndef LIBPNG
#define LIBPNG 1
#endif
#ifndef FFMPEG
#define FFMPEG 1
#endif

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define GL_GLEXT_PROTOTYPES 1
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <GL/glext.h>

#if LIBPNG
#include <png.h>
#endif

#if FFMPEG
#include <libavcodec/avcodec.h>
#include <libavutil/imgutils.h>
#include <libavutil/opt.h>
#include <libswscale/swscale.h>
#endif

enum Constants { SCREENSHOT_MAX_FILENAME = 256 };
static GLubyte *pixels = NULL;
static GLuint fbo;
static GLuint rbo_color;
static GLuint rbo_depth;
static int offscreen = 1;
static unsigned int max_nframes = 128;
static unsigned int nframes = 0;
static unsigned int time0;
static unsigned int height = 128;
static unsigned int width = 128;
#define PPM_BIT (1 << 0)
#define LIBPNG_BIT (1 << 1)
#define FFMPEG_BIT (1 << 2)
static unsigned int output_formats = PPM_BIT | LIBPNG_BIT | FFMPEG_BIT;

/* Model. */
static double angle;
static double delta_angle;

#if PPM
/* Take screenshot with glReadPixels and save to a file in PPM format.
 *
 * -   filename: file path to save to, without extension
 * -   width: screen width in pixels
 * -   height: screen height in pixels
 * -   pixels: intermediate buffer to avoid repeated mallocs across multiple calls.
 *     Contents of this buffer do not matter. May be NULL, in which case it is initialized.
 *     You must `free` it when you won't be calling this function anymore.
 */
static void screenshot_ppm(const char *filename, unsigned int width,
        unsigned int height, GLubyte **pixels) {
    size_t i, j, cur;
    const size_t format_nchannels = 3;
    FILE *f = fopen(filename, "w");
    fprintf(f, "P3\n%d %d\n%d\n", width, height, 255);
    *pixels = realloc(*pixels, format_nchannels * sizeof(GLubyte) * width * height);
    glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, *pixels);
    for (i = 0; i < height; i++) {
        for (j = 0; j < width; j++) {
            cur = format_nchannels * ((height - i - 1) * width + j);
            fprintf(f, "%3d %3d %3d ", (*pixels)[cur], (*pixels)[cur + 1], (*pixels)[cur + 2]);
        }
        fprintf(f, "\n");
    }
    fclose(f);
}
#endif

#if LIBPNG
/* Adapted from https://github.com/cirosantilli/cpp-cheat/blob/19044698f91fefa9cb75328c44f7a487d336b541/png/open_manipulate_write.c */
static png_byte *png_bytes = NULL;
static png_byte **png_rows = NULL;
static void screenshot_png(const char *filename, unsigned int width, unsigned int height,
        GLubyte **pixels, png_byte **png_bytes, png_byte ***png_rows) {
    size_t i, nvals;
    const size_t format_nchannels = 4;
    FILE *f = fopen(filename, "wb");
    nvals = format_nchannels * width * height;
    *pixels = realloc(*pixels, nvals * sizeof(GLubyte));
    *png_bytes = realloc(*png_bytes, nvals * sizeof(png_byte));
    *png_rows = realloc(*png_rows, height * sizeof(png_byte*));
    glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, *pixels);
    for (i = 0; i < nvals; i++)
        (*png_bytes)[i] = (*pixels)[i];
    for (i = 0; i < height; i++)
        (*png_rows)[height - i - 1] = &(*png_bytes)[i * width * format_nchannels];
    png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
    if (!png) abort();
    png_infop info = png_create_info_struct(png);
    if (!info) abort();
    if (setjmp(png_jmpbuf(png))) abort();
    png_init_io(png, f);
    png_set_IHDR(
        png,
        info,
        width,
        height,
        8,
        PNG_COLOR_TYPE_RGBA,
        PNG_INTERLACE_NONE,
        PNG_COMPRESSION_TYPE_DEFAULT,
        PNG_FILTER_TYPE_DEFAULT
    );
    png_write_info(png, info);
    png_write_image(png, *png_rows);
    png_write_end(png, NULL);
    png_destroy_write_struct(&png, &info);
    fclose(f);
}
#endif

#if FFMPEG
/* Adapted from: https://github.com/cirosantilli/cpp-cheat/blob/19044698f91fefa9cb75328c44f7a487d336b541/ffmpeg/encode.c */

static AVCodecContext *c = NULL;
static AVFrame *frame;
static AVPacket pkt;
static FILE *file;
static struct SwsContext *sws_context = NULL;
static uint8_t *rgb = NULL;

static void ffmpeg_encoder_set_frame_yuv_from_rgb(uint8_t *rgb) {
    const int in_linesize[1] = { 4 * c->width };
    sws_context = sws_getCachedContext(sws_context,
            c->width, c->height, AV_PIX_FMT_RGB32,
            c->width, c->height, AV_PIX_FMT_YUV420P,
            0, NULL, NULL, NULL);
    sws_scale(sws_context, (const uint8_t * const *)&rgb, in_linesize, 0,
            c->height, frame->data, frame->linesize);
}

void ffmpeg_encoder_start(const char *filename, int codec_id, int fps, int width, int height) {
    AVCodec *codec;
    int ret;
    avcodec_register_all();
    codec = avcodec_find_encoder(codec_id);
    if (!codec) {
        fprintf(stderr, "Codec not found\n");
        exit(1);
    }
    c = avcodec_alloc_context3(codec);
    if (!c) {
        fprintf(stderr, "Could not allocate video codec context\n");
        exit(1);
    }
    c->bit_rate = 400000;
    c->width = width;
    c->height = height;
    c->time_base.num = 1;
    c->time_base.den = fps;
    c->gop_size = 10;
    c->max_b_frames = 1;
    c->pix_fmt = AV_PIX_FMT_YUV420P;
    if (codec_id == AV_CODEC_ID_H264)
        av_opt_set(c->priv_data, "preset", "slow", 0);
    if (avcodec_open2(c, codec, NULL) < 0) {
        fprintf(stderr, "Could not open codec\n");
        exit(1);
    }
    file = fopen(filename, "wb");
    if (!file) {
        fprintf(stderr, "Could not open %s\n", filename);
        exit(1);
    }
    frame = av_frame_alloc();
    if (!frame) {
        fprintf(stderr, "Could not allocate video frame\n");
        exit(1);
    }
    frame->format = c->pix_fmt;
    frame->width  = c->width;
    frame->height = c->height;
    ret = av_image_alloc(frame->data, frame->linesize, c->width, c->height, c->pix_fmt, 32);
    if (ret < 0) {
        fprintf(stderr, "Could not allocate raw picture buffer\n");
        exit(1);
    }
}

void ffmpeg_encoder_finish(void) {
    uint8_t endcode[] = { 0, 0, 1, 0xb7 };
    int got_output, ret;
    do {
        fflush(stdout);
        ret = avcodec_encode_video2(c, &pkt, NULL, &got_output);
        if (ret < 0) {
            fprintf(stderr, "Error encoding frame\n");
            exit(1);
        }
        if (got_output) {
            fwrite(pkt.data, 1, pkt.size, file);
            av_packet_unref(&pkt);
        }
    } while (got_output);
    fwrite(endcode, 1, sizeof(endcode), file);
    fclose(file);
    avcodec_close(c);
    av_free(c);
    av_freep(&frame->data[0]);
    av_frame_free(&frame);
}

void ffmpeg_encoder_encode_frame(uint8_t *rgb) {
    int ret, got_output;
    ffmpeg_encoder_set_frame_yuv_from_rgb(rgb);
    av_init_packet(&pkt);
    pkt.data = NULL;
    pkt.size = 0;
    ret = avcodec_encode_video2(c, &pkt, frame, &got_output);
    if (ret < 0) {
        fprintf(stderr, "Error encoding frame\n");
        exit(1);
    }
    if (got_output) {
        fwrite(pkt.data, 1, pkt.size, file);
        av_packet_unref(&pkt);
    }
}

void ffmpeg_encoder_glread_rgb(uint8_t **rgb, GLubyte **pixels, unsigned int width, unsigned int height) {
    size_t i, j, k, cur_gl, cur_rgb, nvals;
    const size_t format_nchannels = 4;
    nvals = format_nchannels * width * height;
    *pixels = realloc(*pixels, nvals * sizeof(GLubyte));
    *rgb = realloc(*rgb, nvals * sizeof(uint8_t));
    /* Get RGBA to align to 32 bits instead of just 24 for RGB. May be faster for FFmpeg. */
    glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, *pixels);
    for (i = 0; i < height; i++) {
        for (j = 0; j < width; j++) {
            cur_gl  = format_nchannels * (width * (height - i - 1) + j);
            cur_rgb = format_nchannels * (width * i + j);
            for (k = 0; k < format_nchannels; k++)
                (*rgb)[cur_rgb + k] = (*pixels)[cur_gl + k];
        }
    }
}
#endif

static void model_init(void) {
    angle = 0;
    delta_angle = 1;
}

static int model_update(void) {
    angle += delta_angle;
    return 0;
}

static int model_finished(void) {
    return nframes >= max_nframes;
}

static void init(void)  {
    int glget;

    if (offscreen) {
        /*  Framebuffer */
        glGenFramebuffers(1, &fbo);
        glBindFramebuffer(GL_FRAMEBUFFER, fbo);

        /* Color renderbuffer. */
        glGenRenderbuffers(1, &rbo_color);
        glBindRenderbuffer(GL_RENDERBUFFER, rbo_color);
        /* Storage must be one of: */
        /* GL_RGBA4, GL_RGB565, GL_RGB5_A1, GL_DEPTH_COMPONENT16, GL_STENCIL_INDEX8. */
        glRenderbufferStorage(GL_RENDERBUFFER, GL_RGB565, width, height);
        glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo_color);

        /* Depth renderbuffer. */
        glGenRenderbuffers(1, &rbo_depth);
        glBindRenderbuffer(GL_RENDERBUFFER, rbo_depth);
        glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height);
        glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rbo_depth);

        glReadBuffer(GL_COLOR_ATTACHMENT0);

        /* Sanity check. */
        assert(glCheckFramebufferStatus(GL_FRAMEBUFFER));
        glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &glget);
        assert(width < (unsigned int)glget);
        assert(height < (unsigned int)glget);
    } else {
        glReadBuffer(GL_BACK);
    }

    glClearColor(0.0, 0.0, 0.0, 0.0);
    glEnable(GL_DEPTH_TEST);
    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
    glViewport(0, 0, width, height);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glMatrixMode(GL_MODELVIEW);

    time0 = glutGet(GLUT_ELAPSED_TIME);
    model_init();
#if FFMPEG
    ffmpeg_encoder_start("tmp.mpg", AV_CODEC_ID_MPEG1VIDEO, 25, width, height);
#endif
}

static void deinit(void)  {
    printf("FPS = %f\n", 1000.0 * nframes / (double)(glutGet(GLUT_ELAPSED_TIME) - time0));
    free(pixels);
#if LIBPNG
    if (output_formats & LIBPNG_BIT) {
        free(png_bytes);
        free(png_rows);
    }
#endif
#if FFMPEG
    if (output_formats & FFMPEG_BIT) {
        ffmpeg_encoder_finish();
        free(rgb);
    }
#endif
    if (offscreen) {
        glDeleteFramebuffers(1, &fbo);
        glDeleteRenderbuffers(1, &rbo_color);
        glDeleteRenderbuffers(1, &rbo_depth);
    }
}

static void draw_scene(void) {
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glLoadIdentity();
    glRotatef(angle, 0.0f, 0.0f, -1.0f);
    glBegin(GL_TRIANGLES);
    glColor3f(1.0f, 0.0f, 0.0f);
    glVertex3f( 0.0f,  0.5f, 0.0f);
    glColor3f(0.0f, 1.0f, 0.0f);
    glVertex3f(-0.5f, -0.5f, 0.0f);
    glColor3f(0.0f, 0.0f, 1.0f);
    glVertex3f( 0.5f, -0.5f, 0.0f);
    glEnd();
}

static void display(void) {
    char filename[SCREENSHOT_MAX_FILENAME];
    draw_scene();
    if (offscreen) {
        glFlush();
    } else {
        glutSwapBuffers();
    }
#if PPM
    if (output_formats & PPM_BIT) {
        snprintf(filename, SCREENSHOT_MAX_FILENAME, "tmp.%d.ppm", nframes);
        screenshot_ppm(filename, width, height, &pixels);
    }
#endif
#if LIBPNG
    if (output_formats & LIBPNG_BIT) {
        snprintf(filename, SCREENSHOT_MAX_FILENAME, "tmp.%d.png", nframes);
        screenshot_png(filename, width, height, &pixels, &png_bytes, &png_rows);
    }
#endif
# if FFMPEG
    if (output_formats & FFMPEG_BIT) {
        frame->pts = nframes;
        ffmpeg_encoder_glread_rgb(&rgb, &pixels, width, height);
        ffmpeg_encoder_encode_frame(rgb);
    }
#endif
    nframes++;
    if (model_finished())
        exit(EXIT_SUCCESS);
}

static void idle(void) {
    while (model_update());
    glutPostRedisplay();
}

int main(int argc, char **argv) {
    int arg;
    GLint glut_display;

    /* CLI args. */
    glutInit(&argc, argv);
    arg = 1;
    if (argc > arg) {
        offscreen = (argv[arg][0] == '1');
    } else {
        offscreen = 1;
    }
    arg++;
    if (argc > arg) {
        max_nframes = strtoumax(argv[arg], NULL, 10);
    }
    arg++;
    if (argc > arg) {
        width = strtoumax(argv[arg], NULL, 10);
    }
    arg++;
    if (argc > arg) {
        height = strtoumax(argv[arg], NULL, 10);
    }
    arg++;
    if (argc > arg) {
        output_formats = strtoumax(argv[arg], NULL, 10);
    }

    /* Work. */
    if (offscreen) {
        /* TODO: if we use anything smaller than the window, it only renders a smaller version of things. */
        /*glutInitWindowSize(50, 50);*/
        glutInitWindowSize(width, height);
        glut_display = GLUT_SINGLE;
    } else {
        glutInitWindowSize(width, height);
        glutInitWindowPosition(100, 100);
        glut_display = GLUT_DOUBLE;
    }
    glutInitDisplayMode(glut_display | GLUT_RGBA | GLUT_DEPTH);
    glutCreateWindow(argv[0]);
    if (offscreen) {
        /* TODO: if we hide the window the program blocks. */
        /*glutHideWindow();*/
    }
    init();
    glutDisplayFunc(display);
    glutIdleFunc(idle);
    atexit(deinit);
    glutMainLoop();
    return EXIT_SUCCESS;
}

安装sdk:

sudo apt-get install libpng-dev libavcodec-dev libavutil-dev

编译:

gcc -DPPM=1 -DLIBPNG=1 -DFFMPEG=1 -ggdb3 -std=c99 -O0 -Wall -Wextra \
  -o offscreen offscreen.c -lGL -lGLU -lglut -lpng -lavcodec -lswscale -lavutil

运行:

./offscreen

然后就生成了一堆你需要的 ppm, png, mpg文件

参考1: https://stackoverflow.com/questions/3191978/how-to-use-glut-opengl-to-render-to-a-file
参考2: https://github.com/cirosantilli/cpp-cheat/blob/master/opengl/offscreen.c

#43 Re: 全志 SOC » 全志R11核心板和底板(主要跑RTT和柿饼UI) » 2020-01-11 08:44:56

642242855 说:

看到TB网店开卖了,45 RMB

R11开发板?没搜到哦

#44 Re: 全志 SOC » V3s buildroot 一键生成打包生成32M spi flash 镜像, jffs2 文件系统, 默认启动 Qt 模拟时钟demo, » 2020-01-10 17:30:21

yuanlwjt 说:

我是直接从论坛里下载的别人做好的镜像文件,烧写到SD卡测试硬件好不好的,没有自己去编译,目前不清楚该镜像能否支持远程登录,所以问一下,能否登录到设备,看一下设备内部信息。

这个得自己去编译, buildroot 勾选 dropbear 才行。现成的固件不一定有这个功能吧。

#46 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 搜了一圈, 还是没找到50PIN RGB TTL 液晶接口转 40PIN LVDS 接口转换板 » 2020-01-10 17:11:42

hzsteven 说:

主机显示接口输出电压多少?8285接受1.8V或者3.3V,而90385只接受3.3V

接的是V3s, 应该是3V3吧.

请问第一脚应该是低电平还是高电平?

#50 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 搜了一圈, 还是没找到50PIN RGB TTL 液晶接口转 40PIN LVDS 接口转换板 » 2020-01-10 16:27:37

gm8285c_ds90c385.jpg

gm8285c ds90c385 有区别吗?
为什么我直接把 gm8285c 替换成 ds90c385, TM101JDHP01 就没显示了?
我应该怎么排除问题?
请教大家, 在线等。

#53 Re: 全志 SOC » f1c100s/200s图形化烧录工具 » 2020-01-09 15:00:56

然后分析 out 输出的结果解析成进度?

#54 Re: 全志 SOC » AXP173电源管理芯片2路DCDC4路LDO带锂电池充放电管理库仑计等,DEMO板子(函立创EDA图纸) » 2020-01-09 14:49:11

jimchn 说:

呀!你也用立创EDA呀,他们新出了个开源硬件平台 https://oshwhub.com/(立创EDA开源硬件平台),这些资料可以顺带上传到他们那啊。

这个可以有, 下次用 lceda 画板可以传上去玩玩。

#55 Re: 全志 SOC » f1c100s/200s图形化烧录工具 » 2020-01-09 14:48:04

是通过调用 sunxi-fel.exe 进程吗?如何获取进度的? pipe 管道吗?

#68 Re: 全志 SOC » 求助 全志 A64 触摸屏配置 » 2020-01-08 12:14:02

cat /dev/input/event*
evtest /dev/input/event*

看终端有没有输出.

#74 Re: 全志 SOC » 全志 A10/A20/A33/H3/A64/H5 等的主线Linux也可以使用 OpenGL ES, 有没有哪位朋友测试过? » 2020-01-08 10:18:06

https://bootlin.com/blog/more-opengl-binaries-for-the-mali-support-on-allwinner-platforms-with-mainline-linux/

这些二进制Blob非常有用,因为它们现在允许在Allwinner平台上具有完全正常的OpenGL加速:
作为稳定性测试,我们最近在Allwinner A33平台上运行了一个Qt5应用程序,
在Allwinner A33平台上进行OpenGL渲染24/7,持续了1.5个月。当然,从长远来看,
我们将跟踪Lima项目的进度,该项目将提供一个完全免费的开源解决方案,
以在Allwinner平台上提供OpenGL加速。

看来稳定性不错嘛.


还有一个问题, https://github.com/bootlin/mali-blobs/tree/master/r6p2/arm/wayland
这些文件是谁发布的呢?
全志?arm?

#76 Re: VMWare/Linux/Ubuntu/Fedora/CentOS/U-BOOT » 腾讯云服务器Ubuntu 开 vnserver, 我的电脑连进去之后, opengl 测试程序跑不了 :( » 2020-01-08 09:53:46

root@test5:/opt/virtualgl/build# make
[  2%] Built target vglutil
[  2%] Built target vglsocket
[  2%] Built target nettest
[  3%] Built target fbx-faker
[  4%] Built target pftest
[  4%] Built target fbx
[  5%] Built target bmptest
[  5%] Built target fbxtest
[  5%] Built target threadtest
[  6%] Built target fbxv
[  7%] Built target fbxvtest
[  8%] Built target glreadtest
[  8%] Built target glframe
[  9%] Built target vglcommon
[  9%] Built target frameut
[ 10%] Built target gefaker
[ 11%] Built target x11transut
[ 12%] Built target dlfaker
[ 13%] Built target vgltrans_test
[ 13%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/ConfigHash.cpp.o
[ 13%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/ContextHash.cpp.o
[ 14%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/DisplayHash.cpp.o
[ 14%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/faker.cpp.o
[ 14%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/faker-gl.cpp.o
[ 14%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/faker-glx.cpp.o
[ 15%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/faker-sym.cpp.o
[ 15%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/faker-x11.cpp.o
[ 15%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/faker-xcb.cpp.o
[ 16%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/XCBConnHash.cpp.o
[ 16%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/fakerconfig.cpp.o
[ 16%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/GlobalCriticalSection.cpp.o
[ 16%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/GLXDrawableHash.cpp.o
[ 17%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/glxvisual.cpp.o
[ 17%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/PixmapHash.cpp.o
[ 17%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/ReverseConfigHash.cpp.o
[ 18%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/TransPlugin.cpp.o
[ 18%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/VirtualDrawable.cpp.o
[ 18%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/VirtualPixmap.cpp.o
[ 18%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/VirtualWin.cpp.o
[ 19%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/VisualHash.cpp.o
[ 19%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/WindowHash.cpp.o
[ 19%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/X11Trans.cpp.o
[ 20%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/vglconfigLauncher.cpp.o
[ 20%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/VGLTrans.cpp.o
[ 20%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/XVTrans.cpp.o
[ 20%] Building CXX object server/CMakeFiles/vglfaker-opencl.dir/faker-ocl.cpp.o
[ 21%] Linking CXX shared library ../lib/libvglfaker-opencl.so
[ 22%] Built target vglfaker-opencl
[ 59%] Built target fltk_static
[ 60%] Built target vglconfig
Scanning dependencies of target vglfaker
[ 61%] Building CXX object server/CMakeFiles/vglfaker.dir/ConfigHash.cpp.o
[ 61%] Building CXX object server/CMakeFiles/vglfaker.dir/ContextHash.cpp.o
[ 61%] Building CXX object server/CMakeFiles/vglfaker.dir/DisplayHash.cpp.o
[ 62%] Building CXX object server/CMakeFiles/vglfaker.dir/faker.cpp.o
[ 62%] Building CXX object server/CMakeFiles/vglfaker.dir/faker-gl.cpp.o
[ 62%] Building CXX object server/CMakeFiles/vglfaker.dir/faker-glx.cpp.o
[ 62%] Building CXX object server/CMakeFiles/vglfaker.dir/faker-sym.cpp.o
[ 63%] Building CXX object server/CMakeFiles/vglfaker.dir/faker-x11.cpp.o
[ 63%] Building CXX object server/CMakeFiles/vglfaker.dir/faker-xcb.cpp.o
[ 63%] Building CXX object server/CMakeFiles/vglfaker.dir/XCBConnHash.cpp.o
[ 64%] Building CXX object server/CMakeFiles/vglfaker.dir/fakerconfig.cpp.o
[ 64%] Building CXX object server/CMakeFiles/vglfaker.dir/GlobalCriticalSection.cpp.o
[ 64%] Building CXX object server/CMakeFiles/vglfaker.dir/GLXDrawableHash.cpp.o
[ 64%] Building CXX object server/CMakeFiles/vglfaker.dir/glxvisual.cpp.o
[ 65%] Building CXX object server/CMakeFiles/vglfaker.dir/PixmapHash.cpp.o
[ 65%] Building CXX object server/CMakeFiles/vglfaker.dir/ReverseConfigHash.cpp.o
[ 65%] Building CXX object server/CMakeFiles/vglfaker.dir/TransPlugin.cpp.o
[ 66%] Building CXX object server/CMakeFiles/vglfaker.dir/VirtualDrawable.cpp.o
[ 66%] Building CXX object server/CMakeFiles/vglfaker.dir/VirtualPixmap.cpp.o
[ 66%] Building CXX object server/CMakeFiles/vglfaker.dir/VirtualWin.cpp.o
[ 66%] Building CXX object server/CMakeFiles/vglfaker.dir/VisualHash.cpp.o
[ 67%] Building CXX object server/CMakeFiles/vglfaker.dir/WindowHash.cpp.o
[ 67%] Building CXX object server/CMakeFiles/vglfaker.dir/X11Trans.cpp.o
[ 67%] Building CXX object server/CMakeFiles/vglfaker.dir/vglconfigLauncher.cpp.o
[ 68%] Building CXX object server/CMakeFiles/vglfaker.dir/VGLTrans.cpp.o
[ 68%] Building CXX object server/CMakeFiles/vglfaker.dir/XVTrans.cpp.o
[ 68%] Linking CXX shared library ../lib/libvglfaker.so
[ 68%] Built target vglfaker
Scanning dependencies of target vglfaker-nodl
[ 68%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/ConfigHash.cpp.o
[ 68%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/ContextHash.cpp.o
[ 68%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/DisplayHash.cpp.o
[ 69%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/faker.cpp.o
[ 69%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/faker-gl.cpp.o
[ 69%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/faker-glx.cpp.o
[ 70%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/faker-sym.cpp.o
[ 70%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/faker-x11.cpp.o
[ 70%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/faker-xcb.cpp.o
[ 70%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/XCBConnHash.cpp.o
[ 71%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/fakerconfig.cpp.o
[ 71%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/GlobalCriticalSec                                                                   tion.cpp.o
[ 71%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/GLXDrawableHash.c                                                                   pp.o
[ 72%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/glxvisual.cpp.o
[ 72%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/PixmapHash.cpp.o
[ 72%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/ReverseConfigHash                                                                   .cpp.o
[ 72%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/TransPlugin.cpp.o
[ 73%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/VirtualDrawable.c                                                                   pp.o
[ 73%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/VirtualPixmap.cpp                                                                   .o
[ 73%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/VirtualWin.cpp.o
[ 74%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/VisualHash.cpp.o
[ 74%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/WindowHash.cpp.o
[ 74%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/X11Trans.cpp.o
[ 74%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/vglconfigLauncher                                                                   .cpp.o
[ 75%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/VGLTrans.cpp.o
[ 75%] Building CXX object server/CMakeFiles/vglfaker-nodl.dir/XVTrans.cpp.o
[ 75%] Linking CXX shared library ../lib/libvglfaker-nodl.so
[ 76%] Built target vglfaker-nodl
Scanning dependencies of target vgltransut
[ 76%] Building CXX object server/CMakeFiles/vgltransut.dir/vgltransut.cpp.o
[ 77%] Building CXX object server/CMakeFiles/vgltransut.dir/VGLTrans.cpp.o
[ 77%] Building CXX object server/CMakeFiles/vgltransut.dir/fakerconfig.cpp.o
[ 77%] Linking CXX executable ../bin/vgltransut
[ 77%] Built target vgltransut
[ 78%] Built target dlfakerut
[ 78%] Built target deepbindtest
[ 78%] Built target GLdlfakerut
Scanning dependencies of target vgltrans_test2
[ 79%] Building CXX object server/CMakeFiles/vgltrans_test2.dir/testplugin2.cpp.                                                                   o
[ 79%] Building CXX object server/CMakeFiles/vgltrans_test2.dir/X11Trans.cpp.o
[ 79%] Linking CXX shared library ../lib/libvgltrans_test2.so
[ 79%] Built target vgltrans_test2
[ 80%] Built target fakerut
Scanning dependencies of target vglclient
[ 80%] Building CXX object client/CMakeFiles/vglclient.dir/vglclient.cpp.o
[ 81%] Building CXX object client/CMakeFiles/vglclient.dir/ClientWin.cpp.o
[ 81%] Building CXX object client/CMakeFiles/vglclient.dir/VGLTransReceiver.cpp.                                                                   o
[ 81%] Linking CXX executable ../bin/vglclient
[ 81%] Built target vglclient
[ 82%] Built target xrotfontdemo
[ 83%] Built target pbdemo
[ 84%] Built target glxspheres64
[ 85%] Built target glxinfo
[ 86%] Built target wincopy
[ 87%] Built target texture_from_pixmap
[ 88%] Built target glxcontexts
[ 89%] Built target glxgears
[ 90%] Built target glthreadsint
[ 91%] Built target xfont
[ 92%] Built target sharedtex
[ 92%] Built target glthreads
[ 92%] Built target shape
[ 92%] Built target glxdemo
[ 93%] Built target testgl5
[ 93%] Built target glxgears_pixmap
[ 94%] Built target glxheads
[ 95%] Built target offset
[ 95%] Built target glxpbdemo
[ 96%] Built target pbinfo
[ 97%] Built target glxpixmap
[ 98%] Built target sharedtex_mt
[ 99%] Built target manywin
[ 99%] Built target overlay
[ 99%] Built target imgdiff
[100%] Built target cpustat
[100%] Built target tcbench
root@test5:/opt/virtualgl/build# ls
bin     CMakeCache.txt  cmake_install.cmake    common  doc       include  Makefile    server     util
client  CMakeFiles      cmake_uninstall.cmake  diags   glxdemos  lib      pkgscripts  staticlib
root@test5:/opt/virtualgl/build# cd bin/
root@test5:/opt/virtualgl/build/bin# ls
bmptest    fbxvtest      glxcontexts      glxinfo       manywin  pbinfo      sharedtex_mt         utiltest    vgltransut
cpustat    frameut       glxdemo          glxpbdemo     nettest  pftest      tcbench              vglclient   wincopy
dlfakerut  glreadtest    glxgears         glxpixmap     offset   servertest  testgl5              vglconfig   x11transut
fakerut    glthreads     glxgears_pixmap  glxspheres64  overlay  shape       texture_from_pixmap  vglconnect  xfont
fbxtest    glthreadsint  glxheads         imgdiff       pbdemo   sharedtex   threadtest           vglrun      xrotfontdemo
root@test5:/opt/virtualgl/build/bin# cd ..
root@test5:/opt/virtualgl/build# make install
[  2%] Built target vglutil
[  2%] Built target vglsocket
[  2%] Built target nettest
[  3%] Built target fbx-faker
[  4%] Built target pftest
[  4%] Built target fbx
[  5%] Built target bmptest
[  5%] Built target fbxtest
[  5%] Built target threadtest
[  6%] Built target fbxv
[  7%] Built target fbxvtest
[  8%] Built target glreadtest
[  8%] Built target glframe
[  9%] Built target vglcommon
[  9%] Built target frameut
[ 10%] Built target gefaker
[ 11%] Built target x11transut
[ 12%] Built target dlfaker
[ 13%] Built target vgltrans_test
[ 22%] Built target vglfaker-opencl
[ 59%] Built target fltk_static
[ 60%] Built target vglconfig
[ 68%] Built target vglfaker
[ 76%] Built target vglfaker-nodl
[ 77%] Built target vgltransut
[ 78%] Built target dlfakerut
[ 78%] Built target deepbindtest
[ 78%] Built target GLdlfakerut
[ 79%] Built target vgltrans_test2
[ 80%] Built target fakerut
[ 81%] Built target vglclient
[ 82%] Built target xrotfontdemo
[ 83%] Built target pbdemo
[ 84%] Built target glxspheres64
[ 85%] Built target glxinfo
[ 86%] Built target wincopy
[ 87%] Built target texture_from_pixmap
[ 88%] Built target glxcontexts
[ 89%] Built target glxgears
[ 90%] Built target glthreadsint
[ 91%] Built target xfont
[ 92%] Built target sharedtex
[ 92%] Built target glthreads
[ 92%] Built target shape
[ 92%] Built target glxdemo
[ 93%] Built target testgl5
[ 93%] Built target glxgears_pixmap
[ 94%] Built target glxheads
[ 95%] Built target offset
[ 95%] Built target glxpbdemo
[ 96%] Built target pbinfo
[ 97%] Built target glxpixmap
[ 98%] Built target sharedtex_mt
[ 99%] Built target manywin
[ 99%] Built target overlay
[ 99%] Built target imgdiff
[100%] Built target cpustat
[100%] Built target tcbench
Install the project...
-- Install configuration: "Release"
-- Installing: /opt/VirtualGL/bin/nettest
-- Installing: /opt/VirtualGL/bin/glreadtest
-- Installing: /opt/VirtualGL/lib64/libvglfaker.so
-- Installing: /opt/VirtualGL/lib64/libvglfaker-nodl.so
-- Installing: /opt/VirtualGL/lib64/libvglfaker-opencl.so
-- Installing: /opt/VirtualGL/lib64/libdlfaker.so
-- Installing: /opt/VirtualGL/lib64/libgefaker.so
-- Installing: /opt/VirtualGL/include/rr.h
-- Installing: /opt/VirtualGL/include/rrtransport.h
-- Installing: /opt/VirtualGL/bin/vglconfig
-- Installing: /opt/VirtualGL/bin/vglgenkey
-- Installing: /opt/VirtualGL/bin/vgllogin
-- Installing: /opt/VirtualGL/bin/vglserver_config
-- Installing: /opt/VirtualGL/bin/vglrun
-- Installing: /opt/VirtualGL/bin/.vglrun.vars64
-- Installing: /opt/VirtualGL/bin/vglclient
-- Installing: /opt/VirtualGL/bin/vglconnect
-- Installing: /opt/VirtualGL/bin/glxinfo
-- Installing: /opt/VirtualGL/bin/glxspheres64
-- Installing: /opt/VirtualGL/bin/cpustat
-- Installing: /opt/VirtualGL/bin/tcbench
-- Installing: /opt/VirtualGL/doc/configdialog.gif
-- Installing: /opt/VirtualGL/doc/subsampling.gif
-- Installing: /opt/VirtualGL/doc/somerights20.png
-- Installing: /opt/VirtualGL/doc/sshtunnel.png
-- Installing: /opt/VirtualGL/doc/vgltransport.png
-- Installing: /opt/VirtualGL/doc/vgltransportservernetwork.png
-- Installing: /opt/VirtualGL/doc/x11transport.png
-- Installing: /opt/VirtualGL/doc/LICENSE-FLTK.txt
-- Installing: /opt/VirtualGL/doc/LICENSE.txt
-- Installing: /opt/VirtualGL/doc/LGPL.txt
-- Installing: /opt/VirtualGL/doc/index.html
-- Installing: /opt/VirtualGL/doc/virtualgl.css
-- Installing: /opt/VirtualGL/doc/ChangeLog.md
root@test5:/opt/virtualgl/build#

搞定, 接着跑一下试一试。

#77 Re: VMWare/Linux/Ubuntu/Fedora/CentOS/U-BOOT » 腾讯云服务器Ubuntu 开 vnserver, 我的电脑连进去之后, opengl 测试程序跑不了 :( » 2020-01-08 09:52:30

1. 准备
sudo apt-get install libturbojpeg-dev libopencl-dev libxtst-dev libxcb*-dev -y

2. 克隆
git clone https://github.com/VirtualGL/virtualgl.git

3. 编译
cd virtualgl
mkdir build
cd build
cmake ..

#84 Re: 全志 SOC » 求助 全志 A64 触摸屏配置 » 2020-01-07 21:57:15

有可能没问题,

有没有生成 /dev/input/event* 设备?

#87 Re: 全志 SOC » 分享个licheepi nano镜像,支持adb调试 » 2020-01-06 09:18:19

这个配置是荔枝派nano的,估计的PE2逻辑电平和荔枝派的刚好相反而已。

#89 Re: 全志 SOC » 分享个licheepi nano镜像,支持adb调试 » 2020-01-06 08:27:42

@wenfengtou 显示只是一个名字而已,估计最终还是用 adb 驱动的, 详情可以点进去设备看具体是哪些驱动文件起做作用的。

#90 Re: 全志 SOC » 尝试从零构建F1C100s开发环境 » 2020-01-06 08:26:20

@xiao.huang 你上传 buildroot 根目录下面的 .config, 不是 kernel 的 .config

#91 Re: 全志 SOC » 分享个licheepi nano镜像,支持adb调试 » 2020-01-06 00:45:11

https://whycan.cn/t_2940.html#p24311

https://whycan.cn/t_1672.html#p22720

试一试 @checkout 大神这个修改: https://whycan.cn/t_1672.html#p22720

直接按照上面各位大佬的步骤patch到4.14内核是没问题的,但荔枝派官方4.14-exp版本内核有个bug,就是105楼@Peter所遇到的
填坑:修改drivers/usb/musb/sunxi.c:742行

-      of_device_is_compatible(np, "allwinner,suniv-musb")) {
+      of_device_is_compatible(np, "allwinner,suniv-f1c100s-musb")) {

#96 Re: 计算机图形/GUI/RTOS/FileSystem/OpenGL/DirectX/SDL2 » SDL2 + nanovg 应用 » 2020-01-04 16:12:01

有些Linux电脑可能不支持 GL3, 所以需要改一下宏:

#define NANOVG_GL3_IMPLEMENTATION

==>

#define NANOVG_GL2_IMPLEMENTATION

#103 计算机图形/GUI/RTOS/FileSystem/OpenGL/DirectX/SDL2 » 基于nanovg 2d引擎库的 gui ---- nanogui » 2020-01-04 14:59:46

红白机
回复: 5

源码: https://github.com/wjakob/nanogui

1. 准备工作:
sudo apt-get install libglfw3-dev -y

2. 克隆源码:
git clone https://github.com/wjakob/nanogui
cd nanogui
git submodule update --init --recursive

3. 编译:
cmake .
make

4. 运行:
./example1
./example2
./example3
./example4

#104 Re: 全志 SOC » 自己做了一个V3S的板子,跑起来了,但运行程序时会出错,在荔枝上就不会出错,应该怎么找原因? » 2020-01-04 14:16:01

估计是电源问题, 检查 1.2v core, 1.8v dram 电压波纹, 也可以在 u-boot 把 cpu 和 dram 先把频率调低,看还会不会出现呗。

#109 Re: Qt/MSVC/MINGW/C++/MFC/GTK+/Delphi/BCB » 找到一个 win32 gdi & cairo 绘图引擎的 demo » 2020-01-03 17:05:24

2020-01-03_170314.png


	//画图区域限制在 圆心(128,128) 半径36.8 的圆内
	cairo_arc(cr, 128.0, 128.0, 36.8, 0, 2 * M_PI);
	cairo_clip(cr);

	//填充一个矩形区域
	cairo_new_path(cr);  	
	cairo_rectangle(cr, 0, 0, 256, 256);
	cairo_set_source_rgba(cr, 0.3, 0.3, 0.3, 0.1);
	cairo_fill(cr);

	//画 x
	cairo_set_source_rgba(cr, 0, 1, 0, 0.5);
	cairo_move_to(cr, 0, 0);
	cairo_line_to(cr, 256, 256);
	cairo_move_to(cr, 256, 0);
	cairo_line_to(cr, 0, 256);
	cairo_set_line_width(cr, 10.0);
	cairo_stroke(cr);

参考1 https://www.cairographics.org/samples/
参考2 https://www.cairographics.org/tutorial/
参考3 https://github.com/apachecn/zetcode-zh/
参考4 https://github.com/apachecn/zetcode-zh/blob/master/docs/graph/30.md

#111 Re: Qt/MSVC/MINGW/C++/MFC/GTK+/Delphi/BCB » 找到一个 win32 gdi & cairo 绘图引擎的 demo » 2020-01-03 15:38:59

	double xc = 20.0;
	double yc = 20.0;
	double radius = 200.0;
	double angle1 = 0.0  * (M_PI / 180.0);  /* angles are specified */
	double angle2 = 45.0 * (M_PI / 180.0);  /* in radians           */

	cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);

	cairo_set_line_width(cr, 1.0);
	cairo_arc(cr, xc, yc, radius, angle1, angle2);
	cairo_stroke(cr);

	/* draw helping lines */
	cairo_set_source_rgba(cr, 1, 0.2, 0.2, 0.6);
	cairo_set_line_width(cr, 1.0);

	cairo_arc(cr, xc, yc, 3.0, 0, 2 * M_PI);
	cairo_fill(cr);

	cairo_arc(cr, xc, yc, radius, angle1, angle1);
	cairo_line_to(cr, xc, yc);

	cairo_arc(cr, xc, yc, radius, angle2, angle2);
	cairo_line_to(cr, xc, yc);
	//cairo_fill(cr);

	cairo_stroke(cr);
	cairo_fill(cr);

2020-01-03_153811.png

参考1 https://www.cairographics.org/samples/
参考2 https://www.cairographics.org/tutorial/

#112 Re: Qt/MSVC/MINGW/C++/MFC/GTK+/Delphi/BCB » 找到一个 win32 gdi & cairo 绘图引擎的 demo » 2020-01-03 14:59:55

居然发现有同道中人 ^_^

线条抗锯齿关闭:
cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);

字体抗锯齿关闭:
cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_NONE);

#113 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » cairo 2D 画图引擎生成b样条曲线 (b-spline curve) » 2020-01-03 13:51:56

改了几行代码, 把点都标出来 bspline.c

/*! \file bspline.c
 * This file contains the functions to calculate control points from a list of
 * points for drawing bezier curves.
 *
 * License: This is free software. Take it, use it, modify it!
 *
 *  @author Bernhard R. Fischer
 *  @version 2015/11/30
 *
 */

#include <stdio.h>
#include <cairo.h>
#include <math.h>

#include "bspline.h"

void draw_dot(cairo_t *ctx, int x, int y)
{
//int   x=50.0;
//int y=400.0;
cairo_move_to (ctx, x,y);

/* draw helping lines */
cairo_set_source_rgba (ctx, 1, 0.2, 0.2, 0.6);
cairo_set_line_width (ctx, 6.0);
cairo_arc (ctx, x, y, 10.0, 0, 2*M_PI);
cairo_fill (ctx);
}


int main(int argc, char **argv)
{
   // Cairo surface and context.
   cairo_surface_t *dst;
   cairo_t *ctx;
   // Loop variable and variable for number of Points.
   int cnt;
   // Array of points.
   point_t pt[] = {{50, 400}, {500, 400}, {650, 220}, {480,90}, {430, 100}, {400, 110}, {300, 190}, };
   // Alternative array of points.
   //point_t pt[] = {{160, 190}, {100, 400}, {470, 600}, {300, 200}, {400, 150},
   //   {470, 250}, {575, 400}, {630, 390}, {650, 300}, {670, 210}};

  /* This parameter defines if the points shall be connected in a loop (start
    * = 0) or as open line (start = 1). */
   int start = 1;

   // Number of points in array.
   cnt = sizeof(pt) / sizeof(*pt);

//#define WITH_RAND
#ifdef WITH_RAND
   srand(time(NULL));
   for (int i = 0; i < cnt; i++)
      pt[i].x = rand() % 800, pt[i].y = rand() % 800;
#endif

   // Create and init Cairo drawing context.
   dst = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 800, 800);
   ctx = cairo_create(dst);
   COL_BG(ctx);
   cairo_paint(ctx);

   for(int i=0;i<sizeof(pt)/sizeof(pt[0]);i++)
   {
        draw_dot(ctx, pt[i].x, pt[i].y);
   }

#if 0
   draw_dot(ctx, pt[0].x, pt[0].y);
   draw_dot(ctx, pt[1].x, pt[1].y);
   draw_dot(ctx, pt[2].x, pt[2].y);
   draw_dot(ctx, pt[3].x, pt[3].y);
#endif
   // Draw curve between the points pt.
   draw_curve(ctx, pt, cnt, start);

   // Save image and destroy Cairo context.
   cairo_destroy(ctx);
   cairo_surface_write_to_png(dst, "bspline.png");
   cairo_surface_destroy(dst);

   return 0;
}

bspline2.png

代码参考: https://www.cairographics.org/samples/

#114 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » cairo 2D 画图引擎生成b样条曲线 (b-spline curve) » 2020-01-03 13:41:19

达克罗德 说:

最近刚好用python控制cairo画了这个曲线,用来绘制Plot。感谢你的C code!可能会用C改写一遍

不用客气,别人写的,我只是借花献佛而已。

#115 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » cairo 2D 画图引擎生成b样条曲线 (b-spline curve) » 2020-01-03 11:34:49

bspline.c

/*! \file bspline.c
 * This file contains the functions to calculate control points from a list of
 * points for drawing bezier curves.
 *
 * License: This is free software. Take it, use it, modify it!
 *
 *  @author Bernhard R. Fischer
 *  @version 2015/11/30
 *
 */

#include <stdio.h>
#include <cairo.h>
#include <math.h>

#include "bspline.h"


int main(int argc, char **argv)
{
   // Cairo surface and context.
   cairo_surface_t *dst;
   cairo_t *ctx;
   // Loop variable and variable for number of Points.
   int cnt;
   // Array of points.
   point_t pt[] = {{50, 400}, {500, 400}, {650, 220}, {480,90}};
   // Alternative array of points.
   //point_t pt[] = {{160, 190}, {100, 400}, {470, 600}, {300, 200}, {400, 150},
   //   {470, 250}, {575, 400}, {630, 390}, {650, 300}, {670, 210}};

  /* This parameter defines if the points shall be connected in a loop (start
    * = 0) or as open line (start = 1). */
   int start = 1;

   // Number of points in array.
   cnt = sizeof(pt) / sizeof(*pt);

//#define WITH_RAND
#ifdef WITH_RAND
   srand(time(NULL));
   for (int i = 0; i < cnt; i++)
      pt[i].x = rand() % 800, pt[i].y = rand() % 800;
#endif

   // Create and init Cairo drawing context.
   dst = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 800, 800);
   ctx = cairo_create(dst);
   COL_BG(ctx);
   cairo_paint(ctx);

   // Draw curve between the points pt.
   draw_curve(ctx, pt, cnt, start);

   // Save image and destroy Cairo context.
   cairo_destroy(ctx);
   cairo_surface_write_to_png(dst, "bspline.png");
   cairo_surface_destroy(dst);

   return 0;
}

bspline_constr.c

#ifdef CONSTRUCTION

#include <stdio.h>
#include <cairo.h>
#include <math.h>

#include "bspline.h"


static void dp(cairo_t *ctx, double x, double y)
{
   cairo_rectangle(ctx, x - R, y - R, R * 2, R * 2);
   cairo_fill(ctx);
}


static void show_angle(cairo_t *ctx, const line_t *l)
{
   char buf[20];
   double a;

   a = angle(l);
   snprintf(buf, sizeof(buf), "%.1f°", a * 180 / M_PI);
   cairo_save(ctx);
   cairo_move_to(ctx, (l->A.x + l->B.x) / 2, (l->A.y + l->B.y) / 2 - 5);
   if (a < -M_PI_2 || a > M_PI_2)
      a += M_PI;
   cairo_rotate(ctx, a);
   cairo_show_text(ctx, buf);
   cairo_restore(ctx);
}


void draw_lines(cairo_t *ctx, const point_t *pt, int cnt)
{
   char buf[20];
   int i;

   cairo_save(ctx);
   cairo_set_line_width(ctx, W_LINE);
   COL_LINE(ctx);
   cairo_new_path(ctx);
   for (i = 0; i < cnt; i++)
      cairo_line_to(ctx, pt[i].x, pt[i].y);
   cairo_stroke(ctx);

   cairo_select_font_face(ctx, "sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
   cairo_set_font_size(ctx, F_SIZE);
   for (i = 0; i < cnt; i++)
   {
      snprintf(buf, sizeof(buf), "P%d", i);
      cairo_move_to(ctx, pt[i].x - 5, pt[i].y + 14);
      cairo_show_text(ctx, buf);
      if (i < cnt - 1)
         show_angle(ctx, &((line_t) {pt[i], pt[(i + 1) % cnt]}));
   }
   cairo_restore(ctx);
}


void draw_construction(cairo_t *ctx, const point_t *pt, int cnt, int start)
{
   point_t c1, c2, prev_p;
   line_t g, l;
   double dash[] = {10, 5};
   char buf[20];
   int i;

   cairo_save(ctx);
   cairo_select_font_face(ctx, "sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
   cairo_set_font_size(ctx, F_SIZE);
   for (i = start; i < cnt; i++)
   {
      g.A = pt[(i + cnt - 2) % cnt];
      g.B = pt[(i + cnt - 1) % cnt];
      l.A = pt[(i + cnt + 0) % cnt];
      l.B = pt[(i + cnt + 1) % cnt];

      control_points(&g, &l, &c1, &c2);
      if (start && i == 1) c1 = g.B;
      if (start && i == cnt - 1) c2 = l.A;

      COL_C1(ctx);
      dp(ctx, c1.x, c1.y);
      snprintf(buf, sizeof(buf), "C1[%d] (%d/%d)", i, (int) c1.x, (int) c1.y);
      cairo_move_to(ctx, c1.x + 5, c1.y);
      cairo_show_text(ctx, buf);

      COL_C2(ctx);
      dp(ctx, c2.x, c2.y);
      snprintf(buf, sizeof(buf), "C2[%d] (%d/%d)", i, (int) c2.x, (int) c2.y);
      cairo_move_to(ctx, c2.x + 5, c2.y);
      cairo_show_text(ctx, buf);

      if (i > start)
      {
         cairo_save(ctx);
         COL_TLINE(ctx);
         cairo_set_line_width(ctx, 1);
         cairo_set_dash(ctx, dash, 2, 0);
         cairo_move_to(ctx, prev_p.x, prev_p.y);
         cairo_line_to(ctx, c1.x, c1.y);
         cairo_stroke(ctx);
         cairo_restore(ctx);
         }
      prev_p = c2;
   }
   cairo_restore(ctx);
}

#endif

bspline_ctrl.c

/*! \file bspline_ctrl.c
 * This file contains the functions to calculate control points from a list of
 * points for drawing bezier curves.
 *
 * License: This is free software. Take it, use it, modify it!
 *
 *  @author Bernhard R. Fischer
 *  @version 2015/11/30
 *
 */

#include <cairo.h>
#include <math.h>

#include "bspline.h"

// This factor defines the "curviness". Play with it!
#define CURVE_F 0.25
// This defines the method of using isosceles triangles. Undefine it to see the
// method of equal distances.
#define ISOSCELES_TRIANGLE


/*! This function calculates the angle of line in respect to the coordinate
 * system.
 * @param g Pointer to a line.
 * @return Returns the angle in radians.
 */
double angle(const line_t *g)
{
   return atan2(g->B.y - g->A.y, g->B.x - g->A.x);
}


/*! This function calculates the control points. It takes two lines g and l as
 * arguments but it takes three lines into account for calculation. This is
 * line g (P0/P1), line h (P1/P2), and line l (P2/P3). The control points being
 * calculated are actually those for the middle line h, this is from P1 to P2.
 * Line g is the predecessor and line l the successor of line h.
 * @param g Pointer to first line.
 * @param l Pointer to third line (the second line is connecting g and l).
 * @param p1 Pointer to memory of first control point. This will receive the
 * coordinates.
 * @param p2 Pointer to memory of second control point.
 */
void control_points(const line_t *g, const line_t *l, point_t *p1, point_t *p2)
{
   line_t h;
   double f = CURVE_F;
   double lgt, a;

   // calculate length of line (P1/P2)
   lgt = sqrt(pow(g->B.x - l->A.x, 2) + pow(g->B.y - l->A.y, 2));

#ifdef ISOSCELES_TRIANGLE
   // end point of 1st tangent
   h.B = l->A;
   // start point of tangent at same distance as end point along 'g'
   h.A.x = g->B.x - lgt * cos(angle(g));
   h.A.y = g->B.y - lgt * sin(angle(g));
#else
   h.A = g->A;
   h.B = l->A;
#endif

   // angle of tangent
   a = angle(&h);
   // 1st control point on tangent at distance 'lgt * f'
   p1->x = g->B.x + lgt * cos(a) * f;
   p1->y = g->B.y + lgt * sin(a) * f;

#ifdef ISOSCELES_TRIANGLE
   // start point of 2nd tangent
   h.A = g->B;
   // end point of tangent at same distance as start point along 'l'
   h.B.x = l->A.x + lgt * cos(angle(l));
   h.B.y = l->A.y + lgt * sin(angle(l));
#else
   h.A = g->B;
   h.B = l->B;
#endif

   // angle of tangent
   a = angle(&h);
   // 2nd control point on tangent at distance 'lgt * f'
   p2->x = l->A.x - lgt * cos(a) * f;
   p2->y = l->A.y - lgt * sin(a) * f;
}


void draw_curve(cairo_t *ctx, const point_t *pt, int cnt, int start)
{
   // Helping variables for lines.
   line_t g, l;
   // Variables for control points.
   point_t c1, c2;

#ifdef CONSTRUCTION
   // Draw direct lines between points.
   draw_lines(ctx, pt, cnt);
#endif

   // Draw bezier curve through all points.
   COL_CURVE(ctx);
   cairo_set_line_width(ctx, W_CURVE);
   cairo_move_to(ctx, pt[(start - 1 + cnt) % cnt].x, pt[(start - 1 + cnt) % cnt].y);
   for (int i = start; i < cnt; i++)
   {
      g.A = pt[(i + cnt - 2) % cnt];
      g.B = pt[(i + cnt - 1) % cnt];
      l.A = pt[(i + cnt + 0) % cnt];
      l.B = pt[(i + cnt + 1) % cnt];

      // Calculate controls points for points pt[i-1] and pt[i].
      control_points(&g, &l, &c1, &c2);

      // Handle special case if points are not connected in a loop.
      if (start && i == 1) c1 = g.B;
      if (start && i == cnt - 1) c2 = l.A;

      // Create Cairo curve path.
      cairo_curve_to(ctx, c1.x, c1.y, c2.x, c2.y, pt[i].x, pt[i].y);
   }
   // Actually draw curve.
   cairo_stroke(ctx);

#ifdef CONSTRUCTION
   // Draw construction lines.
   draw_construction(ctx, pt, cnt, start);
#endif
}


bspline.h

#ifndef BSPLINE_H
#define BSPLINE_H

#include <cairo.h>


#define COL_BG(x) cairo_set_source_rgb(x, 1, 1, 1)
#define COL_CURVE(x) cairo_set_source_rgb(x, 0, 0, 1)
#define COL_LINE(x) cairo_set_source_rgb(ctx, 0, 0, 0)
#define COL_C1(x) cairo_set_source_rgb(ctx, 1, 0.2, 0.2)
#define COL_C2(x) cairo_set_source_rgb(ctx, 0.2, 0.8, 0.2)
#define COL_TLINE(x) cairo_set_source_rgb(ctx, 1, 0.2, 0.2)
#define COL_HLINE(x) cairo_set_source_rgb(ctx, 0, 0, 0)

#define W_CURVE 5
#define W_LINE 2
#define F_SIZE 10
#define R 3

typedef struct point
{
   double x, y;
} point_t;

typedef struct line
{
   point_t A, B;
} line_t;


#ifdef CONSTRUCTION
void draw_lines(cairo_t *, const point_t *, int );
void draw_construction(cairo_t *, const point_t *, int , int );
#endif

double angle(const line_t *);
void control_points(const line_t *, const line_t *, point_t *, point_t *);
void draw_curve(cairo_t *, const point_t *, int , int );

#endif

#117 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » cairo 2D 画图引擎生成b样条曲线 (b-spline curve) » 2020-01-03 11:31:27

里面有 Makefile 可以直接用 make 编译,

也可以用以下命令行编译:

gcc -o bspline  bspline.c bspline_constr.c bspline_ctrl.c  `pkg-config cairo --cflags --libs` -lm

运行:

./bspline

#119 Re: 计算机图形/GUI/RTOS/FileSystem/OpenGL/DirectX/SDL2 » 2d绘图引擎 Cairo 在 SDL@Ubuntu 运行成功 » 2020-01-03 10:52:13

试了一下, 可以跑, 效果一样,寥寥几行代码搞定了很漂亮的界面。

#120 Re: 全志 SOC » 荔枝派Nano 自己编译内核 启动时 卡到Waiting for root device /dev/mtdblock3... » 2020-01-03 10:03:05

nufing 说:

另外我的, ubuntu 版本是  64位的  18版本,不知道有没有影响

这个问题 和 ubuntu 版本一点关系都没有

#121 Re: 全志 SOC » 荔枝派Nano 自己编译内核 启动时 卡到Waiting for root device /dev/mtdblock3... » 2020-01-03 09:51:59

.config 里面选了一些不需要的组件,比如 Qt, ffmpeg, mplayer 等吧?

#122 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 分享一个2011年在魅族M9上跑的一个framebuffer plasma 测试程序 » 2020-01-03 09:51:06

gcc 静态链接, 然后用 adb push 到一个有权限的目录, 再执行这个命令.

昨天翻邮箱, 刚好看到就传上来了。

忘记当时有没有root手机了, 按理来说 /dev/fb0 是不能执行写操作的。

#123 Re: 全志 SOC » 烧写usb报错 » 2020-01-02 11:00:44

飞线, 或者换根原装的usb线。

#126 Re: 全志 SOC » 荔枝派Nano 自己编译内核 启动时 卡到Waiting for root device /dev/mtdblock3... » 2020-01-02 10:09:35

nufing 说:

我也遇到一样的问题,是哪个步骤不对?

贴log看下.

#129 Re: 全志 SOC » 请教F1C100s的保留内存如何使用 » 2020-01-02 09:21:31

https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt

***保留的内存区域***

预留内存被指定为/ reserved-memory节点下的一个节点。
操作系统应从正常使用中排除保留的内存
一个人可以创建描述特定保留的子节点(不包括在
正常使用)存储区域。通常将此类存储区设计用于
各种设备驱动程序的特殊用法。

可以将每个存储区的参数编码到设备树中

应该是在设备书中修改这个值, 这些内存可能是编解码器用的吧?

#131 Re: DIY/综合/Arduino/写字机/3D打印机/智能小车/平衡车/四轴飞行/MQTT/物联网 » 分享一个2011年在魅族M9上跑的一个framebuffer plasma 测试程序 » 2020-01-02 09:08:23

M9 直接写屏红绿蓝

编译指令:  arm-none-linux-gnueabi-gcc main.c -o test -static

#include <stdio.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>

#define screen_height 960
#define screen_width 640

int main(void)
{
    int devfb0;
    unsigned char * fb0;
    unsigned char * framebuff;
    int i, j;

    printf("starting... ... !n");
   
    devfb0 = open("/dev/fb0", O_RDWR);

    fb0 = (char *) mmap(0, 960*640*4, PROT_READ | PROT_WRITE, MAP_SHARED, devfb0, 0);
    if ( (int) fb0 == -1)
    {
        printf ("Error: failed to map framebuffer device to memory.\n");
        exit (2);
    }
    else
    {
        printf ("The framebuffer device was mapped to memory successfully.\n");
    }


    while(1)
    {
        framebuff = fb0;
        //printf("AAAAAA........3333..............\n");
        for (i = 0; i < screen_height; ++i)
        {
         
          for (j = 0; j < screen_width; ++j)
            {
     
              /* magic transformation: color index to RGB24 */
              *framebuff ++ = 0x00;        /* blue */
              *framebuff ++ = 0x00;        /* green */
              *framebuff ++ = 0xFF;        /* red */
              *framebuff ++ = 0xFF;        /* alpha */         
            }     
        }
    }
}

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn