rom1v / sndcpy

Android audio forwarding (scrcpy, but for audio)
MIT License
3.29k stars 301 forks source link

I can't play any sound. #20

Open soscaster opened 4 years ago

soscaster commented 4 years ago

Removed -Idummy, VLC opened but when Ctrl + M, it always appear the message : main error: connection error: Connection refused by peer main error: connection error: Connection refused by peer main error: connection error: Connection refused by peer main error: connection error: Connection refused by peer main error: connection error: Connection refused by peer main error: connection error: Connection refused by peer main error: connection error: Connection refused by peer main error: connection error: Connection refused by peer

My device is MI A2 Lite - Android 10 Stock ROM.

rom1v commented 4 years ago

Did you have the popup on the device and authorized to capture sound, before pressing Enter in the terminal?

soscaster commented 4 years ago

Did you have the popup on the device and authorized to capture sound, before pressing Enter in the terminal?

Yes I have. A huge popup and I authorized it. I can use the scrcpy but not the sndcpy.

yulose9 commented 4 years ago

Did you have the popup on the device and authorized to capture sound, before pressing Enter in the terminal?

Yes I have. A huge popup and I authorized it. I can use the scrcpy but not the sndcpy.

We do have the same problem I've tried running scrcpy and load the bat file of sndcpy. It did install and app and asked for permission but still didn't play any audio I tried updating my VLC to latest version and still doesn't work

My device is Mi9T Pro running the latest MIUI 12 Global Stable

rom1v commented 4 years ago

What app do you use on the device? Some apps do not authorize to capture their audio: https://github.com/rom1v/sndcpy#apps-restrictions

CrescentKohana commented 4 years ago

Possibly same problem here (Android 10 / OnePlus 7). Tried with Windows 10 Pro 64bit and Arch Linux 5.7.8-arch1-1.

Connection is succesful and VLC (also tried mpv) does play something but no audio can be heard. I tried playing a video file (mp4) through Chrome, music through AIMP and the main menu of Fate/Grand Order game. No sound with any of these. I tried to record Fate normally just with a recording app, and that worked, so there are no restrictions in play here.

Also, I've tried the latest adb and the one which comes with the Windows binary.

rom1v commented 4 years ago

Does it work with the youtube app or VLC for Android?

rom1v commented 4 years ago

I tried to record Fate normally just with a recording app, and that worked

Does this recording app use the Android 10 capture API? Which app is it?

Maybe something to add here:

https://github.com/rom1v/sndcpy/blob/f0995ca4d0002ef288c74c70d4c0eb48354449d5/app/src/main/java/com/rom1v/sndcpy/RecordService.java#L136-L138

?

CrescentKohana commented 4 years ago

Does it work with the youtube app or VLC for Android?

Yes, I got it working with YouTube.

Does this recording app use the Android 10 capture API? Which app is it?

I'm using OxygenOS's internal recording app. Just tried a 3rd party app, AZ Screen Recorder, and it's not picking up any game audio. Probably should've tested that first.

CrescentKohana commented 4 years ago

Possibly add couple example apps to the README which are known to function (eg. YouTube), so people can quickly test that everything works?

Anyway, no problem with sndcpy itself 😅.

//Edit I'm guessing OnePlus (it seems Samsung and some Xiaomi phones have this as well) is using different methods to record the audio. Those are probably not available to app developers.

Probably this one here.