Couldn't start preview for DeviceAdapter adv7280 android jb imx6

cancel
Showing results for 
Search instead for 
Did you mean: 

Couldn't start preview for DeviceAdapter adv7280 android jb imx6

1,317 Views
alejandrogonzal
Contributor I

I managed to make adv7280 work on imx6Solo using android jb(4.3) with kernel  3.0.35.

I test the device with mxc_v4l2_tvin for interlaced and mxc_v4l2_overlay for progressive video and i can watch the video clearly but when i tried with the camera.apk it doesn´t work (neither in interlaced or progressive) it doesn´t show anything@.

When i use the camera apk the adv7180 device but fails on getting the frames i think.

It is strange because it recognizes the device, initialize it, detect the NTSC source and the 720 x 480 resolution but then fails with  "VIDIOC_STREAMON failed: Invalid argument" and says that "Couldn't start preview for DeviceAdapter", . Am i missing something that i have to modify on android HAL ??

This is the log from logcat:

I/FslCameraHAL( 2259): camera_device open: 0

I/FslCameraHAL( 2259): DeviceAdapter: Create uvc device

E/FslCameraHAL( 2259): can not open camera devpath:

E/FslCameraHAL( 2259): CameraHal: DeviceAdapter initialize failed

E/FslCameraHAL( 2259): CameraHal: DeviceAdapter initialize failed

I/FslCameraHAL( 2259): RequestManager release...

I/FslCameraHAL( 2259): RequestManager release end...

I/FslCameraHAL( 2259): RequestManager release...

I/FslCameraHAL( 2259): RequestManager release end...

I/FslCameraHAL( 4381): Face Back Camera is adv7180_decoder, orient is 90

I/FslCameraHAL( 4381): Face Front Camera is uvc,ov2656_camera, orient is 0

I/FslCameraHAL( 4381): Checking the camera adv7180_decoder

I/FslCameraHAL( 4381): Get sensor adv7180_decoder's dev path /dev/video0

I/FslCameraHAL( 4381): Camera ID 0: name adv7180_decoder, Facing 0, orientation 90, dev path /dev/video0

I/FslCameraHAL( 4381): Checking the camera uvc

I/FslCameraHAL( 4381): Checking the camera ov2656_camera

I/FslCameraHAL( 4381): camera_device open: 0

I/FslCameraHAL( 4381): DeviceAdapter: Create adv7180 device

I/FslCameraHAL( 4381): Get current mode: NTSC

I/FslCameraHAL( 4381): SupportedPictureSizes: 720 x 480

I/FslCameraHAL( 4381): SupportedPreviewSizes: 720 x 480

I/FslCameraHAL( 4381): FrameDuration is 33331760, 30000000000

I/FslCameraHAL( 4381): mMaxWidth:720, mMaxHeight:480

E/FslCameraHAL( 4381): cpu num 1

I/FslCameraHAL( 4381): DEBUG(CreateDefaultRequest): making template (1)

I/FslCameraHAL( 4381): DEBUG(CreateDefaultRequest): making template (3)

I/FslCameraHAL( 4381): RequestManager allocateStream...

I/FslCameraHAL( 4381): allocateStream preview stream, w:720, h:480, fmt:0x22

I/FslCameraHAL( 4381): actual format 0x103

I/FslCameraHAL( 4381): RequestManager allocateStream end...

I/FslCameraHAL( 4381): RequestManager registerStreamBuffers stream id:0

I/FslCameraHAL( 4381): registerBuffers total 5 buffer

I/FslCameraHAL( 4381): RequestManager registerStreamBuffers end...

I/FslCameraHAL( 4381): RequestManager allocateStream...

I/FslCameraHAL( 4381): allocateStream jpeg stream, w:720, h:480, fmt:0x21

I/FslCameraHAL( 4381): actual format 0x103

I/FslCameraHAL( 4381): RequestManager allocateStream end...

I/FslCameraHAL( 4381): RequestManager registerStreamBuffers stream id:3

