PDA

View Full Version : Digital Audio Help Suggestions


gateway69
2007-10-02, 23:15
Ok, I think I have tackled most of my issues with xbmc on linux and YES I do know its still in early stages thats why im posting here for the user support form.

I have video playing, some share stuff working (still fighting with vista/smba mounting files as root) but I have no idea how to get the digital audio to work.

On my shuttle box I have regular audio line out, optical and coaxel digital out.. How ever when plugging in either of the digital sources into my receiver I get no audio signal, and also looking in xbmc settings i don't have an options to switch from analog to digital...

anyone give me any advice or what to look at to get that up and running and choose which digital audio device to use. btw Ubuntu sees the audio devices in the hw manager.

rrambo
2007-10-02, 23:43
Hey gateway, did you check under System Settings>Music (or is it Sound) I can't remember? I'm not looking at it right now, but I think it's there at the top of the page.

slash
2007-10-03, 02:03
do you have a file .asound in your home directory ?

What type of sound card do you have ?

I have a via8332 working with SPDIF out to my receiver working fine.

gateway69
2007-10-04, 02:30
I dont have the shuttle box in front of me but it has both optical and coxal out on the mother board... so im assuming i need to set something in the .asound file.. I looked though the demo_asound one but not sure what I need to change .. is their an easy way to find out what sound is on the system in ubuntu?

gateway69
2007-10-04, 03:36
info on my system:

The XPC SN26P integrates the VIA Envy24PT multi-channel audio controller to deliver high-fidelity audio. Enabling 24-bit resolution and 96KHz sampling rates, the VIA Envy24PT provides support for the latest audio content through its analog and digital interfaces. Further, this model features 7.1-channel outputs enabling support for the latest Dolby Digital EX and DTS ES DVD-Video soundtracks.

http://global.shuttle.com/Product/Barebone/SN26P-features.asp

if anyone has any ideas what to set my asound to.. im all game.

slash
2007-10-04, 05:21
I found the alsa wiki for digital out very helpfull.

http://alsa.opensrc.org/index.php/DigitalOut

GIve it a try and let me know the results.

gateway69
2007-10-04, 23:40
thanks ill give it a shot tonight and see how this goes, I played around with it last night and no go..

btw where does .asound need to be in my user home folder? /etc/.asound or in the xbmc/BUILD folder?

babazoid
2007-10-05, 04:57
Hey Slash,

I've got the same sound card as you and I haven't got S/PDIF out working. It works fine with mplayer (-ac hwac3,) but not in XBMC Linux -- did I miss something, or did you apply the patch that I've been reading about in these forums?

I'll compile the latest SVN and see if I can get things working. I don't want to downmix AC35.1 -- after all I do have a 6ch surround receiver hooked up with optical s/pdif... I'd rather use it :)

babazoid
2007-10-05, 04:58
I should clarify, I've got XBMC working fine (S/PDIF out) in stereo mode (through alsa) but it won't output ac3 5.1ch surround.

slash
2007-10-05, 06:06
Well in my case I have SPDIF out working too the problem is I can't play any DVD from XBMC, so I can't figure out if it is dowmixing to stereo or not.

Anyone got a link to a divx file in DTS or Dolby Digital that I coul dtry to play ?

Or do you got DVD playback working ?

gateway69
2007-10-06, 01:46
rip your dvd using dvd decryptor to an iso, you should then be able to play that iso.. as a test.

im still working on my sound issues as well.

gateway69
2007-10-06, 20:09
update based upon this guide:

http://alsa.opensrc.org/index.php/DigitalOut

gateway@gateway-desktop:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: SN25P [Shuttle SN25P], device 0: ICE1724 [ICE1724]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: SN25P [Shuttle SN25P], device 1: IEC1724 IEC958 [IEC1724 IEC958]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: SN25P [Shuttle SN25P], device 2: ICE1724 Surrounds [ICE1724 Surround PCM]
Subdevices: 2/2
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1


so it looks like card 0 device 1 is the proper card

aplay -L gives me this output

cards 'cards.pcm'
front 'cards.pcm.front'
rear 'cards.pcm.rear'
center_lfe 'cards.pcm.center_lfe'
side 'cards.pcm.side'
surround40 'cards.pcm.surround40'
surround41 'cards.pcm.surround41'
surround50 'cards.pcm.surround50'
surround51 'cards.pcm.surround51'
surround71 'cards.pcm.surround71'
iec958 'cards.pcm.iec958'
spdif 'cards.pcm.iec958'
modem 'cards.pcm.modem'
phoneline 'cards.pcm.phoneline'
dsnoop 'cards.pcm.dsnoop'


