[alsa-devel] Problem using alsa to implement an Android dock

Jeremy Rosen jeremy.rosen at openwide.fr
Mon Jun 10 11:03:05 CEST 2013

Hello everybody

I am trying to implement an android dock on linux, and there is some 
cases where alsa seems to not properly recognise the Android phone as 
a USB sound device...

First a little bit of context

since Android 4.1 it is possible to put an android phone (connected 
to a PC via USB) in "dock mode" Basically you send a couple of special 
USB packet to the phone and the phone will disconnect from the USB
bus then reconnect as a USB sound device. You can then use any tool
to handle it as an audio source and redirct the sound to your speaker.

For those intereset the details can be found at


This works really well, no problem with that...

However Android also has something called "accessory mode" which is 
used to create custom apps that communicate in "raw" mode with the host

my problems arrive when both the dock mode and the accessory mode are 
enabled. in that case Alsa will not recognise the usb sound device exposed
by android. It will create an entry for it in /proc/asound but there 
are no mixer or input stream

I attach the output of lsusb -v in both cases and a small C program that
I use to put the phone in the proper modes

(there is a small section of code to (un)comment to en/disable accessory 
mode, it uses libusb for usb access and should be trivial to compile with

At this point I am not sure how to proceed, is this a real bug or something
not implemented ? what extra info do I need to provide ? any help would
be welcome


    Jérémy Rosen

fight key loggers : write some perl using vim
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: audio_accessory.txt
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20130610/8121e82e/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: audio_only.txt
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20130610/8121e82e/attachment-0001.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: usbAccConfig.c
Type: text/x-csrc
Size: 4818 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20130610/8121e82e/attachment.bin>

More information about the Alsa-devel mailing list