GithubHelp home page GithubHelp logo

vlc can not run about sndcpy HOT 17 OPEN

rom1v avatar rom1v commented on July 24, 2024
vlc can not run

from sndcpy.

Comments (17)

rom1v avatar rom1v commented on July 24, 2024 2

Mybe I need to install VLC to the default path ?

Yes, or you can set an environment variable containing the full path to vlc.exe:
https://github.com/rom1v/sndcpy/blob/master/README.md#environment-variables

Default value is C:\Program Files\VideoLAN\VLC\vlc.exe:

if not defined VLC set VLC="C:\Program Files\VideoLAN\VLC\vlc.exe"

from sndcpy.

tz527129804 avatar tz527129804 commented on July 24, 2024 1

OK, so the Playback Capture API on your device does not capture the app sound. What app did you use when you captured these logs?

Oh!I just test again.
The yandex browser for android can play sound on PC.
youtube can play!
But Huawei's own browser can't.(Like the log above)
VLC for android can't.(Like the log above)
Wechat can't.(Like the log above)

I think the problem may be related to Huawei system.

from sndcpy.

slimsymphony avatar slimsymphony commented on July 24, 2024

yep, install vlc on your pc then work like charm~

from sndcpy.

tz527129804 avatar tz527129804 commented on July 24, 2024

Mybe I need to install VLC to the default path ?

Yes, or you can set an environment variable containing the full path to vlc.exe:
https://github.com/rom1v/sndcpy/blob/master/README.md#environment-variables

Default value is C:\Program Files\VideoLAN\VLC\vlc.exe:

if not defined VLC set VLC="C:\Program Files\VideoLAN\VLC\vlc.exe"

I try again,reinstall VLC to default path(C:\Program Files\VideoLAN\VLC\vlc.exe).
then I run the sndcpy.bat
Here is the display content:

Waiting for device...
Performing Streamed Install
Success
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.rom1v.sndcpy/.MainActivity }
Press Enter once audio capture is authorized on the device to start playing...
Playing audio...

I still can’t see VLC playing anything 😭
To be precise, vlc even did not appear!

from sndcpy.

rom1v avatar rom1v commented on July 24, 2024

To be precise, vlc even did not appear!

That's expected, it is started with -Idummy.

%VLC% -Idummy --demux rawaud --network-caching=50 --play-and-exit tcp://localhost:%SNDCPY_PORT%

But the audio should still be played.

from sndcpy.

tz527129804 avatar tz527129804 commented on July 24, 2024

To be precise, vlc even did not appear!

That's expected, it is started with -Idummy. But the audio should still be played.

%VLC% -Idummy --demux rawaud --network-caching=50 --play-and-exit tcp://localhost:%SNDCPY_PORT%

I can see TCP link established,but no audio played,maybe huawei‘s EMUI changes some system settings.
(Ps : miracast protocol can transfer audio with low delay.I have used it on win10 as an alternative)
Thank you for your answer !

from sndcpy.

rom1v avatar rom1v commented on July 24, 2024

I can see TCP link established,but no audio played

What application do you test? Some apps do not allow to capture their audio (this unfortunately includes Firefox and Chrome).

For example, try youtube or VLC for Android.

from sndcpy.

tz527129804 avatar tz527129804 commented on July 24, 2024

Unfortunately,still no sound

I can see TCP link established,but no audio played

What application do you test? Some apps do not allow to capture their audio (this unfortunately includes Firefox and Chrome).

For example, try youtube or VLC for Android.

Unfortunately,still no sound. l will try another phone in the future.

from sndcpy.

rom1v avatar rom1v commented on July 24, 2024

Try to remove -Idummy for there:

%VLC% -Idummy --demux rawaud --network-caching=50 --play-and-exit tcp://localhost:%SNDCPY_PORT%

As a consequence, it will open the VLC gui. Maybe it will give a hint about the problem.
For example, press Ctrl+m in the VLC window to open the messages dialog.

from sndcpy.

tz527129804 avatar tz527129804 commented on July 24, 2024

Try to remove -Idummy for there:

%VLC% -Idummy --demux rawaud --network-caching=50 --play-and-exit tcp://localhost:%SNDCPY_PORT%

As a consequence, it will open the VLC gui. Maybe it will give a hint about the problem.
For example, press Ctrl+m in the VLC window to open the messages dialog.

I can see VLC and timeline moving forward now,but no sound out from PC .
Ctrl+m No message log (whatever the detail level),but many thing can be seen in Module tree

from sndcpy.

SarthakAnil avatar SarthakAnil commented on July 24, 2024

main stream error: connection error: Connection refused
this is the error i get when i run ./sndcpy on my manjaro any idea what is happening tried removing -Idummy,can see VLC and timeline moving forward now,but no sound out from PC .
Ctrl+m No message log sound still coming from device

from sndcpy.

rom1v avatar rom1v commented on July 24, 2024

main stream error: connection error: Connection refused

I you get it once, it's expected (cf README).

but no sound out from PC

OK, so it seems several people have this problem.

Could you please build with these changes and run:

