AnsweredAssumed Answered

IMX6 Implementing Dummy ALSA Driver in Android

Question asked by Luke Marvin on Sep 25, 2015
Latest reply on Sep 30, 2015 by Luke Marvin

BSP: android_kk4.4.2_1.0.0-ga

CPU: imx6dl

 

I have an Android device that doesn't have any audio codecs and Android doesn't seem to like that very much.

 

I am using a Parallel LCD rather than HDMI so it seems I cannot just dead-end the sound through the HDMI driver.

 

Boot Log:

usbcore: registered new interface driver snd-usb-audio
mxc_hdmi_soc mxc_hdmi_soc.0: MXC HDMI Audio
imx-hdmi-soc-dai imx-hdmi-soc-dai.0: Failed: Load HDMI-video first.
Initialize HDMI-audio failed. Load HDMI-video first!
ALSA device list:
  No soundcards found.

 

Then in Logcat I get the following:

01-01 00:00:08.560: I/AudioPolicyManagerBase(2095): loadAudioPolicyConfig() loaded /system/etc/audio_policy.conf
01-01 00:00:08.580: E/audio_hw_primary(2095): no supported sound card found, aborting.
01-01 00:00:08.580: E/AudioFlinger(2095): int android::load_audio_interface(const char*, audio_hw_device_t**) couldn't open audio hw device in audio.primary (Invalid argument)
01-01 00:00:08.580: I/AudioFlinger(2095): loadHwModule() error -22 loading module primary 
01-01 00:00:08.580: W/AudioPolicyManagerBase(2095): could not open HW module primary
01-01 00:00:08.580: I/audio_a2dp_hw(2095): adev_open:  adev_open in A2dp_hw module
01-01 00:00:08.580: I/AudioFlinger(2095): loadHwModule() Loaded a2dp audio interface from A2DP Audio HW HAL (audio) handle 1
01-01 00:00:08.600: I/r_submix(2095): adev_open(name=audio_hw_if)
01-01 00:00:08.600: I/r_submix(2095): adev_init_check()
01-01 00:00:08.600: I/AudioFlinger(2095): loadHwModule() Loaded r_submix audio interface from Wifi Display audio HAL (audio) handle 2
01-01 00:00:08.600: I/AudioFlinger(2095): loadHwModule() Loaded usb audio interface from USB audio HW HAL (audio) handle 3
01-01 00:00:08.600: E/AudioPolicyManagerBase(2095): Not output found for attached devices 00000002
01-01 00:00:08.600: E/AudioPolicyManagerBase(2095): Failed to open primary output
01-01 00:00:08.600: E/AudioPolicyManagerBase(2095): getDeviceForStrategy() speaker device not found for STRATEGY_SONIFICATION
01-01 00:00:08.600: E/AudioPolicyManagerBase(2095): getDeviceForStrategy() speaker device not found for STRATEGY_SONIFICATION
01-01 00:00:08.600: E/AudioPolicyService(2095): couldn't init_check the audio policy (No such device)

 

When I include the dummy driver found in kernel_imx/sound/drivers/dummy.c I receive the following boot log:

mxc_hdmi_soc mxc_hdmi_soc.0: MXC HDMI Audio
imx-hdmi-soc-dai imx-hdmi-soc-dai.0: Failed: Load HDMI-video first.
Initialize HDMI-audio failed. Load HDMI-video first!
ALSA device list:
  #0: Dummy 1

 

Then in Logcat I get the following:

01-01 00:00:09.920: I/AudioPolicyManagerBase(2119): loadAudioPolicyConfig() loaded /system/etc/audio_policy.conf
01-01 00:00:09.930: W/audio_hw_primary(2119): card 0, id Dummy ,driver Dummy, name Dummy
01-01 00:00:09.930: W/audio_hw_primary(2119): unrecognized card found.
01-01 00:00:09.930: E/audio_hw_primary(2119): no supported sound card found, aborting.
01-01 00:00:09.930: E/AudioFlinger(2119): int android::load_audio_interface(const char*, audio_hw_device_t**) couldn't open audio hw device in audio.primary (Invalid argument)
01-01 00:00:09.930: I/AudioFlinger(2119): loadHwModule() error -22 loading module primary 
01-01 00:00:09.930: W/AudioPolicyManagerBase(2119): could not open HW module primary
01-01 00:00:09.930: I/audio_a2dp_hw(2119): adev_open:  adev_open in A2dp_hw module
01-01 00:00:09.930: I/AudioFlinger(2119): loadHwModule() Loaded a2dp audio interface from A2DP Audio HW HAL (audio) handle 1
01-01 00:00:09.940: I/r_submix(2119): adev_open(name=audio_hw_if)
01-01 00:00:09.940: I/r_submix(2119): adev_init_check()
01-01 00:00:09.940: I/AudioFlinger(2119): loadHwModule() Loaded r_submix audio interface from Wifi Display audio HAL (audio) handle 2
01-01 00:00:09.940: I/AudioFlinger(2119): loadHwModule() Loaded usb audio interface from USB audio HW HAL (audio) handle 3
01-01 00:00:09.940: E/AudioPolicyManagerBase(2119): Not output found for attached devices 00000002
01-01 00:00:09.940: E/AudioPolicyManagerBase(2119): Failed to open primary output
01-01 00:00:09.940: E/AudioPolicyManagerBase(2119): getDeviceForStrategy() speaker device not found for STRATEGY_SONIFICATION
01-01 00:00:09.940: E/AudioPolicyManagerBase(2119): getDeviceForStrategy() speaker device not found for STRATEGY_SONIFICATION
01-01 00:00:09.940: E/AudioPolicyService(2119): couldn't init_check the audio policy (No such device)

 

Where do I begin to implement this dummy device?

Outcomes