ossrs / srs

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
25.7k stars 5.38k forks source link

Support loongson, loongarch, 龙芯CPU' translates to English as: 'Support loongson, loongarch, Loongson CPU #2689

Closed winlinvip closed 2 years ago

winlinvip commented 3 years ago

LOONGARCH

The multimedia open-source project that Loongson has already adapted: Media

If you want to use Loongson servers for video cloud, you still need a streaming media server.

Build Loongarch SRS in Qemu

Loongson has a QEMU image that can be run on the local machine. Below are the steps to follow.

First, download the QEMU environment. For macOS, execute the following command. For other systems, refer to this link:

brew install qemu

Then, download the Loongson ISO image. It's still on the way, please wait...

LOONGSON 3A5000/3B5000

Loongson 3A5000/3B5000

The Loongson 3A5000/3B5000 is a general-purpose processor designed for personal computers, servers, and other information technology fields. It is based on the Loongson proprietary instruction set architecture (LoongArch®) and the LA464 microarchitecture, which further improves frequency, reduces power consumption, and optimizes performance. While maintaining pin compatibility with the Loongson 3A4000 processor, the frequency has been increased to 2.5GHz, power consumption has been reduced by over 30%, and performance has been improved by over 50%. The Loongson 3B5000, based on the Loongson 3A5000, supports multi-way interconnection.

image

ST for LOONGARCH

First, it is necessary to adapt ST to the Loongson CPU. SRS 5.0 already supports this, please refer to ST #24.

For the adapted code, please refer to the commit: https://github.com/ossrs/state-threads/commit/db4296960809af07c34f2a6e50a623f8d1b90f86

Build for LOONGARCH

Additional compilation options for some dependent libraries need to be adapted, mainly for SRTP and Opus. Please refer to the commit: https://github.com/ossrs/srs/commit/5b44cc6a17fa9078ae3f981e318f8f0d3ebb458f

TRANS_BY_GPT3

apt-getyou commented 3 years ago

Is there a planned cycle at the moment?

TRANS_BY_GPT3

yinshiyou commented 3 years ago

The LoongArch platform adaptation for SRS is now available. Users have several ways to obtain the Loongson platform for testing: 1) Apply for a free Loongson cloud host, with the recommendation to include the remark "3A5000 + required mapping ports": https://www.loongson.cn/loongsonCloud 2) Download QEMU or KVM virtual machines: Currently, on GitHub, you can also download virtual machines with the LoongArch architecture (uploaded by Loongson experts to their own repositories). The official version is on its way, so you won't have to wait too long, but for now, you can use option one.

TRANS_BY_GPT3

Dr-624 commented 2 years ago

Does the boss have any plans for future adaptation to Shenwei?

TRANS_BY_GPT3

Dr-624 commented 2 years ago

Currently, when reaching the step of 'make', it will report an error of undefined reference to '_st_md_cxt_save'. 1f4af33e061222f554d47ef31d15173

TRANS_BY_GPT3

yinshiyou commented 2 years ago

Refer to the implementation of other platforms in trunk/3rdparty/st-srs/md_linux.S and add the implementation for Shenwei.

TRANS_BY_GPT3

Dr-624 commented 2 years ago

Hello, I have received your email.

TRANS_BY_GPT3

winlinvip commented 2 years ago

龙芯mips64' translates to 'Loongson MIPS64'.

ST adaptation https://github.com/ossrs/srs/commit/1589858cb0be003946ca6637cb6ee4039071a62f openssl adaptation https://github.com/ossrs/srs/commit/14832b66eb69fe81a3eb4e9d3afa7f6f2ddfb451 https://github.com/ossrs/srs/commit/079ac107f0bf4358df2855ac350054c9c733d0db FFmpeg adaptation https://github.com/ossrs/srs/commit/1ab584b2ae06e9724e7d34aac89dec9d69f09fdc

TRANS_BY_GPT3

xiangleiren commented 1 year ago

Currently, when reaching the "make" step, it will report an "undefined reference to '_st_md_cxt_save'" error 1f4af33e061222f554d47ef31d15173

Have you solved it? I am also facing this problem.

TRANS_BY_GPT3

xiangleiren commented 1 year ago

Hello, there is a problem with compiling on sw_64. Can you please provide some solutions? Thank you. image

TRANS_BY_GPT3