GithubHelp home page GithubHelp logo

harrylepotter / carplay-receiver Goto Github PK

View Code? Open in Web Editor NEW
249.0 249.0 34.0 38 KB

Linux carplay receiver - intended for non-touchscreen OEM projects

License: MIT License

Python 99.89% Shell 0.11%

carplay-receiver's People

Contributors

electric-monk avatar harrylepotter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

carplay-receiver's Issues

Running on Crankshaft OS?

I'm trying to run this app on a Raspberry Pi running Crankshaft (which natively supports Android Auto)- nothing opens (though the iPhone indicates Carplay is active), and the console prints an error that "XDG_RUNTIME_DIR" is not set. I have to run it from a service if that helps. Is there a different video driver that I need?

Let me know if you need any further information, I can test again tomorrow.

Video / Performance issue

In my tests, I have very delayed responses after key presses (up to 5s). I suspect the video encoding demands a lot of system resources. So I changed the video frame rate in Decoder.py from 60 to 25fps. However, mpv forces 60fps at startup, no matter what I enter.
I get the following system messages before the video window opens.

exception: 'AudioData' object has no attribute 'data'
[warn] lavf: This format is marked by FFmpeg as having no timestamps!
[warn] lavf: FFmpeg will likely make up its own broken timestamps. For
[warn] lavf: video streams you can correct this with:
[warn] lavf: --no-correct-pts --fps=VALUE
[warn] lavf: with VALUE being the real framerate of the stream. You can
[warn] lavf: expect seeking and buffering estimation to be generally
[warn] lavf: broken as well.
[info] cplayer: (+) Video --vid=1 (h264 800x600 25.000fps)
[warn] vo/gpu/opengl: Suspected software renderer or indirect context.
libEGL warning: DRI2: failed to authenticate
[warn] vo/gpu/opengl: Suspected software renderer or indirect context.
[warn] vo/gpu/opengl: Suspected software renderer or indirect context.
error: XDG_RUNTIME_DIR not set in the environment.
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
[error] vo/vdpau: Error when calling vdp_device_create_x11: 1
[error] vo/xv: No Xvideo support found.
[info] vo/sdl: Using opengl
[info] vd: FPS forced to 60.000.
[info] vd: Use --no-correct-pts to force FPS based timing.
[warn] vd: No video PTS! Making something up. Using 60.000000 FPS.
[info] cplayer: VO: [sdl] 800x600 yuv420p
[warn] vd: No video PTS! Making something up. Using 60.000000 FPS.
[warn] vd: Ignoring further missing PTS warnings.

Carplay idVendor=05ac, idProduct=12a8, bcdDevice= 7.01

I have a carplay dongle that emulate apple carplay protocol

[560893.204152] usb 1-1: new high-speed USB device number 37 using xhci_hcd
[560893.354699] usb 1-1: New USB device found, idVendor=05ac, idProduct=12a8, bcdDevice= 7.01
[560893.354715] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[560893.354721] usb 1-1: Product: iPhone
[560893.354725] usb 1-1: Manufacturer: Apple Inc.
[560893.354729] usb 1-1: SerialNumber: 10008030001D29512279802E

Can this repository help me show a picture from it?

New carlinkit hardware

New carelinkit has product id 0x1521 rather than 0x1520. Should that still work ? I do not seem to get a stream ?
Works over usb but not via wifi. Is that intended ?

support touch/mouse gestures

Users are looking for a means of supporting mouse/touch events using the app. I've been looking into how this is potentially communicated using python-mpv, and whether this arrives in python-button-press

mirror autokit.apk

Hey, started fiddling with some carplay stuff, just trying to get this code up and running, the autokit apk (from carlinkkit) seems to download agonizingly slowly. Do you think mirroring it (either in this repo, or elsewhere) could be a decent idea?

Decompiled sources

Hello, @harrylepotter
It's nice to see continuation of electric-monk/pycarplay (which is great I think, by the way). Good work ๐Ÿ‘

