RaspbmcCrystalbuntu

Post Reply 
 
Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Alpha] usb sound cards support for raspbmc
07-08-2012, 05:12 PM (This post was last modified: 11-30-2012 12:38 AM by s7mx1.)
Post: #1
[Alpha] usb sound cards support for raspbmc
It finally arrived folks. If you have been patiently waiting for usb sound card/speakers for you pi then its time to get your hands dirty.

Before you are getting too excited here is the warning:
  • it's alpha quality and built/modified from the latest xbmc-rbp git repository. Don't be surprised to see crashes now and then.
  • occasional audio/video out of sync (read further for details)
  • very high cpu usage playing audio files


Some background for this built:
  • All the goodies from AudioEngine http://xbmc.org/dddamian/2012/05/30/xbmc-audio-goes-hd/
  • Skin/Menu sound now works!!
  • pulseaudio v2.0 as the backend which should avoid SRC if the hardware supports it
  • smart plug & play support and it shall recognize your usb sound card/speakers and automatically configure it for your.

I have included most useful pluseaudio addons therefore you should expect most exciting functionality from running pulseaudio on your pc, for example:
  • you NOW can streaming audio over network/wifi to a remote pulseaudio server
  • you NOW can streaming audio from your pc to pi over network/wifi.

Here is the instruction to get it install on your pi. Please login into your pi via ssh/putty as user pi

Step1: Install optimised pulseaudio
Code:
sudo apt-get install libltdl7
sudo rm -rf /usr/lib/arm-linux-gnueabihf/libpulse*
sudo rm -rf /usr/lib/arm-linux-gnueabihf/pulseaudio
sudo rm -rf /usr/share/pulseaudio
sudo rm -rf /usr/lib/pulseaudio
sudo rm -rf /usr/lib/pulse-2.0
sudo rm  /usr/lib/libpulse*
wget http://download.raspbmc.com/downloads/bin/pulse-2.1-noX.tar.gz -O /tmp/pulseaudio-2.1-hardfp.tgz
cd /
sudo tar xzf /tmp/pulseaudio-2.1-hardfp.tgz
sudo wget http://svn.stmlabs.com/svn/raspbmc/testing/oscore/lirc/lib/udev/rules.d/30-sound.rules -O /lib/udev/rules.d/30-sound.rules
sudo wget http://svn.stmlabs.com/svn/raspbmc/testing/oscore/lirc/lib/udev/set_volume -O /lib/udev/set_volume
sudo chmod 755 /lib/udev/set_volume
sudo initctl start pulseaudio

Step 2: Install AE enabled xbmc
As of 2012-11-27 nightly is AE enabled and to install it just go to raspbmc settings addon and install the latest nightly from there.

Step3: Configure xbmc to use AE
By default AE is turned off and to enable AE we need to go to raspbmc settings addon and go the system settings tab and enable "Audio Engine". Restart XBMC is needed (some user reported back that restart pi is needed in order for it to work)


Just to clarify that if audio engine is disabled then xbmc should behave exactly the same as the one of the xbmc nightly. Please also make sure HDMI is selected when audio engine is disabled if you want audio to go from hdmi.


USB workaround
If your usb 2.0 sound card/speakers produce distorted audio please put this entry into your /boot/cmdline.txt to force the built-in usb hub to run in usb 1.0/1.1 mode
Code:
dwc_otg.speed=1

Digital Passthrough
All you need to do is switch to the new multi-sink profile after you usb sound card is detcted (i.e. audio device list is showing other than default)
Code:
for card in $(pactl list short cards | awk '{print $1}') ; do pactl set-card-profile $card multi-sink;
done
then head over to xbmc's system settings and pick the right passthrough device.

Audio/Video Sync issues
  • Audio/Video can go out of sync for around 0.5 - 1 second when forward/backward skip is pressed during playback. Pause/Play has no effect on sync, i.e. you can play/pause many times you want and should not make audio and video out of syn as long as you do not seek
  • Please make sure your usb sound card/speakers has native support for 48K sample rate which is most sample rate used for video files. If the sound card/speakers does not native support the sample rate of the audio file, it will make the audio/video sync problems a lot worse.

Onboard audio (hdmi/analogue) device
With latest RC5 update this is not possible due to problem at compiling kernel alsa driver
=====================================
You can enable the experimental alsa driver for the onboard device by
Code:
sudo modprobe snd-bcm2835
This will not survive after a reboot and to make it auto load you should put a entry like snd-bcm2835 inside /etc/modules.
Audio/Video sync does not work reliable for the alsa driver snd-bcm2835 and if you experience out of sync at starting of the video you should stop it and then start it again.
Do not pause/play too often and too much for alsa driver snd-bcm2835 as this may cause xbmc/pulseaudio to freeze. If this happens you have to restart xbmc.

Performance turning
I would recommend use "Super" performance profile if you have usb install.

Trouble Shootings
If you see whitescreen loops then post the results of
Code:
ldd /home/pi/.xbmc-current/xbmc-bin/lib/xbmc/xbmc.bin

