Commit Graph

2317 Commits (5f3fb843f59b058b7c38b5f7b1a561befc64e706)
 

Author SHA1 Message Date
Romain Vimont 00534b0b2d Fix typo in FAQ 1 year ago
Yan 0ebb3df69c Fix debug build by adding compat.c to tests
Linking of tests that needed something from compat.c failed.

PR #3865 <https://github.com/Genymobile/scrcpy/pull/3865>

Signed-off-by: Romain Vimont <rom@rom1v.com>
1 year ago
Romain Vimont 21df2c240e Mention necessary reboot
After setting "USB debugging (security settings)", a reboot is
necessary.
1 year ago
Romain Vimont 2d3059e1ab Reference FAQ from HID/OTG documentation
Reference the FAQ section about "HID/OTG issues on Windows" from the
HID/OTG documentation.
1 year ago
Romain Vimont 2fff9b9edf Adapt FakeContext for Android 14
This fixes audio for Android 14 developer preview 2.

Fixes #3784 <https://github.com/Genymobile/scrcpy/issues/3784>

Suggested-by: Namelesswonder <Namelesswonder@users.noreply.github.com>
1 year ago
Romain Vimont 57f879d68a Adapt clipboard wrappers to Android 14
A new deviceId parameter has been added.

Fixes #3784 <https://github.com/Genymobile/scrcpy/issues/3784>
1 year ago
Romain Vimont 478aece68f Replace "bit-rate" with "bit rate" 1 year ago
NextDev65 55899c091e Fix typo in doc/audio.md
The documentation is about audio bit rate, not video bit rate.

PR #3839 <https://github.com/Genymobile/scrcpy/pull/3839>

Signed-off-by: Romain Vimont <rom@rom1v.com>
1 year ago
Romain Vimont 3626d90004 Use separate audio capture code for Android 11
The code to start audio capture is more complicated for Android 11
(launch a fake popup, wait, make several attempts, close the shell
package).

Use a distinct code path specific to Android 11.
1 year ago
Romain Vimont 02f4ff7534 Make 3 attempts to start AudioRecord
On Android 11, a fake popup must be briefly opened to make the system
think that the shell app is in the foreground so that audio may be
recorded.

Making the shell app foreground may take some time depending on the
device, so make 3 attempts, waiting 100ms before each.

Fixes #3796 <https://github.com/Genymobile/scrcpy/issues/3796>
1 year ago
Romain Vimont a3871130cc List available encoders on failure
When the creation of an encoder fails, log an explicit error message
with the list of available encoders.
1 year ago
sixg0000d 53cb5635cf Fix pause message
The pause terminates only once the Enter key is pressed, not any key.

PR #3826 <https://github.com/Genymobile/scrcpy/pull/3826>

Signed-off-by: Romain Vimont <rom@rom1v.com>
1 year ago
Romain Vimont d7841664f4 Simplify logic in setScreenPowerMode()
Refs <f2dee20a20 (r104417398)>

Suggested-by: brunoais <brunoaiss@gmail.com>
1 year ago
Romain Vimont d9a644df9c Clarify V4L2 feature in README
The previous formulation could suggest that the device camera could be
used as a webcam. This is not the case (yet?).
1 year ago
Romain Vimont 45717733a1 Document missing Opus encoder error
And how to solve it.
1 year ago
Romain Vimont 39544f34b4 Add --audio-output-buffer
On some systems, the SDL audio callback is not called frequently enough
(for example it requests 5ms of samples every 10ms), because the output
buffer is too small.

By default, we want to use a small value (5ms) to minimize latency and
buffer underrun, but if it does not work well, users need a way to
increase it.

Refs #3793 <https://github.com/Genymobile/scrcpy/issues/3793>
1 year ago
Romain Vimont 4755b97908 Fix bash auto-completion handling
Options having an argument impossible to auto-complete must be handled
separately.
1 year ago
Romain Vimont cba2501254 Add missing auto-completion for --audio-buffer 1 year ago
Romain Vimont 6ba99a62ff Split workarounds to fix audio on some devices
There were several workarounds applied in a single method. Some of them
are specific to Meizu phones, but cause issues on other devices.

Split the method to be able to only fill the app context for audio
capture without applying the Meizu workarounds.

Fixes #3801 <https://github.com/Genymobile/scrcpy/issues/3801>
1 year ago
Bernard Cafarelli d2b7315ba6 Fix linux desktop files validation
Follow quoting rules from:
<https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables>

PR #3817 <https://github.com/Genymobile/scrcpy/pull/3817>
Fixes #3633 <https://github.com/Genymobile/scrcpy/issues/3633>

Signed-off-by: Romain Vimont <rom@rom1v.com>
1 year ago
Bernard Cafarelli 6ad037ea04 Update Gentoo instructions
scrcpy is available directly in the distro, drop link to the overlay
(which only contains older versions).

PR #3816 <https://github.com/Genymobile/scrcpy/pull/3816>

Signed-off-by: Romain Vimont <rom@rom1v.com>
1 year ago
Romain Vimont 337d6c2fd3 Fail on empty AudioRecord read()
If read() returns 0, then there is no data. According to the
documentation, it happens if the buffer is not a direct buffer:
<https://developer.android.com/reference/android/media/AudioRecord#read(java.nio.ByteBuffer,%20int)>

