Skip to contentSkip to conversation

Problem with ALSA on PPC

DISCUSSION Lee Revell 5 participants 15 messages Jun 9, 2006 – Jun 13, 2006

lore
Share & tools
lore

Lee Revell

author
#0 lore raw

Hello,

I am developing an ALSA application for an embedded PPC platform. I have alsa-lib and alsa-utils installed and created the device nodes, and am attempting to test with the dummy driver, but no matter what I do, aplay fails to find a config. It just returns "No such file or directory".

~ # aplay -l
**** List of PLAYBACK Hardware Devices ****
ALSA lib control.c:816:(snd_ctl_open_noupdate) Invalid CTL hw:0
aplay: device_list:232: control open (0): No such file or directory ALSA lib control.c:816:(snd_ctl_open_noupdate) Invalid CTL hw:1
aplay: device_list:232: control open (1): No such file or directory

~ # aplay -D hw:0,0 /usr/share/sounds/alsa/Front_Center.wav ALSA lib pcm.c:2146:(snd_pcm_open_noupdate) Unknown PCM hw:0,0
aplay: main:548: audio open error: No such file or directory

I do not have strace on this platform. How can I determine which file or directory is missing?

/usr/share/alsa/alsa.conf is present as well as the correct device node:

~ # ls -al /dev/snd/pcmC0D0p
crw-rw---- 1 root 29 116, 16 Jun 9 15:54 /dev/snd/pcmC0D0p

What am I doing wrong?

Lee

author
#1 lore raw
Quoted 12 lines · Lee Revell

I do not have strace on this platform. How can I determine which file or directory is missing?

/usr/share/alsa/alsa.conf is present as well as the correct device node:

~ # ls -al /dev/snd/pcmC0D0p
crw-rw---- 1 root 29 116, 16 Jun 9
15:54 /dev/snd/pcmC0D0p

What am I doing wrong?

I found the problem by installing strace on the PPC board. alsa-lib is looking for its config files using the original path from the build host. Either my build environment is still incorrect or it's a bug - probably the former ;-)

Once I am done maybe I will write an embedded ALSA HOWTO.

Lee

#2 lore raw
Quoted 14 lines · Lee Revell
Quoted 12 lines · Lee Revell

I do not have strace on this platform. How can I determine which file or directory is missing?

/usr/share/alsa/alsa.conf is present as well as the correct device node:

~ # ls -al /dev/snd/pcmC0D0p
crw-rw---- 1 root 29 116, 16 Jun 9
15:54 /dev/snd/pcmC0D0p

What am I doing wrong?

Quoted 9 lines

I found the problem by installing strace on the PPC board. alsa-lib is looking for its config files using the original path from the build host. Either my build environment is still incorrect or it's a bug - probably the former ;-)

Once I am done maybe I will write an embedded ALSA HOWTO.

Lee

I had/have a very similar problem with the Dreamcast - I can only use the oss emulation

Asking about here didn't get me an answer so I await any answers to your problem with anticipation...

/ # aplay -l
**** List of PLAYBACK Hardware Devices ****
aplay: device_list:230: control open (0): Invalid argument

author
#3 lore raw
Quoted 28 lines · Adrian McMenamin
Quoted 14 lines · Lee Revell
Quoted 12 lines · Lee Revell

I do not have strace on this platform. How can I determine which file or directory is missing?

/usr/share/alsa/alsa.conf is present as well as the correct device node:

~ # ls -al /dev/snd/pcmC0D0p
crw-rw---- 1 root 29 116, 16 Jun 9
15:54 /dev/snd/pcmC0D0p

What am I doing wrong?

Quoted 9 lines

I found the problem by installing strace on the PPC board. alsa-lib is looking for its config files using the original path from the build host. Either my build environment is still incorrect or it's a bug - probably the former ;-)

Once I am done maybe I will write an embedded ALSA HOWTO.

Lee

I had/have a very similar problem with the Dreamcast - I can only use the oss emulation

Quoted 6 lines

Asking about here didn't get me an answer so I await any answers to your problem with anticipation...

/ # aplay -l
**** List of PLAYBACK Hardware Devices ****
aplay: device_list:230: control open (0): Invalid argument

I don't know how I ever could have solved this without strace - the ALSA library is a twisty maze of function pointers. Have you looked into porting strace to your platform?

