This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Need to support two different audio outputs on BeagleBoneBlack Android but PCM_CARD is hardcoded to 0 in audio_hw.c

In my device I need to use a USB camera. However since it is a capture device it become a pcm capture option in /proc/asound/cards.

We also need to use HDMI with audio output. Which is ok, using the right resolutions, it will be mapped to card0 in asound list.

However if I start my board with the USB camera plugged in, it is mapped as card0 and HDMI as card1. However I cannot switch the default audio card using android, how could I do it? 

I think it is mainly because CM_CARD is hardcoded to 0 in ti/omap3/audio/audio_hw.c, why is that? is it right?

  • Hi Rafael,

    the problem here is that the linux kernel is probing the usb audio input before the hdmi one.
    Android doesn't support renaming interfaces using ueventd (like would udev do), so the solution for this is not easy:

    1) force the hdmi audio detection in the board file before the usb audio device. This can be done by bypassing the eeprom read setup callbacks. This solution is not clean since it will disable the auto-detection of hardware implemented in the arch/arm/mach-omap2/board-am335xevm.c.

    2) implement auto detection of the hdmi audio device in the C code in the audio_hw.c file you mentioned most likely in the function adev_open() to detect (looping inside the /proc/asound folder) to detect the id associated with BONE (HDMI sound adapter on BBB). Right now, as you identified, the first adapter is used without doing any check.