Using RCA jack for audio


24 posts
by astrodog » Wed Dec 26, 2012 10:15 pm
Hi,

I am a complete noob. I installed xbian on my Pi and plugged it into my old TV, which doesnt take HDMI, I amanaged to play videos but I dont know how to get the sound to work. I tried plugging in the red and white jacks into the audio output of the Pi, but alas, it did not work - Is there anything I have to do toget the sound working as is (i.e. without having to buy more hardware?)

Thanks!!
Posts: 7
Joined: Wed Dec 26, 2012 10:09 pm
by sblar » Thu Dec 27, 2012 11:54 am
You need to tell pi where to send sound:

sudo amixer cset numid=3 <output>

0=auto
1=headphones
2=hdmi

In your case, run this command:
sudo amixer cset numid=3 1
Posts: 11
Joined: Sun Dec 02, 2012 7:08 pm
by astrodog » Thu Dec 27, 2012 8:48 pm
Hi,

Thanks for your advice. Unfortunately I exited the xbian and once I got to the commnd prompt I entered the commands you recommended but the command was not recognized...

Thanks
Posts: 7
Joined: Wed Dec 26, 2012 10:09 pm
by redhawk » Thu Dec 27, 2012 9:25 pm
Try: apt-get install alsa-utils then run amixer again.

Richard S.
User avatar
Posts: 3519
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1
by astrodog » Fri Dec 28, 2012 2:21 am
Thanks Richard,
I tried your suggestion after using xbian as the login and raspberry as the password. I got the following reply:
Could not open lock file /var/lib/dpkg/lock - open (13:permission denied) Unable to lock the administration directory (/var/lib/dpkg/), are you root?

I have searched in vaious forums and they all seem to agree that xbian and raspberry are the root login... is there something I am missing?

Thanks!
Posts: 7
Joined: Wed Dec 26, 2012 10:09 pm
by rpdom » Fri Dec 28, 2012 7:16 am
Can you try sudo apt-get install alsa-utils

That should run the command as the "root" user.
User avatar
Posts: 3756
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK
by astrodog » Fri Dec 28, 2012 3:34 pm
Thanks everyone! I ran sudo apt-get update, then I ran sudo apt-get install alsa-utils, but when I try to run sudo amixer cset numid=3 1 it replies:

amixer: control default open error: no such file or directory

when I try to run just sudo amixer cset it replies:

Specify a full control identifier: [[iface=<iface>,][name='name',][index=<index>,][device=<device>,][subdevice=<subdevice>]]|[numid=<numid>]

Is there something I am missing?

Thanks
Posts: 7
Joined: Wed Dec 26, 2012 10:09 pm
by rpdom » Fri Dec 28, 2012 4:42 pm
Try sudo modprobe snd-bcm2835 then the sudo amixer command again.

If that works, you should add "snd-bcm2835" (without the quotes) to the end of /etc/modules to make this work automatically at boot time.
User avatar
Posts: 3756
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK
by sblar » Fri Dec 28, 2012 4:48 pm
You could try this:

sudo amixer cget numid=1
sudo amixer cget numid=2
sudo amixer cget numid=3
sudo amixer cget numid=4

I'm not sure what it will give you, but in my case numid=3 returns:
numid=3,iface=MIXER,name='PCM Playback Route'
; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0
: values=1

and I guess that 'PCM Playback Route' is what we are looking for. Maybe it has another numid in your case, even though I can't imagine why.
Posts: 11
Joined: Sun Dec 02, 2012 7:08 pm
by sblar » Fri Dec 28, 2012 4:53 pm
Just remembered, you must first load the sound driver:
sudo modprobe snd_bcm2835
Posts: 11
Joined: Sun Dec 02, 2012 7:08 pm
by sblar » Fri Dec 28, 2012 5:03 pm
Last thing: To avoid having to start the sound driver after boot, make an entry in /etc/modules, like this;

sudo su
echo snd_bcm2835>>>>/etc/modules
exit