Lee

#4 lore raw

At Sat, 10 Jun 2006 12:59:15 -0400,

Quoted 33 lines · Lee Revell
Quoted 31 lines · Adrian McMenamin
Quoted 14 lines · Lee Revell
Quoted 12 lines · Lee Revell

I do not have strace on this platform. How can I determine which file or directory is missing?

/usr/share/alsa/alsa.conf is present as well as the correct device node:

~ # ls -al /dev/snd/pcmC0D0p
crw-rw---- 1 root 29 116, 16 Jun 9
15:54 /dev/snd/pcmC0D0p

What am I doing wrong?

Quoted 9 lines

I found the problem by installing strace on the PPC board. alsa-lib is looking for its config files using the original path from the build host. Either my build environment is still incorrect or it's a bug - probably the former ;-)

Once I am done maybe I will write an embedded ALSA HOWTO.

Lee

I had/have a very similar problem with the Dreamcast - I can only use the oss emulation

Asking about here didn't get me an answer so I await any answers to your problem with anticipation...

Quoted 6 lines
Quoted 3 lines

/ # aplay -l
**** List of PLAYBACK Hardware Devices ****
aplay: device_list:230: control open (0): Invalid argument

I don't know how I ever could have solved this without strace - the ALSA library is a twisty maze of function pointers.

Yeah, plugins hell.

Quoted 2 lines

Have you looked into
porting strace to your platform?

The open/close of all config stuff is done only in src/input.c and output.c. The open of device files is done via snd_open_device() defined in include/local.h. So, checking these entries cover most of open/close operations in alsa-lib.

Takashi

author
#5 lore raw
Quoted 27 lines · Takashi Iwai

At Sat, 10 Jun 2006 12:59:15 -0400,

Quoted 16 lines · Lee Revell
Quoted 16 lines
Quoted 9 lines

I found the problem by installing strace on the PPC board. alsa-lib is looking for its config files using the original path from the build host. Either my build environment is still incorrect or it's a bug - probably the former ;-)

Once I am done maybe I will write an embedded ALSA HOWTO.

Lee

I had/have a very similar problem with the Dreamcast - I can only use the oss emulation

Asking about here didn't get me an answer so I await any answers to your problem with anticipation...

Quoted 6 lines
Quoted 3 lines

/ # aplay -l
**** List of PLAYBACK Hardware Devices ****
aplay: device_list:230: control open (0): Invalid argument

I don't know how I ever could have solved this without strace - the ALSA library is a twisty maze of function pointers.

Yeah, plugins hell.

Quoted 7 lines
Quoted 2 lines

Have you looked into
porting strace to your platform?

The open/close of all config stuff is done only in src/input.c and output.c. The open of device files is done via snd_open_device() defined in include/local.h. So, checking these entries cover most of open/close operations in alsa-lib.

How can I build alsa-lib with a non-standard --prefix, but at runtime have it look for its config files in the standard location? IOW how do I prevent the --prefix from being prepended?

I am generating a ramdisk image that is transferred over to a PPC board, and except for this problem, alsa-lib works on the target.

Looking at ./configure options, it seems like it's not possible?

Lee

#6 lore raw

At Mon, 12 Jun 2006 17:57:23 -0400,

Quoted 32 lines · Lee Revell
Quoted 30 lines · Takashi Iwai

At Sat, 10 Jun 2006 12:59:15 -0400,

Quoted 16 lines · Lee Revell
Quoted 16 lines
Quoted 9 lines

I found the problem by installing strace on the PPC board. alsa-lib is looking for its config files using the original path from the build host. Either my build environment is still incorrect or it's a bug - probably the former ;-)

Once I am done maybe I will write an embedded ALSA HOWTO.

Lee

I had/have a very similar problem with the Dreamcast - I can only use the oss emulation

Asking about here didn't get me an answer so I await any answers to your problem with anticipation...

Quoted 6 lines
Quoted 3 lines

/ # aplay -l
**** List of PLAYBACK Hardware Devices ****
aplay: device_list:230: control open (0): Invalid argument

I don't know how I ever could have solved this without strace - the ALSA library is a twisty maze of function pointers.

Yeah, plugins hell.

Quoted 2 lines

Have you looked into
porting strace to your platform?

Quoted 8 lines
Quoted 4 lines

The open/close of all config stuff is done only in src/input.c and output.c. The open of device files is done via snd_open_device() defined in include/local.h. So, checking these entries cover most of open/close operations in alsa-lib.

How can I build alsa-lib with a non-standard --prefix, but at runtime have it look for its config files in the standard location? IOW how do I prevent the --prefix from being prepended?

How about specifying --datadir=/usr/share explicitly? The default config directory is $DATADIR/alsa/alsa.conf.

Takashi

#7 lore raw
Quoted 39 lines · Takashi Iwai

At Mon, 12 Jun 2006 17:57:23 -0400,

Quoted 37 lines · Lee Revell
Quoted 34 lines · Takashi Iwai

At Sat, 10 Jun 2006 12:59:15 -0400,

Quoted 16 lines · Lee Revell
Quoted 16 lines
Quoted 9 lines

I found the problem by installing strace on the PPC board. alsa-lib is looking for its config files using the original path from the build host. Either my build environment is still incorrect or it's a bug - probably the former ;-)

Once I am done maybe I will write an embedded ALSA HOWTO.

Lee

I had/have a very similar problem with the Dreamcast - I can only use the oss emulation

Asking about here didn't get me an answer so I await any answers to your problem with anticipation...

Quoted 6 lines
Quoted 3 lines

/ # aplay -l
**** List of PLAYBACK Hardware Devices ****
aplay: device_list:230: control open (0): Invalid argument

I don't know how I ever could have solved this without strace - the ALSA library is a twisty maze of function pointers.

Yeah, plugins hell.

Quoted 2 lines

Have you looked into
porting strace to your platform?

The open/close of all config stuff is done only in src/input.c and output.c. The open of device files is done via snd_open_device() defined in include/local.h. So, checking these entries cover most of open/close operations in alsa-lib.

Quoted 6 lines
Quoted 3 lines

How can I build alsa-lib with a non-standard --prefix, but at runtime have it look for its config files in the standard location? IOW how do I prevent the --prefix from being prepended?

How about specifying --datadir=/usr/share explicitly? The default config directory is $DATADIR/alsa/alsa.conf.

I just cross-compiled alsa-lib for SH4 on x86, and --prefix works without problems:

CFLAGS="-Os -m4 -ml" ./configure --prefix=/usr --host=sh4-unknown-linux-gnu --target=sh4-unknown-linux-gnu --build=i686-pc-linux-gnu

make DESTDIR=/var/chroot/sh install

/var/chroot/sh is my target's NFSroot.

shlinux # / aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sh7760-ac97 [sh7760-ac97-0], device 0: sh7760-ac97-PCM []
Subdevices: 1/1
Subdevice #0: subdevice #0

Signature · 1 line
 ml.
author
#8 lore raw
Quoted 8 lines · Manuel Lauss

I just cross-compiled alsa-lib for SH4 on x86, and --prefix works without problems:

CFLAGS="-Os -m4 -ml" ./configure --prefix=/usr --host=sh4-unknown-linux-gnu --target=sh4-unknown-linux-gnu --build=i686-pc-linux-gnu

make DESTDIR=/var/chroot/sh install

Quoted 7 lines

/var/chroot/sh is my target's NFSroot.

shlinux # / aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sh7760-ac97 [sh7760-ac97-0], device 0: sh7760-ac97-PCM []
Subdevices: 1/1
Subdevice #0: subdevice #0

Thanks, it works perfectly.

Lee

author
#9 lore raw
In reply to Takashi Iwai
Quoted 9 lines · Takashi Iwai

At Mon, 12 Jun 2006 17:57:23 -0400,

Quoted 3 lines · Lee Revell

How can I build alsa-lib with a non-standard --prefix, but at runtime have it look for its config files in the standard location? IOW how do I prevent the --prefix from being prepended?

How about specifying --datadir=/usr/share explicitly? The default config directory is $DATADIR/alsa/alsa.conf.

Won't that cause "make install" to install into /usr/share/alsa on the build host?

Lee

#10 lore raw

At Tue, 13 Jun 2006 11:45:14 -0400,

Quoted 8 lines · Lee Revell
Quoted 6 lines · Takashi Iwai

At Mon, 12 Jun 2006 17:57:23 -0400,

Quoted 3 lines · Lee Revell

How can I build alsa-lib with a non-standard --prefix, but at runtime have it look for its config files in the standard location? IOW how do I prevent the --prefix from being prepended?

Quoted 6 lines
Quoted 3 lines

How about specifying --datadir=/usr/share explicitly? The default config directory is $DATADIR/alsa/alsa.conf.

Won't that cause "make install" to install into /usr/share/alsa on the build host?

The installation root is usually specified via $DESTDIR, such as

make DESTDIR=/my/root install

Takashi

#11 lore raw
In reply to Adrian McMenamin
Quoted 12 lines · Adrian McMenamin
Quoted 11 lines · Lee Revell
Quoted 10 lines · Lee Revell

I do not have strace on this platform. How can I determine which file or directory is missing?

/usr/share/alsa/alsa.conf is present as well as the correct device node:

~ # ls -al /dev/snd/pcmC0D0p
crw-rw---- 1 root 29 116, 16 Jun 9
15:54 /dev/snd/pcmC0D0p

Quoted 7 lines
Quoted 7 lines
Quoted 2 lines

What am I doing wrong?

I found the problem by installing strace on the PPC board. alsa-lib is looking for its config files using the original path from the build host. Either my build environment is still incorrect or it's a bug - probably the former ;-)

Fwiw, I've been using OE

http://www.openembedded.org/

to do all my embedded (non x86) ALSA user space building. It's quite simple and I've not had any issues wih building alsa-* yet. It even creates the device nodes and puts all the config files in the correct place in your target file system.

Quoted 4 lines

I had/have a very similar problem with the Dreamcast - I can only use the oss emulation

Quoted 8 lines

Asking about here didn't get me an answer so I await any answers to your problem with anticipation...

/ # aplay -l
**** List of PLAYBACK Hardware Devices ****
aplay: device_list:230: control open (0): Invalid argument

I've had a similar issue in the past. I could see the alsa device nodes under /dev/snd and could see the pcms in /proc/asound/pcm, although I had error messages like this when opening the devices in alsa mode. OSS mode worked fine.

It turned out that my alsa nodes were not in the target file systems /etc/device_table file. After adding them to this file and rebooting, alsa worked fine.

HTH

Liam

author
#12 lore raw
Quoted 8 lines · Liam Girdwood

Fwiw, I've been using OE

http://www.openembedded.org/

to do all my embedded (non x86) ALSA user space building. It's quite simple and I've not had any issues wih building alsa-* yet. It even creates the device nodes and puts all the config files in the correct place in your target file system.

I use Kegel's crosstool:

http://www.kegel.com/crosstool/

and modified scripts from the board vendor. I can't easily switch as this is what everyone else in the shop uses.

I guess OE solves this problem by building in a chroot or something? I cannot see a way to prevent alsa-lib from prepending $PREFIX to the location of the config files.

Lee

author
#13 lore raw
In reply to Adrian McMenamin
Quoted 11 lines · Adrian McMenamin

I had/have a very similar problem with the Dreamcast - I can only use the oss emulation

Asking about here didn't get me an answer so I await any answers to your
problem with anticipation...

/ # aplay -l
**** List of PLAYBACK Hardware Devices ****
aplay: device_list:230: control open (0): Invalid argument

Adrian,

I looked at the strace source and it seems that Super-H is supported:

$ ls packages/strace-4.5.14/linux/sh
errnoent.h  ioctlent.h  signalent.h  syscallent.h

Have you tried it?

Lee

#14 lore raw
Quoted 13 lines · Lee Revell
Quoted 11 lines · Adrian McMenamin

I had/have a very similar problem with the Dreamcast - I can only use the oss emulation

Asking about here didn't get me an answer so I await any answers to your
problem with anticipation...

/ # aplay -l
**** List of PLAYBACK Hardware Devices ****
aplay: device_list:230: control open (0): Invalid argument

Quoted 9 lines

Adrian,

I looked at the strace source and it seems that Super-H is supported:

$ ls packages/strace-4.5.14/linux/sh
errnoent.h  ioctlent.h  signalent.h  syscallent.h

Have you tried it?

I haven't actually. Struggling with other SH kernel problems at the moment, but I'll have a look

Quoted 1 line

Lee