Hi,
I am trying to enable USB Headset on OMAP3EVM rev G. I am using instruction from android gingerbread 2.3.4 devkit 2.1. I have connected Zebronic usb headset to EHCI host on OMAP3evm board.According to logs headset is detected by board.
But,on running a mp3 file on music application I am not able to hear any sound from headphone. Logs are following....
# [ 341.253234] usb 1-2.1: new full speed USB device using ehci-omap and address 5[ 341.379882] usb 1-2.1: New USB device found, idVendor=0d8c, idProduct=000c[ 341.387145] usb 1-2.1: New USB device strings: Mfr=0, Product=1, SerialNumber=0[ 341.394866] usb 1-2.1: Product: C-Media USB Headphone Set [ 341.452545] input: C-Media USB Headphone Set as /devices/platform/ehci-omap.0/usb1/1-2/1-2.1/1-2.1:1.3/input/input5[ 341.466186] generic-usb 0003:0D8C:000C.0003: input: USB HID v1.00 Device [C-Media USB Headphone Set ] on usb-ehci-omap.0-2.1/input3
# cat /proc/asound/cards 0 [omap3evm ]: - omap3evm omap3evm 1 [default ]: USB-Audio - C-Media USB Headphone Set C-Media USB Headphone Set at usb-ehci-omap.0-2.1, full speed#
Can anybody have the solution.Thanks in advance.
USB Audio is not supported with TI Android DevKit. However you might be able to use it by modifying the ALSA HAL, since as per your logs the device is supported in the kernel.
You can refer to the porting guides for more information http://processors.wiki.ti.com/index.php/TI-Android-GingerBread-2.3.4-DevKit-2.1_PortingGuides#Audio
--------------------------------------------------------------------------------------------------------- Please click the Verify Answer button on this post if it answers your question.---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
Please click the Verify Answer button on this post if it answers your question.---------------------------------------------------------------------------------------------------------
Hi Vishveshwar,
Thanks for reply.
I have tried line-in and line-out headset jack its speakers were working fine I was able to listen audio.Since microphone was (non-preamplified) input so it was not recording sound directly.Thats why i want to enable usb headset.
I have referred the link that you have given http://processors.wiki.ti.com/index.php/TI-Android-GingerBread-2.3.4-DevKit-2.1_PortingGuides#Audio .
This link says hardware for default out device is hw 0:0 whereas BT SCO device is hw 0:1 and after looking following logs
# alsa_aplay -l**** List of PLAYBACK Hardware Devices ****card 0: omap3evm [omap3evm], device 0: TWL4030 twl4030-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0card 0: omap3evm [omap3evm], device 1: WL1271BT wl1271bt-1 [] Subdevices: 1/1 Subdevice #0: subdevice #0card 1: default [C-Media USB Headphone Set ], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0#
It seems that hardware for my usb headset will be hw 1:0 (card 1,device 0). So I changed
ALSAControl control("hw:00"); to
ALSAControl control("hw:10"); in alsa_module.cpp file and after rebuilding I have replaced alsa.omap3evm.so.
But still there no sound is coming from usb headset on playing an audio file on mediaplayer or on commandline.
1. Do I need to change something else ? or
2. Do I have to create new handle for usb headphone in alsa_handle_t _defaults[] ,if yes, then what will be the buffer size for usb headphone as it is bufferSize : DEFAULT_SAMPLE_RATE / 5 for OMAP3_OUT_SCO and bufferSize : DEFAULT_SAMPLE_RATE / 11, for OMAP3_OUT_DEFAULT ?
Please help.
alsa_handle_t _defaults[]
One more thing I have tried "alsa_arecord -v -f cd | alsa_aplay -v" command to know the parameters during the usb headset attached.
output of above command is :
# alsa_arecord -v -f cd | alsa_aplay -vRecording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, StereoPlug PCM: Hardware PCM card 0 'omap3evm' device 0 subdevice 0Its setup is: stream : CAPTURE access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 44100 exact rate : 44100 (44100/1) msbits : 16 buffer_size : 27560 period_size : 5512 period_time : 124988 tstamp_mode : NONE period_step : 1 avail_min : 5512 period_event : 0 start_threshold : 1 stop_threshold : 27560 silence_threshold: 0 silence_size : 0 boundary : 1806172160Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, StereoPlug PCM: Hardware PCM card 0 'omap3evm' device 0 subdevice 0Its setup is: stream : PLAYBACK access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 44100 exact rate : 44100 (44100/1) msbits : 16 buffer_size : 27560 period_size : 5512 period_time : 124988 tstamp_mode : NONE period_step : 1 avail_min : 5512 period_event : 0 start_threshold : 27560 stop_threshold : 27560 silence_threshold: 0 silence_size : 0 boundary : 1806172160^Z[1] + Stopped alsa_arecord -v -f cd | alsa_aplay -v
the bold lines in this output are showing pluged hardware is card 0 'omap3evm' device 0
while the output of alsa_aplay shows default device is
card 1: default [C-Media USB Headphone Set ], device 0: USB Audio [USB Audio]Subdevices: 1/1Subdevice #0: subdevice #0
then why omap3evm is being used for playing?
and how to change it to usb headphone (card 1, device 0) ?
Thanks in advance for your reply.
Regards
Govind Singh Parmar