which tells me I have iec958 'cards.pcm.iec958' spdif 'cards.pcm.iec958'

testing mplayer I get audio out of the coaxal cable..

mplayer s-condemned.mkv -ao alsa:device=plughw=0.1

debug out put Forced audio codec: mad
Opening audio decoder: [liba52] AC3 decoding with liba52
Using SSE optimized IMDCT transform
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, s16le, 640.0 kbit/41.67% (ratio: 80000->192000)
Selected audio codec: [a52] afm: liba52 (AC3-liba52)
================================================== ========================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)


now where im stuck is what to exactly put for the .asound in my ~ home folder.

this is what i currently have:

pcm.!dmix {
type dmix
ipc_key 1024
slave {
pcm {
type hw
card 0
device 1
}
period_size 512
buffer_size 8192
}
}

pcm.!default {
type hw
card 0
device 1
type plug
slave.pcm "dmix"
slave.channels 2
slave.rate 48000
route_policy duplicate
ttable.0.0 1 # front left speaker
ttable.1.1 1 # front right speaker
ttable.2.0 0.7 # rear left speaker
ttable.3.1 0.7 # rear right speaker
ttable.4.0 0.7 # center to left mapping
ttable.4.1 0.7 # center to right mapping
ttable.5.0 0.5 # LFE (base) to left mapping
ttable.5.1 0.5 # LFE to right mapping
}



when running a video on xbmc I get this error:

Creating audio device with codec id: 86020, channels: 6, sample rate: 48000, no pass-through
CALSADirectSound::CALSADirectSound - opening alsa device
ALSA lib pcm_plug.c:1189:(_snd_pcm_plug_open) Unknown field card
CALSADirectSound - pcm_open, alsa error: Invalid argument
Segmentation fault (core dumped)


so I guess im a bit stuck now, im sure its how my asoundrc is configured can anyone post theirs that has a working one... also how do you enable digital audio pass though for a DTS or Dolby digital receivers.?

im getting there, but I think this has been the hardest part for me so far for building xbmc on linux.

yuvalt
2007-10-11, 02:29
Quick update: today I committed all the fixes to enable digital output to work. No changes needed in .asoundrc or such. Do aplay -L to make sure you have either spdif and or iec958 there. Then go to Settings -> System -> Audio Settings and make sure that the names of the devices are correct, and that Digital is enabled.

Let me know if you have any issues with that.

-Yuval

knatsch
2007-10-11, 11:04
...and Dolby is working nicely :D
Thanks to the xbmc Dev Team!

gateway69
2007-10-11, 23:26
nice will give it a shot when i get home tonight...! this have pass though stuff as well or? and is .asoundrc ignored? if not whats a good sample config for anyone who has digital out and dolby or dts receiver.?

knatsch
2007-10-12, 00:36
I have no .asoundrc and I got Dolby and DTS audio. This was really easy to setup, just changed that setting in xbmc to digital output and enabled dolby & dts receiver :)

gateway69
2007-10-12, 19:48
I still seem to be having issues, here is the output from my aplay -L

cards 'cards.pcm'
front 'cards.pcm.front'
rear 'cards.pcm.rear'
center_lfe 'cards.pcm.center_lfe'
side 'cards.pcm.side'
surround40 'cards.pcm.surround40'
surround41 'cards.pcm.surround41'
surround50 'cards.pcm.surround50'
surround51 'cards.pcm.surround51'
surround71 'cards.pcm.surround71'
iec958 'cards.pcm.iec958'
spdif 'cards.pcm.iec958'
modem 'cards.pcm.modem'
phoneline 'cards.pcm.phone


in xbmc i enable digital and name the 2 defaults to iec958, now I dont get any audio coming out at all.

any thoughts?

gateway69
2007-10-12, 19:51
I still seem to be having issues, here is the output from my aplay -L

cards 'cards.pcm'
front 'cards.pcm.front'
rear 'cards.pcm.rear'
center_lfe 'cards.pcm.center_lfe'
side 'cards.pcm.side'
surround40 'cards.pcm.surround40'
surround41 'cards.pcm.surround41'
surround50 'cards.pcm.surround50'
surround51 'cards.pcm.surround51'
surround71 'cards.pcm.surround71'
iec958 'cards.pcm.iec958'
spdif 'cards.pcm.iec958'
modem 'cards.pcm.modem'
phoneline 'cards.pcm.phone


in xbmc i enable digital and name the 2 defaults to iec958, now I dont get any audio coming out at all.

