Sound problem

Discussion and support for the Pi-curious.

Sound problem

Postby abarbarian » Sat Jul 21, 2012 12:47 pm

Hi I have set up a Pi and as far as I can tell have set up alsa correctly.
I can hear a voice when I do

Code: Select all
$ aplay /usr/share/sounds/alsa/Front_Center.wav


But can not get sound any other way. None of the audio players I have tried work. I am trying to get "festival" to work but get

Code: Select all
@alarmpi ~]$ echo "This is an example. Arch is the best." | festival --tts
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM default
aplay: main:682: audio open error: No such file or directory
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory


Above is only a part of the error output.

I have scoured the net but can find no solution.
Can anyone offer any advice ??
Thanks.
:oops:
abarbarian
 
Posts: 12
Joined: Sat Jun 16, 2012 1:44 pm

Re: Sound problem

Postby pepedog » Sat Jul 21, 2012 1:16 pm

The sample has to be 44100kHz
Have you tried the package moc?

Here is a little festival script, if you saved script as sayit and made it exectutable, it works with-
sayit "hello world"
Code: Select all
#!/bin/bash

echo "$1" | text2wave -otype wav -F 44100 -o letter.wav ; ch_wave -otype riff -F 44100 -o file.wav -pc FIRST letter.wav letter.wav; aplay file.wav

What does this give?
aplay -L
pepedog
Developer
 
Posts: 1672
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Sound problem

Postby abarbarian » Sat Jul 21, 2012 8:27 pm

If my sound was set up correctly I was under the impression that this should give audio output.

Code: Select all
$ echo "This is an example. Arch is the best." | festival --tts


aplay -L gives me

Code: Select all
null
Discard all samples (playback) or generate zero samples (capture)


Never heard of moc but I will give it a go. I'm not at all sure what the script stuff is you so kindly gave so I will leave it for now thanks.

I am using a tv as a monitor and am trying to get audio through the jack socket. I forgot to mention that before.

Thanks. ;)
abarbarian
 
Posts: 12
Joined: Sat Jun 16, 2012 1:44 pm

Re: Sound problem

Postby abarbarian » Sat Jul 21, 2012 8:36 pm

I installed "moc" and when I try to run it I get similar out put as my first post and it finishes with

Code: Select all
FATAL_ERROR no valid sound driver


:oops:
abarbarian
 
Posts: 12
Joined: Sat Jun 16, 2012 1:44 pm

Re: Sound problem

Postby pepedog » Sat Jul 21, 2012 9:01 pm

You did load the sound driver? I assumed so as you played a sound.
What does lsmod show?
pepedog
Developer
 
Posts: 1672
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Sound problem

Postby abarbarian » Mon Jul 23, 2012 2:37 pm

Thanks for taking the time to help pepedog.

For some strange reason all the users on the Pi only belong to the user group despite having been set up as belonging to " audio,lp,optical,storage,video,wheel,games,power,scanner"
So I added meself to all of them and now moc works just fine with a nice sounding crackle free output.
However festival still does not work.
Did some digging and found this

ERROR reading file '/dev/snd/by-path/platform-bcm2835_AUDIO-0':File descriptor in bad state

which is probably why festival will not work along with the audio players. I think. Hmmm.

So I think I will do a fresh install and see if I can get festival working.

Many thanks again.

Treat this as solved. ;)
abarbarian
 
Posts: 12
Joined: Sat Jun 16, 2012 1:44 pm


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 3 guests