rhysmorgan134 / react-carplay

MIT License
423 stars 65 forks source link

Not working on macOS #2

Closed sobrinho closed 2 years ago

sobrinho commented 2 years ago
Screen Shot 2021-11-16 at 23 38 14
rhysmorgan134 commented 2 years ago

was an issue with the usb library, version now locked to 7 which works with mac

sobrinho commented 2 years ago
Screen Shot 2022-03-15 at 17 30 24
npm run start-electron

I can hear the music but nothing is rendered.

rhysmorgan134 commented 2 years ago

was this a fresh clone and npm install? Also is the dongle a genuine one? Your logs have a couple of strange lines in there, see below for a log until video from my working set up

  dpi: 240,
  nightMode: 0,
  hand: 0,
  boxName: 'nodePlay',
  width: 800,
  height: 480,
  fps: 60
}
directory found
device connected and ready
starting projection
parsing type:  8  for length:  4 <Buffer aa 55 aa 55 04 00 00 00 08 00 00 00 f7 ff ff ff>
parsing 8 <Buffer e8 03 00 00>
Carplay message:  Support Wifi
unkown type:  13  with data::  <Buffer aa 55 aa 55 0d 00 00 00 0d 00 00 00 f2 ff ff ff>
unkown type:  14  with data::  <Buffer aa 55 aa 55 0d 00 00 00 0e 00 00 00 f1 ff ff ff>
unkown type:  18  with data::  <Buffer aa 55 aa 55 76 00 00 00 12 00 00 00 ed ff ff ff>
parsing type:  8  for length:  4 <Buffer aa 55 aa 55 04 00 00 00 08 00 00 00 f7 ff ff ff>
parsing 8 <Buffer e9 03 00 00>
Carplay message:  undefined
test message i
parsing type:  8  for length:  4 <Buffer aa 55 aa 55 04 00 00 00 08 00 00 00 f7 ff ff ff>
parsing 8 <Buffer 07 00 00 00>
Carplay message:  undefined
test message 
parsing type:  204  for length:  32 <Buffer aa 55 aa 55 20 00 00 00 cc 00 00 00 33 ff ff ff>
parsing 204 <Buffer 32 30 32 31 2e 30 32 2e 32 33 2e 31 37 35 38 43 41 59 00 00 00 00 00 00 00 00 00 00 00 00 00 00>
version number:  2021.02.23.1758CAY
unkown type:  25  with data::  <Buffer aa 55 aa 55 77 00 00 00 19 00 00 00 e6 ff ff ff>
unkown type:  1  with data::  <Buffer aa 55 aa 55 1c 00 00 00 01 00 00 00 fe ff ff ff>
Socket connected. sending data...
parsing type:  8  for length:  4 <Buffer aa 55 aa 55 04 00 00 00 08 00 00 00 f7 ff ff ff>
parsing 8 <Buffer f2 03 00 00>
Carplay message:  undefined
test message r
non-audio found
unknown type:  11 false false
non-audio found
unknown type:  11 false false
non-audio found
unknown type:  11 false false
parsing type:  2  for length:  4 <Buffer aa 55 aa 55 04 00 00 00 02 00 00 00 fd ff ff ff>
parsing 2 <Buffer 03 00 00 00>
no wifi avail, phone type:  3
data received { status: true }
parsing type:  8  for length:  24 <Buffer aa 55 aa 55 18 00 00 00 08 00 00 00 f7 ff ff ff>
parsing 8 <Buffer 04 00 00 00 41 43 3a 34 39 3a 44 42 3a 32 44 3a 46 39 3a 31 30 ea df 71>
Carplay message:  undefined
test message AC:49:DB:2D:F9:10j_q
non-audio found
unknown type:  10 false false
non-audio found
unknown type:  1 false false
unkown type:  3  with data::  <Buffer aa 55 aa 55 04 00 00 00 03 00 00 00 fc ff ff ff>
non-audio found
unknown type:  10 false false
rhysmorgan134 commented 2 years ago

can you upload the terminal ouput up until you hear audio?

sobrinho commented 2 years ago
> carplay@1.0.1 start-electron                                                                                                                                                    
> export ELECTRON_START_URL=http://localhost:3000 && electron . --no-sandbox

spawning carplay {
  dpi: 240,                                                                                                                                                                       
  nightMode: 0,                                                                                                                                                                   
  hand: 0,                         
  boxName: 'nodePlay',                                                                   
  width: 800,                                                                            
  height: 480, 
  fps: 60                    
}              
directory found              
device not connected
(node:28821) electron: Failed to load URL: http://localhost:3000/ with error: ERR_CONNECTION_REFUSED
(Use `Electron --trace-warnings ...` to show where the warning was created)                                                                                                       
^C/Users/sobrinho/Developer/landrover/react-carplay/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron exited with signal SIGINT

When I start without the device, even if I plug it after the software boot, it does nothing.

sobrinho commented 2 years ago
                                                                                                                                                                                  > carplay@1.0.1 start-electron                                                                                                                                                    