And to check the change:
cat /etc/modules
Posts: 11
Joined: Sun Dec 02, 2012 7:08 pm
by sblar » Fri Dec 28, 2012 5:05 pm
And I should learn to read before I post; rpdom has already said the same thing...
Posts: 11
Joined: Sun Dec 02, 2012 7:08 pm
by PaulusV » Sat Dec 29, 2012 1:15 pm
The audio output takes no white or red RCAjack, it needs a stereo 3.5 mm audio jack. You'll need a cable like the one here:
https://dx.com/p/3-5mm-audio-jack-male- ... -30cm-5143
Posts: 1
Joined: Sat Dec 29, 2012 1:10 pm
by sblar » Sat Dec 29, 2012 5:34 pm
Since there is not phono jacks on the Pi, I'm pretty sure astrodog meant the other end of the cable, when he said red and white jack ;)
Posts: 11
Joined: Sun Dec 02, 2012 7:08 pm
by astrodog » Sat Dec 29, 2012 5:38 pm
Hi guys, thanks for all your help, the pi community is awesome! I just tried Paulus' idea and it works like a charm!

Thanks again to all! :D
Posts: 7
Joined: Wed Dec 26, 2012 10:09 pm
by astrodog » Sat Dec 29, 2012 5:41 pm
Sblar, I plugged in the yellow jack for video and I was trying to use the red or white jacks... I figured just one of the jacks should do it.... obviously I was very wrong and like you say,the pi just doesnt take it.

Thanks for all your help^!!
Posts: 7
Joined: Wed Dec 26, 2012 10:09 pm
by davehiggins21 » Mon Jan 21, 2013 7:00 pm
I've been trying to set up the DLNA streaming system as specified by Stephen Phillips which I've managed to get working apart from getting the sound out of the RCA jack. I get the sound out via the HDMI port and when I issue the amixer command I get the following.

pi@raspberrypi ~ $ sudo amixer cset numid=3 1
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Access denied

amixer: Control default open error: Connection refused

Is there some connection with PulseAudio that is stopping the command working. I've had it working before without PulseAudio installed.

Cheers Dave
Posts: 42
Joined: Thu Jan 26, 2012 10:04 am
by astrodog » Mon Jan 21, 2013 7:10 pm
Hi dave,

have you tried the 3.5mm audio jack that Paulus suggested? It worked great for me
Posts: 7
Joined: Wed Dec 26, 2012 10:09 pm
by davehiggins21 » Tue Jan 22, 2013 8:56 am
Of course I didn't mean the Composite RCA Phono - I meant the 3.5 mm jack. The amixer command should switch the sound output from HDMI to the 3.5 mm jack but the command fails. I think I'll try reinstalling and setting it to the correct output before installing PulseAudio - might make the difference.

Dave
Posts: 42
Joined: Thu Jan 26, 2012 10:04 am
by davehiggins21 » Tue Jan 22, 2013 12:09 pm
Yes that worked fine. I redid the build after issuing the 'sudo amixer cset numid=3 1' command and kept checking that it worked by doing a 'sudo speaker-test' after each section of the install - and it all works.

yippee

Dave
Posts: 42
Joined: Thu Jan 26, 2012 10:04 am
by xkaspian » Thu Dec 05, 2013 9:23 am
Hello,
I have similar problems with the sound on Raspbmc. If i put the headphones the sound comes.
As I have read here I have to buy a cable 3.5mm Audio Jack (male) to RCA Audio Converter and connect of course to the Audio output of my raspberry pi.

My TV has just DVI and Minicinch.

My setup is the following :
HDMI to DVI cable from raspberry to the TV
Minicinch to cinch (red/white) from the TV.

Is it just enough to connect the RCA Converter to my Minicinch to cinch or have I to run some commands in the terminal ?? The Raspbmc has no terminal. I didn't find one :))

Thankx for your help
Posts: 3
Joined: Thu Dec 05, 2013 9:11 am
by fredoll » Thu Dec 05, 2013 10:34 am
In XBMC (RaspBMC) there's a setting in the system preferences for audio analog/digital : choose analog 2.0
Posts: 73
Joined: Thu Jan 10, 2013 10:30 am
by xkaspian » Thu Dec 05, 2013 11:54 am
Thx.

That I choose already yesterday but didn't work.
I bought me now the recommended cable from paulus and will try it in the evening.
Posts: 3
Joined: Thu Dec 05, 2013 9:11 am
by xkaspian » Fri Dec 06, 2013 6:56 am
Hello again,

I connect yesterday the cable recommended by paulus.
I get anyway no sound over the TV. Sound comes from the raspberry to some extern pc loudspeaker and headphones but not to the TV. If I switch the TV to PC Mode, I get the film but no sound and if I switch to HD Modus, I hear the sound but can not watch the film.
Raspbmc is set to Audio analog 2.0.

Would need some help.
Posts: 3
Joined: Thu Dec 05, 2013 9:11 am