Refs #3812 <https://github.com/Genymobile/scrcpy/issues/3812>
1 year ago
Romain Vimont 2eced46a37 Update broken link in documentation
The Android documentation has been updated.
1 year ago
Romain Vimont 1a80333747 Replace link to enable USB debugging in README
Link to a more relevant page in the official documentation to enable USB
debugging.
1 year ago
Romain Vimont fb61b779a6 Add references to prerequisites
Users sometimes only read the OS-specific instructions, they must be
aware of the prerequisites.
1 year ago
Romain Vimont 5899af6a2f Add blogpost link about scrcpy 2.0 1 year ago
Romain Vimont cbca79b95b Fix v4l2 sink
The codec id to write as codec parameters is the one from the v4l2
encoder, not from the decoder.

Regression introduced by be985b8242.

Fixes #3795 <https://github.com/Genymobile/scrcpy/issues/3795>
1 year ago
Romain Vimont 02586cf21f Fix build issue on FFmpeg < 5.1
An include was missing.

Fixes #3783 <https://github.com/Genymobile/scrcpy/issues/3783>
1 year ago
Romain Vimont 80a6fa7a01 Fix comparison warning
An int was compared with an unsigned:

    ../app/src/audio_player.c:290:27: warning: comparison of integers of
    different signs: 'int' and 'unsigned int' [-Wsign-compare]
                if (abs(diff) < ap->sample_rate / 1000) {
                    ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
1 year ago
Ruoyu Zhong 6b769675fa Fix an "expected expression" error
In C, a label can only be followed by a statement, not a declaration.
An error in `app/src/screen.c` violated this, and led to a build error
with an error message similar to the one below:

    ../app/src/screen.c:821:13: error: expected expression
                bool ok = sc_screen_init_size(screen);
                ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include/stdbool.h:15:14: note: expanded from macro 'bool'
    #define bool _Bool
                 ^
    ../app/src/screen.c:822:18: error: use of undeclared identifier 'ok'
                if (!ok) {
                     ^
    2 errors generated.

This could be fixed by introducing a new block (or compound statement;
as is already being done in the next `case`). That is a statement.

Fixes #3785 <https://github.com/Genymobile/scrcpy/issues/3785>
PR #3787 <https://github.com/Genymobile/scrcpy/pull/3787>

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
1 year ago
Romain Vimont e5aa2ce01f Fix broken link in Windows download page 1 year ago
Romain Vimont cbc638c6ba Fix broken link in shortcuts documentation 1 year ago
Romain Vimont abc1be4872 Update links to v2.0 1 year ago
Romain Vimont f1b2d6bbbb Bump version to 2.0 1 year ago
Romain Vimont 90926d40ad Merge branch 'master' into dev 1 year ago
Romain Vimont f12590ed08 Rework README and documentation
The README.md page is HUGE. Split it up.

Also document audio forwarding and improve installation instructions for
each platform and user documentation.

PR #3774 <https://github.com/Genymobile/scrcpy/pull/3774>
1 year ago
Romain Vimont 05a55e3687 Happy new year 2023! 1 year ago
Romain Vimont affda26bfa Document audio player
Add some high-level documentation on the audio player implementation.
1 year ago
Romain Vimont 0bf866fa8d Apply new compensation only if it changed
If the compensation is the same (typically when it is 0), do not reapply
it.
1 year ago
Romain Vimont 73727e7fdf Disable clock drift compensation for tiny values
For less than 1ms, the estimated drift is just noise.
1 year ago
Romain Vimont c22c87eded Fail on deprecated options
Suggest the video and audio specific options instead.
1 year ago
Romain Vimont 426dfbf21d Remove dead code about the deprecated -F option
The -F option was already removed.
1 year ago
Romain Vimont 5512777404 Remove deprecated option --render-expired-frames
This option did nothing since it was deprecated. Totally remove it.
1 year ago
Romain Vimont cc07f8dac4 Upgrade platform-tools (34.0.1) for Windows
Include the latest version of adb in Windows releases.
1 year ago
Romain Vimont f5bb9e576d Upgrade SDL (2.26.4) for Windows
Include the latest version of SDL in Windows releases.
1 year ago
Romain Vimont 2380879376 Remove unused IOException
IOException may not be thrown from this method.
1 year ago
Romain Vimont eca8766545 Compute buffering and compensation without lock
Once underflow has been read with a lock, the buffering and compensation
may be performed without shared variables.
1 year ago
Romain Vimont 0b8a5ca923 Do not read avg_buffering from the player thread
On buffer underflow, the average buffering must be updated, but it is
intended to be accessed only from the receiver thread.

Make the player and the receiver thread communicate the underflow via a
new field (ap->underflow).
1 year ago
Romain Vimont e06acc1ba2 Simplify bytebuf naming
Rename read_available to can_read and write_available to can_write.
This is more readable.
1 year ago
Romain Vimont 14f9d82fda Add audio sample ring-buffer
Add a thin wrapper around bytebuf to handle samples instead of bytes.
This simplifies the audio player, which mostly handles samples.
1 year ago