> export ELECTRON_START_URL=http://localhost:3000 && electron . --no-sandbox                                                                                                                                                  
spawning carplay {                                                                                                                                                                  dpi: 240,                  
  nightMode: 0,                                                                                                                                                                     hand: 0,                                                                               
  boxName: 'nodePlay',                                                                                                                                                              width: 800,                                                                            
  height: 480,                                                                                                                                                                      fps: 60                                                                                
}                                                                                                                                                                                 directory found                           
device connected and ready                                                                                                                                                        unkown type:  1  with data::  <Buffer aa 55 aa 55 00 00 00 00 01 00 00 00 fe ff ff ff>
(node:28861) electron: Failed to load URL: http://localhost:3000/ with error: ERR_CONNECTION_REFUSED                                                                              (Use `Electron --trace-warnings ...` to show where the warning was created)              
starting projection                                                                                                                                                               parsing type:  8  for length:  4 <Buffer aa 55 aa 55 04 00 00 00 08 00 00 00 f7 ff ff ff> 
parsing 8 <Buffer 07 00 00 00>                                                                                                                                                    Carplay message:  undefined                                                              
test message                                                                                                                                                                      parsing type:  204  for length:  32 <Buffer aa 55 aa 55 20 00 00 00 cc 00 00 00 33 ff ff ff>
parsing 204 <Buffer 32 30 32 31 2e 30 38 2e 33 30 2e 31 38 32 31 43 41 59 00 00 00 00 00 00 00 00 00 00 00 00 00 00>                                                              version number:  2021.08.30.1821CAY                                                                                                                                               
unkown type:  25  with data::  <Buffer aa 55 aa 55 85 00 00 00 19 00 00 00 e6 ff ff ff>                                                                                           unkown type:  1  with data::  <Buffer aa 55 aa 55 1c 00 00 00 01 00 00 00 fe ff ff ff>
non-audio found                                                                                                                                                                   unknown type:  11 false false                                                            
non-audio found                                                                                                                                                                   unknown type:  11 false false    
non-audio found                                                                                                                                                                   
unknown type:  11 false false                                                                                                                                                     
parsing type:  2  for length:  4 <Buffer aa 55 aa 55 04 00 00 00 02 00 00 00 fd ff ff ff>                                                                                         
parsing 2 <Buffer 03 00 00 00>
no wifi avail, phone type:  3
data received { status: true }                                                                                                                                            [36/129]
parsing type:  8  for length:  24 <Buffer aa 55 aa 55 18 00 00 00 08 00 00 00 f7 ff ff ff>
parsing 8 <Buffer 04 00 00 00 44 30 3a 44 32 3a 42 30 3a 31 34 3a 34 38 3a 33 43 00 00 00>
Carplay message:  undefined
test message D0:D2:B0:14:48:3C
non-audio found
unknown type:  10 false false
non-audio found
unknown type:  1 false false
unkown type:  3  with data::  <Buffer aa 55 aa 55 04 00 00 00 03 00 00 00 fc ff ff ff>
non-audio found
unknown type:  10 false false
non-audio found
unknown type:  10 false false
non-audio found
unknown type:  10 false false
non-audio found
unknown type:  10 false false
non-audio found
unknown type:  10 false false
non-audio found
unknown type:  10 false false
non-audio found
unknown type:  10 false false

If I start with the dongle plugged, it works but no video at all in the electron window.

sobrinho commented 2 years ago

Dongle is the Autokit wired one. IMG_7156

sobrinho commented 2 years ago

And it is a fresh clone therefore with a fresh node_modules.

sobrinho commented 2 years ago

I had to disable the kiosk mode otherwise I can't use my computer at all until I close the window, can't CMD+TAB or anything, but this might be expected.

And also, even if I'm in another window, the keybindings are attached to electron, so I can't type at all in other apps because the keys are intercepted by the electron app.

rhysmorgan134 commented 2 years ago

Ah ok I think I see what's happening, you need two terminals open in the npm directory, on one type

npm run start

Let that finish, then on the other type

npm run start-electron

In a dev enviroment the react server is seperate to the electron server, let me know how that goes.

The keybindings is as expected, electron uses global shortcuts, so takes hold of the keypresses, main reason is that the electron app is designed to be built upon, to display other data (see my jag videos) in this case you still want key presses to register for skip songs etc. An easy way around it is to just comment out these lines

https://github.com/rhysmorgan134/react-carplay/blob/418dd5c388dec3f376628236de3d19061f43cddb/electron/main.js#L87-L91

rhysmorgan134 commented 2 years ago

Also worth noting, in the latest jmuxer version, when the main window loses focus the "video" stops until you go back to it, this is something you will run into when not in kiosk mode, I also had a few issues on mac with it feeding the video feed at the correct framerate, its perfect on a pi, so would be interested to see how you get on, and whether it was just an issue on my mac.

sobrinho commented 2 years ago

Gotcha, now it is working, thanks! <3