If there is no sound please run the following during audio/video playback
Code:
pactl list short sinks
pactl list clients
pactl list sink-inputs
and please also upload your xbmc.log and syslog

To unmute and set volume to full do
Code:
for sink in $(pactl list short sinks | awk '{print $1}') ; do pactl set-sink-mute $sink 0; pactl set-sink-volume $sink 100%; done
and go through every single audio devices by replacing 0 by 1 2 ... etc

Revert back
If for any reasons that it did not work for you its really easy to revert back, just run
Code:
rm /home/pi/.xbmc-current
and revert and changes made to /etc/modules
Find all posts by this user
Quote this message in a reply
07-08-2012, 05:39 PM
Post: #2
RE: [Alpha] usb sound cards support for raspbmc
Good work, it makes sense to put in this forum rather than the testing one as USB sound card users is scarce at the moment.
Visit this user's website Find all posts by this user
Quote this message in a reply
07-11-2012, 01:23 AM
Post: #3
RE: [Alpha] usb sound cards support for raspbmc
Gave this a shot, xbmc is super-unstable (it crashed 3x just trying to install the youtube addon). Couldn't get videos to play. Did get (distorted) sound when paging through menus though.

I edited config.txt with the usb line, but when I run "reboot" it seems to....not actually reboot. The screen goes blank but even if I leave for 15 minutes and come back, the system hasn't rebooted. Only pulling the power and reapplying resets it. (and after that, it just boots to the raspbmc logo, not back into xbmc)
Find all posts by this user
Quote this message in a reply
07-12-2012, 07:37 PM
Post: #4
RE: [Alpha] usb sound cards support for raspbmc
My usb headset works with music and menu sounds. but when i play movies there is no sound Sad Anyone?
Find all posts by this user
Quote this message in a reply
07-12-2012, 08:18 PM (This post was last modified: 07-12-2012 08:18 PM by s7mx1.)
Post: #5
RE: [Alpha] usb sound cards support for raspbmc
If you read through the first post I mentioned it clearly only for menu sound and audio file playback. I may have a go to strip the audio out but don't count on it.

(07-12-2012 07:37 PM)timted3 Wrote:  My usb headset works with music and menu sounds. but when i play movies there is no sound Sad Anyone?
Find all posts by this user
Quote this message in a reply
07-12-2012, 08:25 PM
Post: #6
RE: [Alpha] usb sound cards support for raspbmc
Sorry, i didn't read that part :$ I'll wait Smile
Find all posts by this user
Quote this message in a reply
07-13-2012, 04:15 PM
Post: #7
RE: [Alpha] usb sound cards support for raspbmc
when i try the following step:

mkdir ~/.upgrade/xbmc-rbp-pulseaudio-20120706

it returns in an error:

mkdir: cannot create directory `/home/pi/.upgrade/xbmc-rbp-pulseaudio-20120706': No such file or directory

any ideas?
Find all posts by this user
Quote this message in a reply
07-13-2012, 04:16 PM
Post: #8
RE: [Alpha] usb sound cards support for raspbmc
Are you using the latest rc3?



(07-13-2012 04:15 PM)harmenzon Wrote:  when i try the following step:

mkdir ~/.upgrade/xbmc-rbp-pulseaudio-20120706

it returns in an error:

mkdir: cannot create directory `/home/pi/.upgrade/xbmc-rbp-pulseaudio-20120706': No such file or directory

any ideas?
Find all posts by this user
Quote this message in a reply
07-13-2012, 04:24 PM
Post: #9
RE: [Alpha] usb sound cards support for raspbmc
yes, just installed the latest clean rc3 again without any nightly builts.

(07-13-2012 04:16 PM)s7mx1 Wrote:  Are you using the latest rc3?



(07-13-2012 04:15 PM)harmenzon Wrote:  when i try the following step:

mkdir ~/.upgrade/xbmc-rbp-pulseaudio-20120706

it returns in an error:

mkdir: cannot create directory `/home/pi/.upgrade/xbmc-rbp-pulseaudio-20120706': No such file or directory

any ideas?
Find all posts by this user
Quote this message in a reply
07-13-2012, 04:27 PM
Post: #10
RE: [Alpha] usb sound cards support for raspbmc
Just modified the mkdir command and you can just follow from mkdir onwards.

(07-13-2012 04:24 PM)harmenzon Wrote:  yes, just installed the latest clean rc3 again without any nightly builts.

(07-13-2012 04:16 PM)s7mx1 Wrote:  Are you using the latest rc3?



(07-13-2012 04:15 PM)harmenzon Wrote:  when i try the following step:

mkdir ~/.upgrade/xbmc-rbp-pulseaudio-20120706

it returns in an error:

mkdir: cannot create directory `/home/pi/.upgrade/xbmc-rbp-pulseaudio-20120706': No such file or directory

any ideas?
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Sponsored Advertisement