Question

I am building an Embedded system, we were running Android x86 4.2.2 which runs fine with some tweaks and drivers, however when running 4.3 I am running into a no sound issue. I have an asound.state file I generated from Ubuntu that i can load with alsa_ctl restore and works in 4.2.2 but in 4.3.1 branch I get no audio, here is the logcat dump when I try to listen to a ringtone:

D/Ringtone( 3265): Successfully created local player
I/OMXCodec( 5285): [OMX.google.vorbis.decoder] allocating 4 buffers of size 32768 on     output port
    I/OMXCodec( 5285): [OMX.google.vorbis.decoder] allocated buffer 0xb7af0ff0 on output port
I/OMXCodec( 5285): [OMX.google.vorbis.decoder] allocated buffer 0xb7af1110 on output port
I/OMXCodec( 5285): [OMX.google.vorbis.decoder] allocated buffer 0xb7af1230 on output port
I/OMXCodec( 5285): [OMX.google.vorbis.decoder] allocated buffer 0xb7aeeea0 on output port
F/libc    ( 5285): Fatal signal 11 (SIGSEGV) at 0x00000004 (code=1), thread 5290 (AudioOut_2)
I/DEBUG   ( 1256): ***

 *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 1256): Build fingerprint: 'Generic-Plus/generic_plus/plus:4.3.1/JLS36I/eng.ubuntu.20131120.190444:eng/test-keys'
