Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aarch64 version on linux #5904

Closed
1 task done
Tianming-Wu opened this issue Mar 5, 2025 · 8 comments
Closed
1 task done

aarch64 version on linux #5904

Tianming-Wu opened this issue Mar 5, 2025 · 8 comments

Comments

@Tianming-Wu
Copy link

Tianming-Wu commented Mar 5, 2025

  • I have checked that a similar issue does not already exist.

Feature request:
I saw that there is aarch64 version for mac, would there be one for linux?

Alternative:
Provide a build guide for linux aarch64 (Debian/Ubuntu, Raspian) for example.

@Tianming-Wu
Copy link
Author

I checked your instruction page, but the version in Ubuntu repo is still 1.25.

By the way, I encountered a severe delay (10~15s) after running for about 2 minutes, on my Raspberry Pi. But that's probably the version 1.25, so I don't think I should open an Issue for it, and the newest version works fine on a Windows device (which I am NOT always available)

@rom1v
Copy link
Collaborator

rom1v commented Mar 5, 2025

The CI script should be adapted to add a build for ubuntu-22.04-arm: https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories

Closing as duplicate of #5800 #5899

I checked your instruction page, but the version in Ubuntu repo is still 1.25.

You must not installed from your package manager (obsolete version), but from ./install_release.sh: https://github.com/Genymobile/scrcpy/blob/master/doc/linux.md#from-an-install-script

I encountered a severe delay (10~15s) after running for about 2 minutes

Over USB?

Probably the decoder is not fast enough. Try reducing the resolution (-m 1024) and/or the encoding complexity (--video-codec-options=profile=1).

@rom1v rom1v closed this as completed Mar 5, 2025
@Tianming-Wu
Copy link
Author

@rom1v
What is CI script? I understand that this is a tag for the github virtual machine, and I think it's for Github Actions?

Do you mean that I should fork this repository, and modify .github/workflows/release.yml to build for ubuntu-22.04-arm?

I just learnt for github actions several day ago for my newst project.

@rom1v
Copy link
Collaborator

rom1v commented Mar 5, 2025

What is CI script?

The release is built by the CI (GitHub Actions). The script is: https://github.com/Genymobile/scrcpy/blob/master/.github/workflows/release.yml

Do you mean that I should fork this repository, and modify .github/workflows/release.yml to build for ubuntu-22.04-arm?

Yes, and if you do that, please submit a PR so that the next release will be built for arm too for Linux. 👍

@Tianming-Wu
Copy link
Author

@rom1v
I have completed the modification on workflow and I have successfully made it work.

Though as I downloaded the artifact and run it, here's the output:

tianming@tianming-desktop:~/Downloads/release-linux-aarch64/scrcpy-linux-aarch64-v3.1-test1c-major$ ./scrcpy --version
scrcpy 3.1 <https://github.com/Genymobile/scrcpy>

Dependencies (compiled / linked):
 - SDL: 2.30.10 / 2.30.10
 - libavcodec: 61.19.100 / 61.19.100
 - libavformat: 61.7.100 / 61.7.100
 - libavutil: 59.39.100 / 59.39.100
 - libavdevice: 61.3.100 / 61.3.100
 - libusb: - / 1.0.27