I've encountered this Gist, and I wonder where this come from? I've only found "decompilable" versions without wireless connection, probably older ones.
This one helped me with something (as I work on a node.js version of this receiver as a personal side-project), I wanted to thank you for sharing it. Maybe I could help with something as well, as I've got a bit familiar with this protocol, and took different approach with video/audio output streaming.

Audio issue

Hey! Really cool work, I am trying to fiddle around with the siri functionality but I seem to be getting no audio with your current setup. Im getting an exception "exception: 'AudioData' object has no attribute 'data'"

Any ideas there?!

MPV stream won't start

Hi,

I've been trying to run this program and play CarPlay on my PC. The connection with the iPhone works and CarPlay starts on the iPhone. Then the program says it starts the carplay_video stream, however the mpv player is never opened. I've attached the output log, with mpv Debug output, hopefully someone can see if I'm doing anything wrong?

Something that I noticed was that it says:

[v] stream_callback: Opening python://carplay_video

However it never says that it is done opening. What I've seen from example MPV programs, is that they do say when it is done opening.

Thanks!

sudo python3 carplay.py

/usr/lib/python3.8/subprocess.py:842: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
self.stdin = io.open(p2cwrite, 'wb', bufsize)

[debug] ytdl_hook: reading options for ytdl_hook
[debug] ytdl_hook: script-opts/ytdl_hook.conf not found.
[debug] ytdl_hook: lua-settings/ytdl_hook.conf not found.
[debug] stats: loading @stats.lua
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_5653b097f8c3f65d", "LEFT script-binding py_event_handler/py_kb_5653b097f8c3f65d", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_5653b097f8c3f65d", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_4835332dd15bae0b", "RIGHT script-binding py_event_handler/py_kb_4835332dd15bae0b", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_4835332dd15bae0b", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_240c8d2c2fa09409", "ENTER script-binding py_event_handler/py_kb_240c8d2c2fa09409", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_240c8d2c2fa09409", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_745d14f1356f3dfb", "ESC script-binding py_event_handler/py_kb_745d14f1356f3dfb", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_745d14f1356f3dfb", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_863d6eed6c9446eb", "SPACE script-binding py_event_handler/py_kb_863d6eed6c9446eb", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_863d6eed6c9446eb", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_c3ca507e67bfcb59", "s script-binding py_event_handler/py_kb_c3ca507e67bfcb59", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_c3ca507e67bfcb59", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_f3aba4965ebf600d", "p script-binding py_event_handler/py_kb_f3aba4965ebf600d", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_f3aba4965ebf600d", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_1262822956fa7e62", "e script-binding py_event_handler/py_kb_1262822956fa7e62", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_1262822956fa7e62", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_471042011439151c", "r script-binding py_event_handler/py_kb_471042011439151c", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_471042011439151c", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_9165cf8b3e586467", "h script-binding py_event_handler/py_kb_9165cf8b3e586467", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_9165cf8b3e586467", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_60255d58946569aa", "f script-binding py_event_handler/py_kb_60255d58946569aa", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_60255d58946569aa", "allow-hide-cursor+allow-vo-dragging"]
[debug] stats: reading options for stats
[debug] stats: script-opts/stats.conf not found.
[debug] stats: lua-settings/stats.conf not found.
[debug] cplayer: Run command: define-section, flags=64, args=["input_stats", "i script-binding stats/display-stats\nI script-binding stats/display-stats-toggle\n", "default"]
[debug] cplayer: Run command: enable-section, flags=64, args=["input_stats", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["input_forced_stats", "", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["input_forced_stats", "allow-hide-cursor+allow-vo-dragging"]
[v] cplayer: Done loading scripts.
[v] osd/libass: Shaper: FriBidi 0.19.7 (SIMPLE) HarfBuzz-ng 2.6.4 (COMPLEX)
[v] osd/libass: Setting up fonts...
[v] osd/libass: Using font provider fontconfig
[v] osd/libass: Done.
[debug] cplayer: Run command: define-section, flags=64, args=["input_console", "", "default"]
[debug] cplayer: Run command: enable-section, flags=64, args=["input_console", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["input_forced_console", "", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["input_forced_console", "allow-hide-cursor+allow-vo-dragging"]
Found USB device...
Connected!
Decoder: stop
[debug] main: Exiting...
AudioDecoder: stop
/usr/lib/python3.8/subprocess.py:842: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
self.stdin = io.open(p2cwrite, 'wb', bufsize)
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_5653b097f8c3f65d", "LEFT script-binding py_event_handler/py_kb_5653b097f8c3f65d", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_5653b097f8c3f65d", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_4835332dd15bae0b", "RIGHT script-binding py_event_handler/py_kb_4835332dd15bae0b", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_4835332dd15bae0b", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_240c8d2c2fa09409", "ENTER script-binding py_event_handler/py_kb_240c8d2c2fa09409", "force"]
[v] cplayer: Done loading scripts.
[v] osd/libass: Shaper: FriBidi 0.19.7 (SIMPLE) HarfBuzz-ng 2.6.4 (COMPLEX)
[v] osd/libass: Setting up fonts...
[v] osd/libass: Using font provider fontconfig
[v] osd/libass: Done.
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_240c8d2c2fa09409", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["input_console", "", "default"]
[debug] cplayer: Run command: enable-section, flags=64, args=["input_console", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["input_forced_console", "", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["input_forced_console", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_745d14f1356f3dfb", "ESC script-binding py_event_handler/py_kb_745d14f1356f3dfb", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_745d14f1356f3dfb", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_863d6eed6c9446eb", "SPACE script-binding py_event_handler/py_kb_863d6eed6c9446eb", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_863d6eed6c9446eb", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_c3ca507e67bfcb59", "s script-binding py_event_handler/py_kb_c3ca507e67bfcb59", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_c3ca507e67bfcb59", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_f3aba4965ebf600d", "p script-binding py_event_handler/py_kb_f3aba4965ebf600d", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_f3aba4965ebf600d", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_1262822956fa7e62", "e script-binding py_event_handler/py_kb_1262822956fa7e62", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_1262822956fa7e62", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_471042011439151c", "r script-binding py_event_handler/py_kb_471042011439151c", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_471042011439151c", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_9165cf8b3e586467", "h script-binding py_event_handler/py_kb_9165cf8b3e586467", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_9165cf8b3e586467", "allow-hide-cursor+allow-vo-dragging"]
[debug] cplayer: Run command: define-section, flags=64, args=["py_kb_60255d58946569aa", "f script-binding py_event_handler/py_kb_60255d58946569aa", "force"]
[debug] cplayer: Run command: enable-section, flags=64, args=["py_kb_60255d58946569aa", "allow-hide-cursor+allow-vo-dragging"]
Connection started!
[debug] cplayer: Run command: loadfile, flags=64, args=["python://carplay_video", "replace", ""]
[debug] global: config path: 'watch_later' -> '-'
[v] cplayer: Running hook: ytdl_hook/on_load
[v] ytdl_hook: ytdl:// hook
[v] ytdl_hook: not a ytdl:// url
[v] stream_callback: Opening python://carplay_video
[debug] stream_callback: resize stream to 131072 bytes
[debug] stream_callback: Stream opened successfully.
[v] demux: Trying demuxers for level=normal.
[debug] demux: Trying demuxer: disc (force-level: normal)
[debug] demux: Trying demuxer: edl (force-level: normal)
[debug] demux: Trying demuxer: cue (force-level: normal)
[debug] demux: Trying demuxer: rawaudio (force-level: normal)
[debug] demux: Trying demuxer: rawvideo (force-level: normal)
[debug] demux: Trying demuxer: mkv (force-level: normal)
[debug] demux: Trying demuxer: libarchive (force-level: normal)
[debug] demux: Trying demuxer: lavf (force-level: normal)
[v] lavf: Found 'h264' at score=51 size=2048.
[debug] ffmpeg/video: h264: Reinit context to 800x608, pix_fmt: yuvj420p

External controls

I am trying to use a multimedia remote control to control the CarPlay functions and will report back.
PS: the wireless connection works, but has significant delays. Any hints?

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.