I/DEBUG   ( 1256): Revision: '0'
I/DEBUG   ( 1256): pid: 5285, tid: 5290, name: AudioOut_2  >>> /system/bin/mediaserver <<<
I/DEBUG   ( 1256): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000004
W/NativeCrashListener( 1486): Couldn't find ProcessRecord for pid 5285
I/DEBUG   ( 1256):     eax 00000000  ebx b62e8f20  ecx 00000000  edx 00000000
I/DEBUG   ( 1256):     esi b7adbba0  edi 00000004
I/DEBUG   ( 1256):     xcs 00000073  xds 0000007b  xes 0000007b  xfs 00000000  xss 0000007b
I/DEBUG   ( 1256):     eip b62e5ce7  ebp 00000006  esp b616ec88  flags 00010246
I/DEBUG   ( 1256): 
I/DEBUG   ( 1256): backtrace:
I/DEBUG   ( 1256):     #00  pc 00003ce7  /system/lib/hw/audio.primary.x86.so (reset_mixer_state+7)
I/DEBUG   ( 1256):     #01  pc 0000341e  /system/lib/hw/audio.primary.x86.so (out_set_parameters+238)
I/DEBUG   ( 1256):     #02  pc 0004e186  /system/lib/libaudioflinger.so (android::AudioFlinger::MixerThread::checkForNewParameters_l()+1094)
I/DEBUG   ( 1256):     #03  pc 0004e8c8  /system/lib/libaudioflinger.so (android::AudioFlinger::PlaybackThread::threadLoop()+632)
I/DEBUG   ( 1256):     #04  pc 0001ba59  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+585)
I/DEBUG   ( 1256):     #05  pc 0001bc2e  /system/lib/libutils.so (thread_data_t::trampoline(thread_data_t const*)+270)
I/DEBUG   ( 1256):     #06  pc 0000b674  /system/lib/libc.so (__thread_entry+132)
I/DEBUG   ( 1256):     #07  pc 0002ec65  /system/lib/libc.so (__pthread_clone+69)
I/DEBUG   ( 1256):     #08  pc ffffffff  <unknown>
I/DEBUG   ( 1256):     #09  pc 000101af  [heap]
I/DEBUG   ( 1256):     #10  pc 0000b04f  [heap]
I/DEBUG   ( 1256):     #11  pc 0000acbf  [heap]
I/DEBUG   ( 1256):     #12  pc 000072ef  [heap]
I/DEBUG   ( 1256): 
I/DEBUG   ( 1256): stack:
I/DEBUG   ( 1256):          b616ec48  0000000a  
I/DEBUG   ( 1256):          b616ec4c  00000000  
I/DEBUG   ( 1256):          b616ec50  00000000  
I/DEBUG   ( 1256):          b616ec54  00000000  
I/DEBUG   ( 1256):          b616ec58  00000000  
I/DEBUG   ( 1256):          b616ec5c  00000000  
I/DEBUG   ( 1256):          b616ec60  00000000  
I/DEBUG   ( 1256):          b616ec64  00000000  
I/DEBUG   ( 1256):          b616ec68  00000000  
I/DEBUG   ( 1256):          b616ec6c  00000000  
I/DEBUG   ( 1256):          b616ec70  00000000  
I/DEBUG   ( 1256):          b616ec74  00000000  
I/DEBUG   ( 1256):          b616ec78  00000000  
I/DEBUG   ( 1256):          b616ec7c  00000000  
I/DEBUG   ( 1256):          b616ec80  b7adbba0  [heap]
I/DEBUG   ( 1256):          b616ec84  b7690dc6  /system/lib/libc.so (atoi+6)
I/DEBUG   ( 1256):     #00  b616ec88  b7adbba0  [heap]
I/DEBUG   ( 1256):          b616ec8c  b62e541f  /system/lib/hw/audio.primary.x86.so (out_set_parameters+239)
I/DEBUG   ( 1256):     #01  b616ec90  00000000  
I/DEBUG   ( 1256):          b616ec94  b62e6515  /system/lib/hw/audio.primary.x86.so
I/DEBUG   ( 1256):          b616ec98  b616eccc  [stack:5290]
I/DEBUG   ( 1256):          b616ec9c  00000020  
I/DEBUG   ( 1256):          b616eca0  b7af22d0  [heap]
I/DEBUG   ( 1256):          b616eca4  00000000  
I/DEBUG   ( 1256):          b616eca8  b629a010  
I/DEBUG   ( 1256):          b616ecac  b7af2280  [heap]
I/DEBUG   ( 1256):          b616ecb0  00000001  
I/DEBUG   ( 1256):          b616ecb4  b7adbc28  [heap]
I/DEBUG   ( 1256):          b616ecb8  00000004  
I/DEBUG   ( 1256):          b616ecbc  00000000  
I/DEBUG   ( 1256):          b616ecc0  b616ece0  [stack:5290]
I/DEBUG   ( 1256):          b616ecc4  b7647bc6  /system/lib/libc.so (free+6)
I/DEBUG   ( 1256):          b616ecc8  b75a2e4c  /system/lib/libutils.so
I/DEBUG   ( 1256):          b616eccc  b7580036  /system/lib/libutils.so (android::BufferedTextOutput::getBuffer() const+166)
I/DEBUG   ( 1256):          ........  ........
I/DEBUG   ( 1256):     #02  b616ed10  b7adbdb0  [heap]
I/DEBUG   ( 1256):          b616ed14  b7af2270  [heap]
I/DEBUG   ( 1256):          b616ed18  b616ed54  [stack:5290]
I/DEBUG   ( 1256):          b616ed1c  b7adb2d4  [heap]
I/DEBUG   ( 1256):          b616ed20  ffffffea  
I/DEBUG   ( 1256):          b616ed24  00800000  
I/DEBUG   ( 1256):          b616ed28  b629a03c  
I/DEBUG   ( 1256):          b616ed2c  b77807f2  /system/lib/libaudioflinger.so
I/DEBUG   ( 1256):          b616ed30  b77807f9  /system/lib/libaudioflinger.so
I/DEBUG   ( 1256):          b616ed34  b7780807  /system/lib/libaudioflinger.so
I/DEBUG   ( 1256):          b616ed38  b77807dd  /system/lib/libaudioflinger.so
I/DEBUG   ( 1256):          b616ed3c  b77807e9  /system/lib/libaudioflinger.so
I/DEBUG   ( 1256):          b616ed40  b629a034  
I/DEBUG   ( 1256):          b616ed44  b629a060  
I/DEBUG   ( 1256):          b616ed48  b629a064  
I/DEBUG   ( 1256):          b616ed4c  00000001  
I/DEBUG   ( 1256):          ........  ........
I/BootReceiver( 1486): Copying /data/tombstones/tombstone_09 to DropBox (SYSTEM_TOMBSTONE)
I/ServiceManager( 1253): service 'media.audio_flinger' died
I/ServiceManager( 1253): service 'media.player' died
I/ServiceManager( 1253): service 'media.camera' died
I/ServiceManager( 1253): service 'media.audio_policy' died
W/AudioSystem( 3265): AudioFlinger server died!
W/IMediaDeathNotifier( 3265): media server died
E/MediaPlayer( 3265): error (100, 0)
W/AudioSystem( 1486): AudioFlinger server died!
W/AudioSystem( 1486): AudioPolicyService server died!
E/MediaPlayer( 3265): Error (100,0)
D/dalvikvm( 1486): GC_CONCURRENT freed 778K, 23% free 7827K/10144K, paused 1ms+3ms, total 33ms
I/mediaserver( 5356): ServiceManager: 0xb8baaaf0
I/AudioFlinger( 5356): Using default 3000 mSec as standby time.
I/CameraService( 5356): CameraService started (pid=5356)
E/CameraService( 5356): Could not load camera HAL module
I/AudioPolicyManagerBase( 5356): loadAudioPolicyConfig() loaded /system/etc/audio_policy.conf
E/audio_hw_primary( 5356): Failed to open /system/etc/mixer_paths.xml
I/AudioFlinger( 5356): loadHwModule() Loaded primary audio interface from Grouper audio HW HAL (audio) handle 1
I/AudioFlinger( 5356): HAL output buffer size 512 frames, normal mix buffer size 1024 frames
I/AudioMixer( 5356): found effect "Multichannel Downmix To Stereo" from The Android Open Source Project
E/MonoPipe( 5356): Failed to fetch local time frequency when constructing a MonoPipe (res = -32).  getNextWriteTimestamp calls will be non-functional
I/AudioFlinger( 5356): Using module 1 has the primary audio interface
I/AudioFlinger( 5356): AudioFlinger's thread 0xb622c010 ready to run
I/audio_a2dp_hw( 5356): adev_open:  adev_open in A2dp_hw module
I/AudioFlinger( 5356): loadHwModule() Loaded a2dp audio interface from A2DP Audio HW HAL (audio) handle 3
I/AudioFlinger( 5356): loadHwModule() Loaded usb audio interface from USB audio HW HAL (audio) handle 4
I/AudioPolicyService( 5356): Loaded audio policy from LEGACY Audio Policy HAL (audio_policy)
D/skia    ( 2550): --- SkImageDecoder::Factory returned null
D/skia    ( 2550): --- SkImageDecoder::Factory returned null
E/AudioService( 1486): Media server died.
E/AudioService( 1486): Media server started.
W/AudioPolicyManagerBase( 5356): setPhoneState() setting same state 0