I/FslCameraHAL( 4381): RequestManager registerStreamBuffers end...

I/FslCameraHAL( 4381): notify_request_queue_not_empty running

I/FslCameraHAL( 4381): dispatchRequest running

I/FslCameraHAL( 4381): handleRequest running

I/FslCameraHAL( 4381): PreviewStream configure running

I/FslCameraHAL( 4381): pixel format: 0x3231564e

I/FslCameraHAL( 4381): Width * Height 720 x 480 format 0x3231564e, fps: 30

E/FslCameraHAL( 4381): Unable to query buffer (Invalid argument)

I/FslCameraHAL( 4381): PreviewStream start running

I/FslCameraHAL( 4381): StreamAdapter start running

I/FslCameraHAL( 4381): stream thread received STREAM_START command

E/FslCameraHAL( 4381): VIDIOC_STREAMON failed: Invalid argument

E/FslCameraHAL( 4381): Couldn't start preview for DeviceAdapter

E/FslCameraHAL( 4381): error start stream -1

E/FslCameraHAL( 4381): handleRequest: tryRestartStreams failed

I/FslCameraHAL( 4381): handleStream: get invalid message

I/FslCameraHAL( 4381): handleStream: get invalid message

I/FslCameraHAL( 4381): handleStream: get invalid message

I/FslCameraHAL( 4381): handleStream: get invalid message

I/FslCameraHAL( 4381): handleStream: get invalid message

I/FslCameraHAL( 4381): handleStream: get invalid message

I/FslCameraHAL( 4381): handleStream: get invalid message

btw my init.rc goes like this :

setprop back_camera_name adv7180_decoder

setprop back_camera_orient 0

setprop front_camera_name uvc

setprop front_camera_orient 90

Labels (2)
4 Replies

249 Views
majuani
Contributor III

The same problem but with 7180, have you solve it?

https://community.nxp.com/thread/447701 

249 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Alejandro,

     In android4.3 BSP, there is no android camera HAL for adv7280_mipi, so you should add one for it. Following these steps, please !

(1) Referring to adv7180 HAL and create a HAL for adv7280

Android4.3 BSP supports adv7180 HAL, you can find camera HAL files in myandroid/hardware/imx/mx6/libcamera2/, in the path, use "grep -r -n 'adv7180' ,/ "to search those files including adv7180, then add adv7280_mipi in the file.

(2) loading adv7280_mipi drviers in linux kernel

adv7280 drivers is at path myandroid/kernel_imx/drivers/media/mxc/capture/adv7280_mipi_tvin.c, when you configure kernel, add it , please !

(3)Linux BSP file

On our sabreSD board, the chipi is supported, so you can refer to board-mx6q_sabreauto.c to initialize it.

(4)init.rc

if your camera name was defined as "adv7280_mipi_decoder", then :

setprop back_camera_name adv7280_mipi_decoder

setprop back_camera_orient 0

setprop front_camera_name uvc

setprop front_camera_orient 90

Try above steps, please !

Regards,

Weidong

249 Views
alejandrogonzal
Contributor I

Hi Weidong, i realized this at first so i got and adv7280 chip that works with a parallel 8 bit bus data output (the same as the adv7180) so i could treat it as an adv7180, the only thing i needed to change was the adv7180.c file , specifically the adv7180_hard_reset because some registers are different from the adv7180.              

Once i did this the device was recognized by the system and it worked with the test programs mxc_v4l2_tvin and mxc_v4l2_overlay so i guessed it should not have any problems on android HAL but it seems like it has , do yo have any idea on what could be wrong ?

249 Views
kurkinalexandr
Contributor III

Hi alejandrogonzalez

It is interesting to know about your progress. I met the same task. I need adv7280 support in Android. But I stuck on first stage - changing adv7180.c driver.

As I understand adv7280_mipi_tvin.c doesn`t have v4l functionality. So the closest driver for us is adv7180. It could be good to know your recomendations about changes in this driver.

0 Kudos