viktorgino / headunit-desktop

HeadUnit Desktop is a car PC software built with Qt 5 and QML
https://github.com/viktorgino/headunit-desktop/wiki
GNU General Public License v3.0
284 stars 64 forks source link

Possible Video Codecs and Resolutions of AA #15

Closed mbt28 closed 5 years ago

mbt28 commented 6 years ago

Hello,

What are the possible video modes that we can have with AA? As far as I know it streams H264 video, is it possible to have in mp4 format too?

Thanks

viktorgino commented 6 years ago

Hi

AFAIK AA only streams H264, there are commands to change the video resolution (currently only 800x480 is supported, if you enable AA developer mode on the phone, then you can have 1280x720). If you want an MP4 stream, then you'd have to re-encode which is fairly straightforward with gstreamer.

mbt28 commented 6 years ago

Hi,

Thank you for your reply. I know that this interface is not open and you guys learning it with re-engineering.

I have few other questions: 1- As far as I see sound of applications are transferred as MTP, but how the notification sound of for example google maps transferred? 2- Why it is not possible to transfer mic and phone call data? 3- Do you know how much bandwidth the video and audio using? 4- What is the maximum resolution for audio?

Thanks

viktorgino commented 6 years ago

@mbt28 As far as I see sound of applications are transferred as MTP, but how the notification sound of for example google maps transferred? The core of AA is the Android Open Accessory Protocol, but AA has a network server built in, so packages can be transferred through a TCP connection as well. On top of that AA sends packages that are then decrypted if needed and assembled into one protocol message or video/audio frame depending on package type. The first few bytes of every packet contains some meta data about the packet and the rest of it is just data that gets processed depending on the meta data. The definition of the protocol messages can be found here. We handle the protocol messages using protobuf.

Why it is not possible to transfer mic and phone call data? It is possible, there is a bug that we need to get to the bottom of, the guys over at gartnera/headunit are looking into it, I haven't had the chance to look at this issue yet.

Do you know how much bandwidth the video and audio using? Good question. I haven't yet tested for this. Over USB we use 16384 byte package size, but when using the standard resolution I got an average of 8235 byte for packages. This is very likely higher when using 720p

What is the maximum resolution for audio? We currently use 48kHz for the music and 16kHz for the voice channels. I believe that's the maximum resolution.

mbt28 commented 6 years ago

Hi,

Thanks for the reply. Since the bmw connected drive can receive original file resolution that we have in Spotify that should be possible to receive highest possible resolution that the music file.

Do you mean headunits resampling or AA sends 16bit 48khz? Is audio pcm data or something encoded?

viktorgino commented 6 years ago

@mbt28 AA sends a raw audio stream, we use the following caps with gstreamer: music pipeline: "audio/x-raw, signed=true, endianness=1234, depth=16, width=16, rate=48000, channels=2, format=S16LE" voice pipeline: "audio/x-raw, signed=true, endianness=1234, depth=16, width=16, rate=16000, channels=1, format=S16LE"

mbt28 commented 6 years ago

Hi Viktor,

This audio stream comes trough Android Open Accessory protocol? How it is possible we have two different pcm streams?

GoldenSkull commented 6 years ago

Hi, I don't know much about Displays, so here's my question: If I'm using a display that got 1024x600 what will happen? Is it going to show just a part of the Image, or will it adapt itself? I'm currently looking on this Touchscreen, Because it is cheap and has a better resolution than the official one: https://www.amazon.de/Makibes-kapazitiver-Schnittstelle-Raspberry-verschiedene/dp/B015GPJM84/ref=sr_1_6?s=computers&ie=UTF8&qid=1518379073&sr=1-6&keywords=raspberry+pi+touchscreen Kind regards

viktorgino commented 6 years ago

Hi @GoldenSkull

It will adapt to the available are with keeping the aspect ratio and without any cropping. This means that there might be black boxes on the sides.