Does any one have any suggestions? alsa_amixer outputs:

Simple mixer control 'IEC958',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [on]

And /proc/asound/cards:

 0 [Generic        ]: HDA-Intel - HD-Audio Generic
                  HD-Audio Generic at 0xfeb44000 irq 41
 1 [SB             ]: HDA-Intel - HDA ATI SB
                  HDA ATI SB at 0xfeb40000 irq 16
 2 [Camera         ]: USB-Audio - e-con's 3MP AF USB Camera
                  e-con System e-con's 3MP AF USB Camera at usb-0000:00:12.2-2.4, high    speed

lsmod | grep snd output:

root@plus:/ # lsmod | grep snd
snd_usb_audio 97187 0 - Live 0x00000000
snd_usbmidi_lib 13865 1 snd_usb_audio, Live 0x00000000
snd_rawmidi 15365 1 snd_usbmidi_lib, Live 0x00000000
snd_seq_device 4709 1 snd_rawmidi, Live 0x00000000
snd_hda_codec_realtek 30372 1 - Live 0x00000000
snd_hda_codec_hdmi 23024 1 - Live 0x00000000
snd_hda_intel 27216 0 - Live 0x00000000
snd_hda_codec 122789 3 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel, Live 0x00000000
snd_hwdep 4225 2 snd_usb_audio,snd_hda_codec, Live 0x00000000
snd_pcm 61471 4 snd_usb_audio,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec, Live 0x00000000
snd_timer 14493 1 snd_pcm, Live 0x00000000
snd_page_alloc 6242 2 snd_hda_intel,snd_pcm, Live 0x00000000

alsa_play -l output:

root@plus:/ # alsa_aplay -l                                                    
**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 1: ALC892 Digital [ALC892 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Update

So running: dd if=/dev/urandom bs=8000 count=1 | aplay -D plughw:0,0 results in: aplay: main:661: audio open error: No such file or directory stdout: write error: Broken pipe 1+0 records in 0+0 records out 0 bytes transferred in 0.124 secs (0 bytes/sec)

So nothing working there, no surprise, but running the same command with device 1 i.e. plughw:1,0 results in sound successfully playing:

Playing raw data 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
dd if=/dev/urandom bs=8000 count=1 | alsa_aplay -D plughw:1,0                         <
1+0 records in
1+0 records out
8000 bytes transferred in 0.003 secs (2666666 bytes/sec)
Playing raw data 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono

So it seems I need to switch the default sound card to device 1 per comment below, but how do I switch the default card using alsa_ctl -f asound.state restore? if so how do I specify with this syntax in that file?

state.Generic {
control.1 {
    iface CARD
    name 'HDMI/DP,pcm=3 Jack'
    value false
    comment {
        access read
        type BOOLEAN
        count 1
    }
}
control.2 {
    iface MIXER
    name 'IEC958 Playback Con Mask'
    value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
    comment {
        access read
        type IEC958
        count 1
......
Was it helpful?

Solution

The segfault that you were getting in Android-x86 4.3 in the logcat trace you posted was due to missing checks for null pointer params being passed into various functions in hardware/libaudio/audio_hw.c

I posted a patch to fix the issue in the bug report: http://code.google.com/p/android-x86/issues/detail?id=1209#c2

OTHER TIPS

To make the USB audio device the first device, put the following into some .conf file in /etc/modprobe.d/:

options snd slots=snd-usb-audio,snd-hda-intel,snd-hda-intel

(On any normal Linux; Android might be different.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top