Your ctrl element count must match the value in the asound.conf.
Verify the snd_kcontrol_new struct object at the ALSA audio driver.
For example:
SOC_SINGLE("Line Gain", PLAYBACK_CTRL1, 5, 7, 0), //In the
snd_kcontrol_new struct object
then:
the asound.conf file must configuration following line:
pcm.AndroidPlayback {
type hooks
slave.pcm {
type hw
card 0
device 0
}
hooks.0 {
type ctl_elems
hook_args [
{
name 'Line Gain'
value 7
}
]
}
}
BTW: I am studying yet,perhaps above disscuse is incorrect. :)
---------------------------
On Fri, Apr 17, 2009 at 3:36 PM, Androidphan <[email protected]> wrote:
>
> It's better to add the following to system/core/init/devices.c :
> { "/dev/snd/", 0664, AID_SYSTEM, AID_AUDIO, 1 },
>
> But I haven't got my sound to work yet... I got myself an asound.conf
> with things as : pcm.AndroidPlayback_ etc...
>
> I get the following in logcat:
>
> D/AudioHardwareALSA( 2089): Mixer: element name: 'Master'
> D/AudioHardwareALSA( 2089): Mixer: element name: 'Front'
> D/AudioHardwareALSA( 2089): Mixer: element name: 'Front Mic'
> D/AudioHardwareALSA( 2089): Mixer: element name: 'Front Mic Boost'
> D/AudioHardwareALSA( 2089): Mixer: element name: 'Mic'
> D/AudioHardwareALSA( 2089): Mixer: element name: 'Mic Boost'
> D/AudioHardwareALSA( 2089): Mixer: master 'PCM' not found.
> D/AudioHardwareALSA( 2089): Mixer: route 'Line' not found.
> D/AudioHardwareALSA( 2089): Mixer: route 'Master' found.
> D/AudioHardwareALSA( 2089): Mixer: route 'Bluetooth' not found.
> D/AudioHardwareALSA( 2089): Mixer: route 'Headphone' not found.
> D/AudioHardwareALSA( 2089): Mixer: route 'Bluetooth A2DP' not found.
> D/AudioHardwareALSA( 2089): Mixer: element name: 'Front Mic Boost'
> D/AudioHardwareALSA( 2089): Mixer: element name: 'Mic Boost'
> D/AudioHardwareALSA( 2089): Mixer: element name: 'Capture'
> D/AudioHardwareALSA( 2089): Mixer: master 'Capture' found.
> D/AudioHardwareALSA( 2089): Mixer: route 'Capture' found.
> D/AudioHardwareALSA( 2089): Mixer: route '' not found.
> D/AudioHardwareALSA( 2089): Mixer: route 'Bluetooth Capture' not
> found.
> D/AudioHardwareALSA( 2089): Mixer: route 'Capture' found.
> D/AudioHardwareALSA( 2089): Mixer: route 'Bluetooth A2DP Capture' not
> found.
> D/AudioHardwareALSA( 2089): mixer initialized.
> E/ALSALib ( 2089): external/alsa-lib/src/control/setup.c:334:
> (snd_config_get_ctl_elem_value) bad value type
> E/ALSALib ( 2089): external/alsa-lib/src/pcm/pcm_hw.c:1445:
> (_snd_pcm_hw_open) Invalid type for subdevice
> E/ALSALib ( 2089): external/alsa-lib/src/pcm/pcm.c:2201:
> (snd_pcm_open_noupdate) Unknown PCM NULL_Device
> I/AudioHardwareALSA( 2089): Initialized ALSA PLAYBACK device
> NULL_Device
> W/AudioHardwareALSA( 2089): AudioMixer expects two channels, but only
> -1 found!
> W/AudioHardwareALSA( 2089): AudioMixer expects two channels, but only
> -1 found!
> I/AudioFlinger( 2089): AudioFlinger's thread ready to run for output 0
> E/ALSALib ( 2089): external/alsa-lib/src/control/setup.c:334:
> (snd_config_get_ctl_elem_value) bad value type
> E/ALSALib ( 2089): external/alsa-lib/src/pcm/pcm.c:2201:
> (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback_Speaker
> E/ALSALib ( 2089): external/alsa-lib/src/control/setup.c:334:
> (snd_config_get_ctl_elem_value) bad value type
> E/ALSALib ( 2089): external/alsa-lib/src/pcm/pcm_hw.c:1445:
> (_snd_pcm_hw_open) Invalid type for subdevice
> E/ALSALib ( 2089): external/alsa-lib/src/pcm/pcm.c:2201:
> (snd_pcm_open_noupdate) Unknown PCM NULL_Device
> I/AudioHardwareALSA( 2089): Initialized ALSA PLAYBACK device
> NULL_Device
>
> With the asound.conf found here:
>
> http://pastebin.com/m54883b4b
>
> Anyone can help?
>
> On Apr 16, 9:50 am, "[email protected]" <[email protected]> wrote:
> > This issue's reason is the /dev/snd/* device nodes permission.
> > Android access the audio device by the audio group.
> > So change the /dev/snd/* nodes as audio group.
> >
> > Can add some lines to init.rc to fixed it:
> > # workaround to resolve current permission issue
> > chmod 0666 /dev/binder
> > chmod 0666 /dev/ashmem
> > #following are new lines
> > chown root audio /dev/snd/controlC0
> > chown root audio /dev/snd/pcmC0D0c
> > chown root audio /dev/snd/pcmC0D0p
> > chown root audio /dev/snd/timer
> >
> > or add some lines to "devperms" at the system/core/init/devices.c.
> >
> > -----------------------------------
> > Ying RongJun China
> >
> > On Apr 6, 9:00 pm, Harishkumar V <[email protected]> wrote:
> >
> > > Hi,
> >
> > > Even i am also facing the same error with the new android source after
> > > making repo sync.
> > > The alsa-lib and alsa_sound are also new ones checked out from git.
> >
> > > the "dev/snd" are created. /proc/asound exists.
> >
> > > i also copied the sample asound.conf to /system/etc/.
> > > Even given the permissions.
> >
> > > D/AndroidRuntime( 706):
> > > D/AndroidRuntime( 706): >>>>>>>>>>>>>> AndroidRuntime START
> <<<<<<<<<<<<<<
> > > D/AndroidRuntime( 706): CheckJNI is ON
> > > I/ ( 707): ServiceManager: 0xac38
> > > E/AudioHardwareALSA( 707): Unable to attach mixer to device
> > > AndroidPlayback: Permission denied
> > > E/AudioHardwareALSA( 707): Unable to attach mixer to device default:
> No
> > > such file or directory
> > > E/AudioHardwareALSA( 707): Unable to attach mixer to device
> AndroidRecord:
> > > Permission denied
> > > E/AudioHardwareALSA( 707): Unable to attach mixer to device default:
> No
> > > such file or directory
> > > I/DEBUG ( 704): *** *** *** *** *** *** *** *** *** *** *** *** ***
> ***
> > > *** ***
> > > I/DEBUG ( 704): Build fingerprint:
> > >
> 'generic/generic/generic/:1.5/CUPCAKE/eng.root.20090406.193434:eng/test-key
> s'
> > > I/DEBUG ( 704): pid: 707, tid: 707 >>> /system/bin/mediaserver <<<
> > > I/DEBUG ( 704): signal 11 (SIGSEGV), fault addr 00000010
> > > I/DEBUG ( 704): r0 00000000 r1 ab78c8e4 r2 00000000 r3 00000000
> > > I/DEBUG ( 704): r4 ab79d120 r5 0000ad68 r6 be9d0a10 r7 ab01acd8
> > > I/DEBUG ( 704): r8 0000b228 r9 00000000 10 ab79cd80 fp be9d0ab4
> > > I/DEBUG ( 704): ip 0000ad90 sp be9d0a08 lr ab71d324 pc ab746ce8
> cpsr
> > > 00000010
> >
> > > Thanks and Regards,
> > > HarishKumar.V
> >
> > > On Mon, Apr 6, 2009 at 5:12 PM, Androidphan <[email protected]>
> wrote:
> >
> > > > I use the Alsa Lib from the git repository. It's still from before
> the
> > > > big merge.
> > > > I still can't get it to work. Does it really need an asound.conf ?
> >
> > > > When are the alsa-utils commited to the repository? I can't build it
> > > > decently for x86. Anyone has a decent Android makefile for this?
> >
> > > > On 1 apr, 16:23, Michael Trimarchi <[email protected]>
> wrote:
> > > > > Hi,
> >
> > > > > Androidphan wrote:
> > > > > > Something is wrong with my asound.conf I guess.
> >
> > > > > > If I just put this in my asound.conf:
> > > > > > ctl.AndroidPlayback {
> > > > > > type hw
> > > > > > card 0
> > > > > > }
> >
> > > > > > ctl.AndroidRecord {
> > > > > > type hw
> > > > > > card 0
> > > > > > }
> >
> > > > > > I'm now getting:
> >
> > > > > > E/AudioHardwareALSA( 2162): Unable to attach mixer to device
> > > > > > AndroidPlayback: Permission denied
> > > > > > E/AudioHardwareALSA( 2162): Unable to attach mixer to device
> default:
> > > > > > No such file or directory
> > > > > > E/AudioHardwareALSA( 2162): Unable to attach mixer to device
> > > > > > AndroidRecord: Permission denied
> > > > > > E/AudioHardwareALSA( 2162): Unable to attach mixer to device
> default:
> > > > > > No such file or directory
> >
> > > > > > Then when setting the correct file permissions it goes further.
> Still
> > > > > > not booting through though.
> >
> > > > > > On 1 apr, 16:07, Michael Trimarchi <[email protected]>
> wrote:
> >
> > > > > I had a crash in mediaserver because compilation flags of
> thealsa-lib
> > > > > don't match
> > > > > the compilation flag of AudioHardwareAlsa so it recevice a
> segmentation
> > > > > fault
> > > > > accessing a struct with an invalid offset. So when I ask the frame
> > > > > stack, it's
> > > > > just to know if I can exclude this situation.
> >
> > > > > What version do you use of the two packages?
> >
> > > > > Michael
> >
>
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---