Sound from external apps (wine, spotify, firefox... in HMI Dharma beta4 on Ion nettop
#1
Thumbs Up 
Hello,

first of all congratulations to the dev team for such an amazing product. I LOOOOOVE XBMC. I hope the following information can be helpful to make the final Dharma version more straightforward to configure.

I've been having trouble with the sound in Dharma beta 4 live installed on my Foxconn NT-330I-A-B-NA-A NVIDIA ION, connected via HDMI to my TV. After the initial setup and running alsamixer to unmute the HDMI channel, I could hear music and video playback but no navigation sounds. But the main problem is that I wanted to run also external software (particularly Spotify through wine but also firefox and some other stuff) and I couldn't get that to work either. After many, many hours of work (mostly digging up stuff in this forum and some other external sources) I found a perfect solution (for my anyway), so I'll post it here in case it helps someone else. I'm not an ALSA expert so perhaps not all of the following steps are necessary but hopefully they can point the real experts in the right direction.

In the main user directory, create (or replace if it already exists) the .asoundrc file with the following:
Code:
pcm.dmixer {
type dmix
ipc_key 1024
ipc_key_add_uid false
ipc_perm 0660
slave {
pcm "hw:0,3"
rate 48000
channels 2
period_time 0
period_size 1024
buffer_time 0
buffer_size 4096
}
}

pcm.!default {
type plug
slave.pcm "dmixer"
}
When you reboot your htpc it will overwrite this file so make a copy of it and reset it at the beginning of your X session, like this:
Code:
cp .asoundrc my_asoundrc
echo "cp ~/my_asoundrc ~/.asoundrc" >> .xsessionrc

Then edit the file /etc/modprobe.d/alsa-base.conf and add the following line at the end:
Code:
alias snd-card-0 snd-hda-codec-nvhdmi

To illustrate the next step with an example, let's say we want to run Spotify. First reboot, install wine, run winecfg (go to the Audio tab, make sure Alsa is selected and click "test sound"; you should hear a sound sample). Add the following script, e.g. in the home directory and don't forget to make it executable:
Code:
#!/bin/bash
fluxbox &
/usr/bin/wine /home/hsocas/.wine/drive_c/Program\ Files/Spotify/spotify.exe
killall -9 fluxbox

Then go back to xbmc (Ctrl+F7), go to Programs and install the Executor Addon. In Executor, configure the plugin to add the script you just created in the previous step. Now you should have all your sounds enabled, including navigation sounds, spotify (or whatever you installed) and of course the XBMC playback.

And that's it. Pretty simple, huh? Smile

Comments?
Reply
#2
Ok, good work.

I guess the problem was you needed resampling (rate 48000)?

If you are still interested there is another thing you could try to get some sort of auto-resample in xbmc. (didnt think of it earlier)

Use custom sound setting:
Quote:plug:hdmi
or
Quote:plughw:0,3

Together with a small "deafult" asoundrc to fix nav sound and browser it SHOULD be fine. Wine I have no clue of course.
Reply
#3
vikjon0 Wrote:I guess the problem was you needed resampling (rate 48000)?

Really? I thought it was using the dmixer that did the trick (together with the alias in alsa-base.conf)
Reply
#4
Quote:Really?
No, I think by now you are the expert.Smile
The resample thing is an issue I had earlier with flash in ff, thats why I jumped to that conclusion. The alias stuff I have no understanding of. As I said, good work.
Reply

Logout Mark Read Team Forum Stats Members Help
Sound from external apps (wine, spotify, firefox... in HMI Dharma beta4 on Ion nettop0