diff --git a/app/src/main/java/com/rom1v/sndcpy/RecordService.java b/app/src/main/java/com/rom1v/sndcpy/RecordService.java
index 8486332..f867724 100644
--- a/app/src/main/java/com/rom1v/sndcpy/RecordService.java
+++ b/app/src/main/java/com/rom1v/sndcpy/RecordService.java
@@ -155,6 +155,23 @@ public class RecordService extends Service {
         return builder.build();
     }
 
+    public static String buildPacketString(byte[] data, int offset, int len) {
+        int limit = Math.min(20, len);
+        StringBuilder builder = new StringBuilder();
+        builder.append('[').append(len).append(" bytes] ");
+        for (int i = 0; i < limit; ++i) {
+            if (i != 0) {
+                String sep = i % 4 == 0 ? "  " : " ";
+                builder.append(sep);
+            }
+            builder.append(String.format("%02X", data[offset + i] & 0xff));
+        }
+        if (limit < len) {
+            builder.append("  ... +").append(len - limit).append(" bytes");
+        }
+        return builder.toString();
+    }
+
     private void startRecording() {
         final AudioRecord recorder = createAudioRecord(mediaProjection);
 
@@ -169,6 +186,7 @@ public class RecordService extends Service {
                     byte[] buf = new byte[SAMPLE_RATE * CHANNELS * BUFFER_MS / 1000];
                     while (true) {
                         int r = recorder.read(buf, 0, buf.length);
+                        Log.i(TAG, buildPacketString(buf, 0, buf.length));
                         socket.getOutputStream().write(buf, 0, r);
                     }
                 } catch (IOException e) {

Then look at the output of adb logcat -s sndcpy.

from sndcpy.

tz527129804 avatar tz527129804 commented on July 24, 2024

main stream error: connection error: Connection refused

I you get it once, it's expected (cf README).

but no sound out from PC

OK, so it seems several people have this problem.

Could you please build with these changes and run:

diff --git a/app/src/main/java/com/rom1v/sndcpy/RecordService.java b/app/src/main/java/com/rom1v/sndcpy/RecordService.java
index 8486332..f867724 100644
--- a/app/src/main/java/com/rom1v/sndcpy/RecordService.java
+++ b/app/src/main/java/com/rom1v/sndcpy/RecordService.java
@@ -155,6 +155,23 @@ public class RecordService extends Service {
         return builder.build();
     }
 
+    public static String buildPacketString(byte[] data, int offset, int len) {
+        int limit = Math.min(20, len);
+        StringBuilder builder = new StringBuilder();
+        builder.append('[').append(len).append(" bytes] ");
+        for (int i = 0; i < limit; ++i) {
+            if (i != 0) {
+                String sep = i % 4 == 0 ? "  " : " ";
+                builder.append(sep);
+            }
+            builder.append(String.format("%02X", data[offset + i] & 0xff));
+        }
+        if (limit < len) {
+            builder.append("  ... +").append(len - limit).append(" bytes");
+        }
+        return builder.toString();
+    }
+
     private void startRecording() {
         final AudioRecord recorder = createAudioRecord(mediaProjection);
 
@@ -169,6 +186,7 @@ public class RecordService extends Service {
                     byte[] buf = new byte[SAMPLE_RATE * CHANNELS * BUFFER_MS / 1000];
                     while (true) {
                         int r = recorder.read(buf, 0, buf.length);
+                        Log.i(TAG, buildPacketString(buf, 0, buf.length));
                         socket.getOutputStream().write(buf, 0, r);
                     }
                 } catch (IOException e) {

Then look at the output of adb logcat -s sndcpy.

sorry,I'm not a programmer,so I don’t konw which file to change, and how to build....

from sndcpy.

tz527129804 avatar tz527129804 commented on July 24, 2024

Then look at the output of adb logcat -s sndcpy.

I did it with google !
here is the log:

$ adb logcat -s sndcpy
--------- beginning of crash
--------- beginning of system
--------- beginning of main
06-11 13:05:48.120 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.164 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.183 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.186 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.205 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.312 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.313 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.332 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.486 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.504 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.614 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.633 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.761 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.780 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.868 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.889 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.891 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.891 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:48.908 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:49.018 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes
06-11 13:05:49.037 30633 1942 I sndcpy : [1440 bytes] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... +1420 bytes

Keep repeating until I close the server.

from sndcpy.

rom1v avatar rom1v commented on July 24, 2024

OK, so the Playback Capture API on your device does not capture the app sound. What app did you use when you captured these logs?

from sndcpy.

tz527129804 avatar tz527129804 commented on July 24, 2024

OK, so the Playback Capture API on your device does not capture the app sound. What app did you use when you captured these logs?

I think huawei provides different api,and I just use youtube which can work.
Maybe you can test what differences between these apps. Good luck.😀

from sndcpy.

1235467 avatar 1235467 commented on July 24, 2024

Sound forwarding of Youtube Music and Youtube did work in my case.Testing on EMUI 10.1,a Huawei device.But Poweramp is not working.

from sndcpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.