tianming@tianming-desktop:~/Downloads/release-linux-aarch64/scrcpy-linux-aarch64-v3.1-test1c-major$ ./scrcpy --new-display=1920x1080
scrcpy 3.1 <https://github.com/Genymobile/scrcpy>
/home/tianming/Downloads/release-linux-aarch64/scrcpy-linux-aarch64-v3.1-test1c-major/adb: 1: cannot create ���@xKy@8
       @%@@@��������������������I�I��d��d��d��@��wf��f��fx�P	��d��d��d@H@hjfh�fh�R�td��d��d��d��@�P�tdP�P�P7<FPZ`gl{�����������������",8BRXair{���������������� {���������������
                                                    !.4: Directory nonexistent
/home/tianming/Downloads/release-linux-aarch64/scrcpy-linux-aarch64-v3.1-test1c-major/adb: 19: Syntax error: "(" unexpected
ERROR: "adb start-server" returned with value 2
ERROR: Could not start adb server
/home/tianming/Downloads/release-linux-aarch64/scrcpy-linux-aarch64-v3.1-test1c-major/adb: 1: /home/tianming/Downloads/release-linux-aarch64/scrcpy-linux-aarch64-v3.1-test1c-major/adb: 1: jw������������,AI]qy�������������: not found@ERY_djr~���������������: not found

/home/tianming/Downloads/release-linux-aarch64/scrcpy-linux-aarch64-v3.1-test1c-major/adb: 1: -3A: not found
ERROR: Server connection failed
tianming@tianming-desktop:~/Downloads/release-linux-aarch64/scrcpy-linux-aarch64-v3.1-test1c-major$ ln -s /bin/adb adb
ln: 无法创建符号链接 'adb': 文件已存在
tianming@tianming-desktop:~/Downloads/release-linux-aarch64/scrcpy-linux-aarch64-v3.1-test1c-major$ adb --version
Android Debug Bridge version 1.0.41
Version 34.0.4-debian
Installed as /usr/lib/android-sdk/platform-tools/adb
Running on Linux 6.8.0-1018-raspi (aarch64)
tianming@tianming-desktop:~/Downloads/release-linux-aarch64/scrcpy-linux-aarch64-v3.1-test1c-major$ 

It looks like some kind of encoding problems, but I have no idea why that happens and I don't know how to fix it either.

modified workflow's here:
https://github.com/Tianming-Wu/scrcpy-arm-build/actions/runs/13682344034

@Tianming-Wu
Copy link
Author

@rom1v
I found that the problem is the adb packed inside isn't the right architecture. I copied /bin/adb (version below) to the directory and then it worked.

Android Debug Bridge version 1.0.41
Version 34.0.4-debian
Installed as /usr/lib/android-sdk/platform-tools/adb
Running on Linux 6.8.0-1018-raspi (aarch64)

I traced it back, and it seemed that adb was packed in by /app/deps/adb_linux.sh.

It just seemed that there isn't a version for arm64/aarch64. I searched on the Interent about the correct filename bu didn't find anything valid. (didn't even find a list for dl.google.com/android/repository)

I also tried to used aria2 to download it. I tried these names:

  • https://dl.google.com/android/repository/platform-tools_r35.0.2-linux-arm.zip (Given by github copilot)
  • https://dl.google.com/android/repository/platform-tools_r35.0.2-linux-aarch64.zip
  • https://dl.google.com/android/repository/platform-tools_r35.0.2-linux-arm64.zip

and none of them exists. I also tried 34.0.4 and latest, but still doesn't exists.

I still have no idea to solve this.

Is it ok to just open a pull request so you can solve it? All the packaging is completed and the workflow passed successfully.

Or please tell me how to modify that. You can find my edited version in https://github.com/Tianming-Wu/scrcpy-arm-build/app/deps/adb_linux.sh .

By the way I live in UTC+8, so I may reply late. Thank you very much for your assist.

@rom1v
Copy link
Collaborator

rom1v commented Mar 5, 2025

Took me a bit to figure out where to put it in my script,

Indeed, they do not distribute a prebuilt binary for Linux ARM (their releases are referenced by https://dl.google.com/android/repository/repository2-2.xml).

Is it ok to just open a pull request

We would need a script to build adb by ourselves (like we build SDL, FFmpeg and libusb).

Sure, open a PR. I will probably not have time to work on this, but at least part of the work is done.

@Tianming-Wu
Copy link
Author

@rom1v
I've opened a PR, you can check it. #5905

I searched that xml file, and yes there is only one linux file. Would you accept the temporarly solution:
(On Actions vm)copy /bin/adb to the directory? That would work without problems.

Sin that would modify the process, and I didn't fully understand how your packaging work, That edit should be done by you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants