All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-raspberrypi][question] how to setup alsa on rpi3?
@ 2016-10-21 10:08 Piotr Lewicki
  2016-10-21 11:26 ` Tanu Kaskinen
  0 siblings, 1 reply; 5+ messages in thread
From: Piotr Lewicki @ 2016-10-21 10:08 UTC (permalink / raw)
  To: yocto

Hi,

I want to use aplay to play a sound on raspberry pi 3, but for some 
reason it does not work for me.

I have built a new "rpi-test-image" with only one difference from 
original- I added "alsa-utils" to the image.

My steps:

1. I ssh'd to the board with the built image,

2. downloaded wav sample ("wget 
http://freewavesamples.com/files/Korg-Triton-Harmonica-C5.wav"),

3. enabled the sound kernel module ("modprobe snd-bcm2835"),

4. tried to play it with "aplay" tool.


It did not work and I got an error:

root@raspberrypi3:~# aplay ./Korg-Triton-Harmonica-C5.wav
ALSA lib ../../alsa-lib-1.1.2/src/confmisc.c:767:(parse_card) cannot 
find card '0'
ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4371:(_snd_config_evaluate) 
function snd_func_card_driver returned error: No such file or directory
ALSA lib ../../alsa-lib-1.1.2/src/confmisc.c:392:(snd_func_concat) error 
evaluating strings
ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4371:(_snd_config_evaluate) 
function snd_func_concat returned error: No such file or directory
ALSA lib ../../alsa-lib-1.1.2/src/confmisc.c:1246:(snd_func_refer) error 
evaluating name
ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4371:(_snd_config_evaluate) 
function snd_func_refer returned error: No such file or directory
ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4850:(snd_config_expand) 
Evaluate error: No such file or directory
ALSA lib 
../../../alsa-lib-1.1.2/src/pcm/pcm.c:2450:(snd_pcm_open_noupdate) 
Unknown PCM default
aplay: main:786: audio open error: No such file or directory


Playing the same wav file with omxplayer ("omxplayer -o local 
./Korg-Triton-Harmonica-C5.wav") works fine.


Do you know how can I set up alsa to make it work on rpi3 board?

Does anybody have it working?

I don't know whether I should start with the alsa configuration or some 
missing packages, or the problem lays in the sound driver.

Any help appreciated,


Thanks,

Piotr Lewicki



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-raspberrypi][question] how to setup alsa on rpi3?
  2016-10-21 10:08 [meta-raspberrypi][question] how to setup alsa on rpi3? Piotr Lewicki
@ 2016-10-21 11:26 ` Tanu Kaskinen
  2016-10-21 11:45   ` Piotr Lewicki
  2016-10-22 16:32   ` Khem Raj
  0 siblings, 2 replies; 5+ messages in thread
From: Tanu Kaskinen @ 2016-10-21 11:26 UTC (permalink / raw)
  To: yocto

On Fri, 2016-10-21 at 12:08 +0200, Piotr Lewicki wrote:
> Hi,
> 
> I want to use aplay to play a sound on raspberry pi 3, but for some 
> reason it does not work for me.
> 
> I have built a new "rpi-test-image" with only one difference from 
> original- I added "alsa-utils" to the image.
> 
> My steps:
> 
> 1. I ssh'd to the board with the built image,
> 
> 2. downloaded wav sample ("wget 
> http://freewavesamples.com/files/Korg-Triton-Harmonica-C5.wav"),
> 
> 3. enabled the sound kernel module ("modprobe snd-bcm2835"),
> 
> 4. tried to play it with "aplay" tool.
> 
> 
> It did not work and I got an error:
> 
> root@raspberrypi3:~# aplay ./Korg-Triton-Harmonica-C5.wav
> ALSA lib ../../alsa-lib-1.1.2/src/confmisc.c:767:(parse_card) cannot 
> find card '0'
> ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4371:(_snd_config_evaluate) 
> function snd_func_card_driver returned error: No such file or directory
> ALSA lib ../../alsa-lib-1.1.2/src/confmisc.c:392:(snd_func_concat) error 
> evaluating strings
> ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4371:(_snd_config_evaluate) 
> function snd_func_concat returned error: No such file or directory
> ALSA lib ../../alsa-lib-1.1.2/src/confmisc.c:1246:(snd_func_refer) error 
> evaluating name
> ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4371:(_snd_config_evaluate) 
> function snd_func_refer returned error: No such file or directory
> ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4850:(snd_config_expand) 
> Evaluate error: No such file or directory
> ALSA lib 
> ../../../alsa-lib-1.1.2/src/pcm/pcm.c:2450:(snd_pcm_open_noupdate) 
> Unknown PCM default
> aplay: main:786: audio open error: No such file or directory

It looks like the default alsa device is configured to use card 0, but
card 0 doesn't exist. What do "cat /proc/asound/cards" and "ls -l
/dev/snd" print?

-- 
Tanu


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-raspberrypi][question] how to setup alsa on rpi3?
  2016-10-21 11:26 ` Tanu Kaskinen
@ 2016-10-21 11:45   ` Piotr Lewicki
  2016-10-22 14:57     ` Tanu Kaskinen
  2016-10-22 16:32   ` Khem Raj
  1 sibling, 1 reply; 5+ messages in thread
From: Piotr Lewicki @ 2016-10-21 11:45 UTC (permalink / raw)
  To: Tanu Kaskinen, yocto

On 21.10.2016 13:26, Tanu Kaskinen wrote:
> On Fri, 2016-10-21 at 12:08 +0200, Piotr Lewicki wrote:
>> Hi,
>>
>> I want to use aplay to play a sound on raspberry pi 3, but for some
>> reason it does not work for me.
>>
>> I have built a new "rpi-test-image" with only one difference from
>> original- I added "alsa-utils" to the image.
>>
>> My steps:
>>
>> 1. I ssh'd to the board with the built image,
>>
>> 2. downloaded wav sample ("wget
>> http://freewavesamples.com/files/Korg-Triton-Harmonica-C5.wav"),
>>
>> 3. enabled the sound kernel module ("modprobe snd-bcm2835"),
>>
>> 4. tried to play it with "aplay" tool.
>>
>>
>> It did not work and I got an error:
>>
>> root@raspberrypi3:~# aplay ./Korg-Triton-Harmonica-C5.wav
>> ALSA lib ../../alsa-lib-1.1.2/src/confmisc.c:767:(parse_card) cannot
>> find card '0'
>> ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4371:(_snd_config_evaluate)
>> function snd_func_card_driver returned error: No such file or directory
>> ALSA lib ../../alsa-lib-1.1.2/src/confmisc.c:392:(snd_func_concat) error
>> evaluating strings
>> ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4371:(_snd_config_evaluate)
>> function snd_func_concat returned error: No such file or directory
>> ALSA lib ../../alsa-lib-1.1.2/src/confmisc.c:1246:(snd_func_refer) error
>> evaluating name
>> ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4371:(_snd_config_evaluate)
>> function snd_func_refer returned error: No such file or directory
>> ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4850:(snd_config_expand)
>> Evaluate error: No such file or directory
>> ALSA lib
>> ../../../alsa-lib-1.1.2/src/pcm/pcm.c:2450:(snd_pcm_open_noupdate)
>> Unknown PCM default
>> aplay: main:786: audio open error: No such file or directory
> It looks like the default alsa device is configured to use card 0, but
> card 0 doesn't exist. What do "cat /proc/asound/cards" and "ls -l
> /dev/snd" print?
root@raspberrypi3:~# cat /proc/asound/cards
--- no soundcards ---
root@raspberrypi3:~# ls -al /dev/snd/
drwxr-xr-x    2 root     root            60 Oct 21 09:53 .
drwxr-xr-x   11 root     root         13200 Oct 21 09:53 ..
crw-rw----    1 root     audio     116,  33 Oct 21 09:53 timer


I wonder what is used by omxplayer that it works, but alsa does not.
>
> -- 
> Tanu
--
Piotr


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-raspberrypi][question] how to setup alsa on rpi3?
  2016-10-21 11:45   ` Piotr Lewicki
@ 2016-10-22 14:57     ` Tanu Kaskinen
  0 siblings, 0 replies; 5+ messages in thread
From: Tanu Kaskinen @ 2016-10-22 14:57 UTC (permalink / raw)
  To: Piotr Lewicki, yocto

