Thread Rating:
  • 0 Vote(s) - 0 Average
Linux - [SOLVED] No menu sound in XBMC
#1
Hello,

I run XBMC-xvba on Ubuntu 12.04 on my Zotac ZBOX AD04.

I have sound in movies, but NOT in XBMC itsself (no menu sound).

I can get it to work by setting up "dmix" in .asoundrc, but that is a bad solution because sometimes the sound in movies gets distorted.

This is my aplay -l:
Code:
[email protected]:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 1: ALC892 Digital [ALC892 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

This is my .asoundrc:
Code:
[email protected]:~$ cat .asoundrc
pcm.!default {
  type plug
  slave {
#    pcm "hw:1,0" #delete the first hash for sound over analog
#    pcm "hw:1,1" #delete the first hash for sound over optical
     pcm "hw:0,3" #delete the first hash for sound over hdmi
     rate 48000
  }
}

In XBMC sound settings are "defaults (ALSA) and passthrough custom hw:0,3"

Something interesting;
Code:
[email protected]:~$ aplay -D plughw:0,3 /usr/share/sounds/alsa/Front_Center.wav
aplay: main:682: audio open error: Device or resource busy

I get this error message, when XBMC is run, so somehow something blocks the soundcard until I start playing a movie?
Reply
#2
Post the output of aplay -L
HTPC 1 - Zotac ZBOX ID80U | 4GB RAM | 64GB SSD | Openelec | Confluence
HTPC 2 - Zotac ZBOX ID41U | 4GB RAM | 60GB SSD | Openelec | Confluence
Server - unRAID Server | 3 x 2TB WD Green HDD, 1TB WD Black HDD (Cache) | Sabnzbd | CouchPotato | Sickbeard
Reply
#3
(2012-06-10, 17:52)Plaguester Wrote: Post the output of aplay -L

Code:
[email protected]:~$ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default
hdmi:CARD=Generic,DEV=0
    HD-Audio Generic, HDMI 0
    HDMI Audio Output
dmix:CARD=Generic,DEV=3
    HD-Audio Generic, HDMI 0
    Direct sample mixing device
dsnoop:CARD=Generic,DEV=3
    HD-Audio Generic, HDMI 0
    Direct sample snooping device
hw:CARD=Generic,DEV=3
    HD-Audio Generic, HDMI 0
    Direct hardware device without any conversions
plughw:CARD=Generic,DEV=3
    HD-Audio Generic, HDMI 0
    Hardware device with all software conversions
sysdefault:CARD=SB
    HDA ATI SB, ALC892 Analog
    Default Audio Device
front:CARD=SB,DEV=0
    HDA ATI SB, ALC892 Analog
    Front speakers
surround40:CARD=SB,DEV=0
    HDA ATI SB, ALC892 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=SB,DEV=0
    HDA ATI SB, ALC892 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=SB,DEV=0
    HDA ATI SB, ALC892 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=SB,DEV=0
    HDA ATI SB, ALC892 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=SB,DEV=0
    HDA ATI SB, ALC892 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=SB,DEV=0
    HDA ATI SB, ALC892 Digital
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=SB,DEV=0
    HDA ATI SB, ALC892 Analog
    Direct sample mixing device
dmix:CARD=SB,DEV=1
    HDA ATI SB, ALC892 Digital
    Direct sample mixing device
dsnoop:CARD=SB,DEV=0
    HDA ATI SB, ALC892 Analog
    Direct sample snooping device
dsnoop:CARD=SB,DEV=1
    HDA ATI SB, ALC892 Digital
    Direct sample snooping device
hw:CARD=SB,DEV=0
    HDA ATI SB, ALC892 Analog
    Direct hardware device without any conversions
hw:CARD=SB,DEV=1
    HDA ATI SB, ALC892 Digital
    Direct hardware device without any conversions
plughw:CARD=SB,DEV=0
    HDA ATI SB, ALC892 Analog
    Hardware device with all software conversions
plughw:CARD=SB,DEV=1
    HDA ATI SB, ALC892 Digital
    Hardware device with all software conversions
[email protected]:~$

I have to mention, that currently I listen through my 2.0 TV speakers via HDMI.

And this is the .asoundrc, where I have functional menu sounds, but sometimes distorted sound. Maybe something is wrong in those dmix settings? I don't mind dmix, as long it gives me good sound Smile

Code:
#pcm.dmixer {
#       type dmix
#       ipc_key 2048
#       ipc_key_add_uid false
#       ipc_perm 0660
#       slave {
#               pcm "hw:0,3"
#               rate 48000
#               channels 2
#               period_time 0
#               period_size 2048
#               buffer_time 0
#               buffer_size 4096
#               }
#       }
#
#pcm.!default {
#type plug
#slave.pcm "dmixer"
#}

Thank you!
Reply
#4
I use this with my ad02 for hdmi out with menu sound, see if this works. The other one to try was use exactly as yours but take out the "rate 48000" line.

Code:
pcm.!default {
type plug
slave {
pcm "hdmi"
}
}

Reply
#5
Try this:
Code:
speaker-test -D plug:hdmi
Ctrl+C quits.

If that works, then "hdmi (ALSA)" is the correct audio device (and most likely the correct passthrough device as well; that or custom with "hdmi:CARD=Generic,DEV=0"). I'd try completely without the .asoundrc file first (rename it to something else, log out, and log back in).

If you don't get menu sounds, try this .asoundrc:
Code:
pcm.!default {
    type plug
    slave {
        pcm "hdmi_hw"
    }
}

pcm.hdmi_hw {
        type hw
        card 0
        device 3
        channels 2
}
HTPC 1 - Zotac ZBOX ID80U | 4GB RAM | 64GB SSD | Openelec | Confluence
HTPC 2 - Zotac ZBOX ID41U | 4GB RAM | 60GB SSD | Openelec | Confluence
Server - unRAID Server | 3 x 2TB WD Green HDD, 1TB WD Black HDD (Cache) | Sabnzbd | CouchPotato | Sickbeard
Reply
#6
Thank you!

1. After deleting .asoundrc, "speaker-test -D plug:hdmi" worked:

Code:
[email protected]:~$ speaker-test -D plug:hdmi

speaker-test 1.0.25

Playback device is plug:hdmi
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 16384
Period size range from 32 to 8192
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
0 - Front Left
Time per period = 2.649388
0 - Front Left
Time per period = 2.983922
0 - Front Left
Time per period = 2.988086
0 - Front Left
Time per period = 2.983907
0 - Front Left
Time per period = 2.983855
0 - Front Left
Time per period = 2.987779
0 - Front Left

BUT I still had no menu sounds. So I tried your .asoundrc:
And it works! Now I have working movie AND menu/XBMC sounds. Thank you very much! Smile
Reply
#7
One more question:

As I said, XBMC menu sounds work now, BUT sounds do not work anymore in zSNES / ultrastar-deluxe. I start both from XBMC within via script.

I checked the console and this happens:

Code:
ALSA lib pcm_dsnoop.c:612:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave


I tried something like this:
Code:
export SDL_AUDIODRIVER=alsa
export AUDIODEV=hw:0,3
/usr/local/bin/ultrastardx

but it didn't change anything. Does anybody have an idea what can be done?

Maybe XBMC locks the soundcard exclusively?
This would explain the following, when XBMC is running:

Code:
[email protected]:~$ speaker-test -D plug:hdmi

speaker-test 1.0.25

Playback device is plug:hdmi
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Playback open error: -16,Device or resource busy

Maybe it is worth mentioning that I start XBMC with lightdm?
Code:
[email protected]:~$ cat /usr/share/xsessions/XBMC.desktop
[Desktop Entry]
Name=XBMC
Comment=This session will start XBMC Media Center
Exec=xbmc-standalone
TryExec=xbmc-standalone
Type=Application

Maybe I should start XBMC in a different way, so that the card is not locked?
Reply
#8
at a guess, pulseaudio is not running because as you said, the sound device is being locked by another process.

Should just be a matter of pointing it to the sound device directly but as to how i couldnt say....

Thats at a guess though Smile
Reply
#9
Thank you, somehow pulseaudio was not installed?

I (re)installed and... it works! Smile Still get this error, but it doesn't matter. XBMC movies + menu sounds + ultrastar now all have sound! YES YES!

Code:
ALSA lib pcm_dsnoop.c:612:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave

Reply
#10
Superb Plaguester!!!

I have fixed my ALSA issues by looking at this thread.

Many thanks for your great help!

Regards,
hth0923
Reply



[SOLVED] No menu sound in XBMC00