any thoughts?

here is some additional output from xbmc debug log

-------
CDVDPlayerVideo - Stillframe detected, switching to forced 23.979143 fps
OnKey: 224 pressed, action is 13
CDVDPlayer::CloseFile()
CDVDPlayer::OnExit()
DVDPlayer: closing audio stream
Closing audio stream
waiting for audio thread to exit
AddPackets - More bytes left than can be stored in buffer
GetDelay - snd_pcm_delay, alsa error: Input/output error
GetDelay - snd_pcm_delay, alsa error: Input/output error
GetDelay - snd_pcm_delay, alsa error: Input/output error
CDVDPlayerAudio:: Resync - clock:0.000000, delay:-21359.375001
GetDelay - snd_pcm_delay, alsa error: Input/output error
Closing audio device
CALSADirectSound::Deinitialize
CALSADirectSound() dtor
CALSADirectSound::Deinitialize

Phobia
2007-10-14, 09:08
Hi there,

I also have had some trouble with 5.1 audio. I had to go into the alsamixer to un-mute the iec958 and then I was able to manage stereo audio.

I have also updated the audio section to have iec958 listed instead of "default".

Whenever I play a source with 5.1 audio, the video framerate slows to a crawl and playback eventually stops.

I do hear GUI & MP3 audio through the s/pdif, so it seems limited to AC3/DD.

Any suggestions?

-- Phob

PS - This is a brilliant effort - thanks!

gateway69
2007-10-15, 23:19
I'm also suffering from slow frame rate now since I got 5.1 and pass though working, and im also seeing some page tearing now in my videos.

snappz
2007-10-16, 03:15
I had XBMC working well with digital audio and outputting 1080i via component.
About 2 or 3 days ago I started getting the video slow down and page tearing.
After much hair pulling I rebuilt Gutsy and still had the problem.
I found the problem resolved itself when I reinstalled the video drivers. (restricted nvidia)
I had the problem even on a fresh install if I installed the video drivers before giving gutsy all its updates. Install last or reinstall and see how it goes.

snappz

gateway69
2007-10-16, 05:55
what driver are you using and are you using envy to install them?

if not, can you point me to a good walk though for installing the drivers w/o envy..

snappz
2007-10-16, 06:13
I just used the restricted driver manager. I dont use envy, but setting it up has been a slow process. But then I know very little about linux :)

My video card is PCIe nvidia 6600 gt using latest nvidia restricted driver
1 LCD monitor at 1024x768
1 KVHR36 Sony TV at 1080i

I've only recently got it to a stage that video playback is acceptable. (The last step I needed to do was enable Vsync on video playback in XBMC.

Have you got Mplayer installed as a seperate app? If not install and see if that plays back ok.

gateway69
2007-10-16, 07:45
hmm i dont see the option in xbmc to enable vsync. ?

btw what cpu are you using?

snappz
2007-10-16, 09:01
setting is in Settings -> Appearance -> screen -> Vertical Blanc Sync

P4 3ghz (HT)
1.256 GB ram

Plays most things ok including 1080i TS. Struggles a bit with x264 (drops a few frames etc)

Couldnt play a 1080p wmv with dts well at all. Only a few frames a second.

But I am still going through and tweeking video settings in xorg.conf and using different deinterlace and render methods.

fysa
2007-10-16, 17:13
I've posted the steps I've used for enabling SPDIF pass-through and analog->SPDIF PCM here: http://xbmc.org/forum/showthread.php?t=29131

Coca Cola Zero
2008-02-19, 09:45
I have two XBMC/Linux installations now, both on Core2Duo systems, one with an 8600GT and an X-Mystique sound card, the other with a 7600 GT and a Sondigo Inferno sound card, both systems running Ubuntu 7.10 pretty much standard but both upgraded to ALSA 1.0.16 (required on the Sondigo system since the card isn't supported with alsa 1.0.14).

The system with the 7600 GT / Sondigo Inferno has no noticable problems at all with digital audio, I have both passthrough and non-passthrough going to to my spdif port and then out to my audio receiver and the sound works perfectly and movies play correctly. On the 8600/X-Mystique box, the same videos play way too fast and there is no audio output coming out of XBMC when playing movies (I do get sound in the XBMC menus, and from other audio-capable Linux programs, though). I played around with alsamixer to see if any switches or volume settings there would fix things, but no luck yet. If anyone has seen something like this before and fixed it, I'd love to hear about. I'm going to keep tinkering myself though and I find out what the issue is on the one box, I'll post here again.