On Fri, 2016-10-21 at 13:45 +0200, Piotr Lewicki wrote:
> On 21.10.2016 13:26, Tanu Kaskinen wrote:
> > It looks like the default alsa device is configured to use card 0, but
> > card 0 doesn't exist. What do "cat /proc/asound/cards" and "ls -l
> > /dev/snd" print?
> 
> root@raspberrypi3:~# cat /proc/asound/cards
> --- no soundcards ---
> root@raspberrypi3:~# ls -al /dev/snd/
> drwxr-xr-x    2 root     root            60 Oct 21 09:53 .
> drwxr-xr-x   11 root     root         13200 Oct 21 09:53 ..
> crw-rw----    1 root     audio     116,  33 Oct 21 09:53 timer

Weird, is snd-bcm2835 actually loaded?

I don't have oe on rpi myself, so if there's some extra step required
to make alsa work, I don't know about it.

I have raspbian on rpi2, and /boot/config.txt contains this, which
seems relevant, so you could check if you have it:

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

But if you have snd-bcm2835 already loaded, then I don't think this can
be the issue.

> I wonder what is used by omxplayer that it works, but alsa does not.

Yes, it seems to be some kind of witchcraft.

-- 
Tanu


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-raspberrypi][question] how to setup alsa on rpi3?
  2016-10-21 11:26 ` Tanu Kaskinen
  2016-10-21 11:45   ` Piotr Lewicki
@ 2016-10-22 16:32   ` Khem Raj
  1 sibling, 0 replies; 5+ messages in thread
From: Khem Raj @ 2016-10-22 16:32 UTC (permalink / raw)
  To: Tanu Kaskinen; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 2498 bytes --]


> On Oct 21, 2016, at 4:26 AM, Tanu Kaskinen <tanuk@iki.fi> wrote:
> 
> On Fri, 2016-10-21 at 12:08 +0200, Piotr Lewicki wrote:
>> Hi,
>> 
>> I want to use aplay to play a sound on raspberry pi 3, but for some
>> reason it does not work for me.
>> 
>> I have built a new "rpi-test-image" with only one difference from
>> original- I added "alsa-utils" to the image.
>> 
>> My steps:
>> 
>> 1. I ssh'd to the board with the built image,
>> 
>> 2. downloaded wav sample ("wget
>> http://freewavesamples.com/files/Korg-Triton-Harmonica-C5.wav"),
>> 
>> 3. enabled the sound kernel module ("modprobe snd-bcm2835"),
>> 
>> 4. tried to play it with "aplay" tool.
>> 
>> 
>> It did not work and I got an error:
>> 
>> root@raspberrypi3:~# aplay ./Korg-Triton-Harmonica-C5.wav
>> ALSA lib ../../alsa-lib-1.1.2/src/confmisc.c:767:(parse_card) cannot
>> find card '0'
>> ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4371:(_snd_config_evaluate)
>> function snd_func_card_driver returned error: No such file or directory
>> ALSA lib ../../alsa-lib-1.1.2/src/confmisc.c:392:(snd_func_concat) error
>> evaluating strings
>> ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4371:(_snd_config_evaluate)
>> function snd_func_concat returned error: No such file or directory
>> ALSA lib ../../alsa-lib-1.1.2/src/confmisc.c:1246:(snd_func_refer) error
>> evaluating name
>> ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4371:(_snd_config_evaluate)
>> function snd_func_refer returned error: No such file or directory
>> ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4850:(snd_config_expand)
>> Evaluate error: No such file or directory
>> ALSA lib
>> ../../../alsa-lib-1.1.2/src/pcm/pcm.c:2450:(snd_pcm_open_noupdate)
>> Unknown PCM default
>> aplay: main:786: audio open error: No such file or directory
> 

Which kernel version are you using ?
with 4.4+ you will have to enable alsa in boot config since it is disabled by
default which was not the case with 4.1. test it by setting
dtparam=audio=on in /boot/config.txt if it works then perhaps you can patch
it in recipes-bsp/bootfiles/rpi-config_git.bb and add a knob to enable/disable
alsa


> It looks like the default alsa device is configured to use card 0, but
> card 0 doesn't exist. What do "cat /proc/asound/cards" and "ls -l
> /dev/snd" print?
> 
> --
> Tanu
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-10-22 16:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-21 10:08 [meta-raspberrypi][question] how to setup alsa on rpi3? Piotr Lewicki
2016-10-21 11:26 ` Tanu Kaskinen
2016-10-21 11:45   ` Piotr Lewicki
2016-10-22 14:57     ` Tanu Kaskinen
2016-10-22 16:32   ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.