Hifi_misc driver not working-xaf-dec-test Application Failed

I could not find /dev/hifi_misc file in the device
so while running application it get failed - xaf-fifo.c Line no 161 returns fail.
I have followed all the steps mentioned in the Hikey960-HiFi3 Android SDK Guide.pdf

@niruyadla Can you please look into this?

Hi
I have build android for Hikey960 successfully Now I am facing 2 issues .

  1. in the out folder cache.img is not generated
  2. I have integrated hifi xaf kernel driver and dsp firmware imge to the Android source tree
    and compiled and downloaded the image to device . Later compiled xaf -host application by using mm command and it generated binaries and I downloaded to the device by using adb
    when i test the xaf-dec-test binary its return 254 not woking then I checked
    log cat and found error is due to check failed in xf-fifo.c file line no 161 - problem related to
    /dev/hifi_misc this file is not opened .

Any body have idea about this ? Please guide me
/RR

[this thread reads a little funny now. Rajeesh has two very closely related topics so I have merged them]

With the latest AOSP by default xaf-dec-test binary will not work as hifi-driver is included with the latest kernel and it only included in kernel 4.9

So could you please build system.img with the below instructions
cd ${AOSP_DIR}
source ./build/envsetup.sh
lunch hikey960-userdebug
make TARGET_KERNEL_USE=4.9 -j32

and after this run
adb root
adb remount
adb push ${AOSP_ROOT_DIR}/device/linaro/hikey/hifi/host-apf/tools/dhifimesg
adb shell
cd /system/bin
then run ./xaf-dec-test /sdcard/Music/test.pcm
then run dhifimesg to get dsp logs

Thanks,
Niranjan

1 Like

Hi Niranjan

Thanks for your support .
It worked out . I got /dev/hifi_misc

But Android is not coming up on display . Android coming on display with Kernel 4.14 only .
But with kernel 4.14 hifi_misc driver is not coming .
So do I want to do any modification for this to get up android on Display ?
Another issue I tested .ogg file its runnning application and looks like hanging some where
then I checked dhifimesg and got some message as below

hikey960:/dev # dhifimesg
WARNING: linker: Warning: “/vendor/bin/dhifimesg” unused DT entry: DT_RPATH (type 0xf arg 0xff) (ignoring)
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������hikey960:/dev #

Also I checked logcat
it shows some error in xf-fifo.c +139 respose error
Could you please share your view on this problem ?

/Thanks
Rajeesh Rarankurissi

did you get the following warning during build?

device/linaro/hikey/hikey960/device-hikey960.mk:90: warning: TARGET_HISI_CODEC_VERSION () does not match exiting the build (1).
device/linaro/hikey/hikey960/device-hikey960.mk:91: warning: Please download new binaries here:
device/linaro/hikey/hikey960/device-hikey960.mk:92: warning: https://dl.google.com/dl/android/aosp/hisilicon-hikey960-OPR-3c243263.tgz 
device/linaro/hikey/hikey960/device-hikey960.mk:93: warning: And extract in the ANDROID_TOP_DIR

Did you try that ^^?

@niruyadla any idea if this warning is related?

after making images using make TARGET_KERNEL_USE=4.9 -j32 ,need to flash all images including boot.img,dt.img and system.img ,then you will get Android UI ,after this to confirm kernel 4.9 go to settings->about phone->Android version will show something like 4.9.xxx

fastboot flash boot out/target/product/hikey960/boot.img
fastboot flash dts out/target/product/hikey960/dt.img
fastboot flash system out/target/product/hikey960/system.img
fastboot flash vendor out/target/product/hikey960/vendor.img
fastboot flash cache out/target/product/hikey960/cache.img
fastboot flash userdata out/target/product/hikey960/userdata.img

Yes I got this warning . I followed as per the warning message . Downloaded ```
hisilicon-hikey960-OPR-3c243263.tgz and extracted.

Yes I flashed all images except cache image because this image is not generated . After reboot I ensured kernel version on terminal by using uname -a command it shows kernel version 4.9 Still I have issue . Andoroid UI is not coming only shell is coming
xaf-dec-test application is not working it fails in ioctl call (xf-fifo.c +139 respose error)

@rajeesh

/************ Modify below AOSP to your local path ***********/
AOSP_DIR=/scratch/aosp_dir/

I assume you have followed all the steps

  1. repo init -u platform/manifest - Git at Google -b master
    repo sync -j24
    source ./build/envsetup.sh
    lunch hikey960-userdebug
    make TARGET_KERNEL_USE=4.9 -j32

  2. build Android kernel
    cd ${AOSP_DIR}
    git clone kernel/hikey-linaro - Git at Google
    cd hikey-linaro
    git checkout -b android-hikey-linaro-4.9 origin/android-hikey-linaro-4.9

    make ARCH=arm64 hikey960_defconfig
    make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j24

    cp ${AOSP_DIR}/hikey-linaro/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb ${AOSP_DIR}/device/linaro/hikey-kernel/hi3660-hikey960.dtb-4.9
    cp ${AOSP_DIR}/hikey-linaro/arch/arm64/boot/Image.gz-dtb ${AOSP_DIR}/device/linaro/hikey-kernel/Image.gz-dtb-hikey960-4.9

  3. cd ${AOSP_DIR}
    source ./build/envsetup.sh
    lunch hikey960-userdebug
    make TARGET_KERNEL_USE=4.9 -j32

  4. adb reboot bootloader
    fastboot flash system ${AOSP_DIR}/out/target/product/hikey960/system.img
    fastboot flash boot ${AOSP_DIR}/out/target/product/hikey960/boot.img
    fastboot flash dts ${AOSP_DIR}/out/target/product/hikey960/dt.img
    fastboot flash vendor ${AOSP_DIR}/out/target/product/hikey960/vendor.img
    fastboot reboot

push xaf-dec-test from your vendor/bin
6. adb root;adb remount;