News for hackers. Stuff that matters.
Re:Android 14 adds support for using your smartphone as a we... by amar-laksh on Thursday September 21, 2023 @09:10PM (#37606643)
The scrcpy project is already great for this: https://github.com/Genymobile/scrcpy

Here's a little script for streaming through your camera on obs:

get-adb-devices-list() { adb devices | grep -v "List of devices attached" | grep -v "daemon" | grep -v "^$" | grep -c . }

echo "device count: $(get-adb-devices-list)" while [ "$(get-adb-devices-list)" -eq 0 ]; do echo "Waiting for the device..." sleep 0.5 done

IP_ADDRESS=$(sudo adb shell ip addr show wlan0 | grep "192.168.." | awk -F ' ' '{print $2}' | cut -d '/' -f1)

connect-adb-tcp () { sleep 1 echo "Connect to the device...$IP_ADDRESS" && \ adb tcpip 5555 && \ sudo adb connect "$IP_ADDRESS" }

connect-adb-tcp && \ v4l2-ctl --list-devices && \ scrcpy -e --v4l2-sink=/dev/video0 --lock-video-orientation=1 -n -N &> ./log & obs

Re:Android 14 adds support for using your smartphone as a we... by chenxiaolong on Thursday September 21, 2023 @09:54PM (#37606964)
scrcpy is awesome! Native support for streaming the camera directly (vs. streaming a screen capture of the camera app) is coming soon: https://github.com/Genymobile/scrcpy/pull/4213

For folks willing to build from source, I have an additional commit on top of the PR (linked in the comments) that enables support for Android's constrained high speed capture mode, allowing 120fps/240fps camera streaming. Not the most useful for meetings, but enables things like capturing high frame rate mixed reality VR footage. As far as I'm aware, there's no other Android webcam app, proprietary or open source, that can do anything above 60fps.

Re:Android 14 adds support for using your smartphone as a we... by imjonse on Friday September 22, 2023 @07:45AM (#37610728)
Do you know if there are any devices where the high FPS mode can be used not only for capture but also for the image analysis use case?
Re:Android 14 adds support for using your smartphone as a we... by chenxiaolong on Friday September 22, 2023 @11:04AM (#37613000)
I don't think this is possible, at least not directly. My understanding is that there's a special optimized path for CameraConstrainedHighSpeedCaptureSession recording to MediaCodec surfaces backed by a hardware encoder. If you capture to a different type of surface, the frame rate will likely drop to 60 or lower (assuming it's even allowed--I have not tested).

I'm not too familiar with image analysis, but if it's acceptable to work on lossy frames and to take a small hit to latency, you could record to a MediaCodec hardware encoder and then immediately send the output to another MediaCodec instance to decode it.

Re:Android 14 adds support for using your smartphone as a we... by 1vuio0pswjnm7 on Friday September 22, 2023 @01:09AM (#37608130)
Will scrcpy work on Alpine Linux.
Re:Android 14 adds support for using your smartphone as a we... by p4bl0 on Friday September 22, 2023 @02:44AM (#37608687)
Is there a way to do the reverse, i.e., seeing the computer screen on an Android device?

Specifically I would love a way to use my Android device as a remote controller for PDF presentation. For now I can do this with KDE Connect but the remote controller is blind, I have no way to see the current slide on the Android device, much less to use it to annotate the slides in live.

Does that exist?

Re:Android 14 adds support for using your smartphone as a we... by prmoustache on Friday September 22, 2023 @03:40AM (#37609096)
Use a vnc client on your android device and setup a virtual monitor on your desktop that is really a vnc server.

I know how to do that with Sway and swayvnc on wayland, as well as with xorg.

https://superuser.com/questions/1434779/using-a-tablet-as-a-...

https://www.reddit.com/r/swaywm/comments/k1zl41/thank_you_de...

This is particularly helpful to people using asahi linux and wanting to connect an external monitor. That can be done with something as simple as a raspberry pi.

EDIT: apparently this project help achieving the same thing on different OS but using webRTC and a browser:

https://github.com/pavlobu/deskreen

Re:Android 14 adds support for using your smartphone as a we... by Baader-Meinhof on Friday September 22, 2023 @03:40AM (#37609094)
Chrome Remote Desktop has worked for me in the past. Not very ergonomic on the phone, though.
Re:Android 14 adds support for using your smartphone as a we... by shultays on Friday September 22, 2023 @06:50AM (#37610387)
They updated it like a couple months ago I think. It is a bit better now
Re:Android 14 adds support for using your smartphone as a we... by parasti on Friday September 22, 2023 @03:18AM (#37608926)
This is a bit out of left field, but if you're a web developer you can use Browsersync to control a web page across multiple browsers (even on different devices). So really you "just" need a good PDF viewer on that web page.
Re:Android 14 adds support for using your smartphone as a we... by stavros on Friday September 22, 2023 @02:53AM (#37608746)
VNC client?
Re:Android 14 adds support for using your smartphone as a we... by johnchristopher on Friday September 22, 2023 @05:39AM (#37609922)
Google slides used to be able to do that (and office365 too if memory serves right) but this is definitely not self-hosted/managed.
Re:Android 14 adds support for using your smartphone as a we... by KoftaBob on Friday September 22, 2023 @05:54AM (#37610030)
I've had a great experience with AnyDesk.

You'd install the client on your computer:

Windows: https://anydesk.com/en/downloads/windows

Mac: https://anydesk.com/en/downloads/mac-os

and then on your phone:

Android: https://play.google.com/store/apps/details?id=com.anydesk.an...

iOS: https://itunes.apple.com/us/app/anydesk/id1176131273

Re:Android 14 adds support for using your smartphone as a we... by redog on Friday September 22, 2023 @06:34AM (#37610291)
There are many remote view/control apps but they're mostly built for remote support and screen sharing.

But I share your want of an quick and easy way to use my phone as a keyboard and mouse for a "remote" computer in the same room as me

This one was usable but not very polished IMO https://play.google.com/store/apps/details?id=com.panda_nood...

Re:Android 14 adds support for using your smartphone as a we... by nyadesu on Friday September 22, 2023 @08:32AM (#37611151)
Parsec could work
Re:Android 14 adds support for using your smartphone as a we... by eternityforest on Friday September 22, 2023 @04:15PM (#37617186)
I've been thinking a lot about this kind of use case, and I'm more and more convinced we just need better ways of handling web content on the LAN.

Like, no matter what, the UX will probably be meh just trying to mirror screens. Instead the presentation app could give you a QR code with a TLS cert in it, and you could scan it and get a secure connection to it's mobile optimized web remote UI.

We are really nowhere near using the full potential of all the devices and connectivity we have.

Re:Android 14 adds support for using your smartphone as a we... by aruggirello on Saturday September 23, 2023 @04:57AM (#37621676)
Re:Android 14 adds support for using your smartphone as a we... by sanroot99 on Saturday September 23, 2023 @07:30AM (#37622289)
Nomachine,xpra,x2go and vnc
Re:Android 14 adds support for using your smartphone as a we... by kwanbix on Friday September 22, 2023 @05:17AM (#37609767)
I love how nerdy we are here.

Imagine telling my wife:

Here's a little script for streaming through your camera on obs:

get-adb-devices-list() { adb devices | grep -v "List of devices attached" | grep -v "daemon" | grep -v "^$" | grep -c . }....

:)))))

Re:Android 14 adds support for using your smartphone as a we... by TeMPOraL on Friday September 22, 2023 @06:26AM (#37610245)
Obviously, should your wife be non-technical, you'd put that script in a file and tell her to double-click it. Or just set the whole thing up for her so it magically works.
Re:Android 14 adds support for using your smartphone as a we... by lou1306 on Monday September 25, 2023 @03:31AM (#37640593)
Astoundingly, there are non-technical households out there.
Re:Android 14 adds support for using your smartphone as a we... by mathfailure on Friday September 22, 2023 @11:27AM (#37613301)
Unfortunately, I've become a MacOS (ARM) user recently and start to notice such small misfortunes here and there like your solution being not applicable to MacOS.
Re:Android 14 adds support for using your smartphone as a we... by franga2000 on Saturday September 23, 2023 @02:51AM (#37621154)
Looks like you have quite the adb arsenal there, so maybe you have any suggestions for the two things missing from mine:

1. setting a static ADB/TCP port or automatically sending it to the PC (Android now changes it every time)

2. enabling ADB/TCP on mobile hotspot (Android complains "Please connect to WiFi")

Other than those two things, between scrcpy, KDE Connect and Waydroid, the Linux-Android integration is basically perfect and makes even the Applers jealous.

Re:Android 14 adds support for using your smartphone as a we... by sanroot99 on Saturday September 23, 2023 @07:29AM (#37622281)
You have to do adb tcpip for wireless adb once in a usb mode per boot, I actually just use port forwarding of all pc port to localhost using ssh, I have a bash script using nmap to find ip