(Audio setup) Problems with XBMC + USB DAC configuration
#1
Hi Guys,

I have some trouble connecting my DAC to XBMC.

I have been googling this issue for 2 weeks now and I am not able to find the sollution... So I hope someone here can help me fix it

I think it has something to do with the decoding because I have sound, but the quality is very bad. There is a lot of clipping and sometimes the sound just stops for a few seconds.

I am running an xbmc session on an ubuntu 12.04 and i use LXDE for troubleshooting (unity was too heavy). The DAC is connected through USB.

1. When I hook up my other laptop to the DAC and play some movies, I have no problems
2. When open an lxde session and play the same MKV movie in VLC I have very good sound quality.
Image

3.When I play the movie in xbmc with the internal laptop speakers selected in the sound settings, the sound is quite good (if you ignore of the bad quality of the speakers)

=> this lead me to believe that:
a. The sound is not sent to the DAC correctly
b. XBMC does some CPU intensive decoding when sending files to the DAC and can't keep up
c. Something else...

To select the DAC in xbmc, I tried amost every setting.
Optical/coax and Analog seems to work best
As output device and passthrough I selected:
Code:
USB Audio CODEC - ie958 - 0 (ALSA)

(since the others wouldn't work)

After reading some topics about xbmc sound I tried setting it to custom and entering
Code:
hw:1,0
or
Code:
plughw:1,0

Plughw seems to work a little better (less dropouts), but the quality is still very bad

It's interesting to note that the system sounds (the clicking sound when browsing xbmc) are coming from the internal laptop speakers no matter what. This is not a problem for me, just something i noticed.

Can point me in the right direction or walk me through fixing this? I am quite dissapointed that I have a rather expensive dac lying around whie listening to audiotracks on my internal speakers Smile

Here are some more details about the system

aplay -l

Code:
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC260 Analog [ALC260 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

Specs:

Code:
The DAC: Beresford TC-7520SE Caiman

The system is a (very) old acer aspire 1640 laptop
Code:
Processor: Intel Pentium M 1,73GHz
2MB L2 cache
Core Logic Chipset Intel 915GM
System Bus Speed 533 MHz
RAM: 1GB
I upgraded the ram recently from 256, but saw no real advantage. I suspect the CPU is the bottleneck.



Thanks!

Tim
Reply
#2
Is there noone who has some sugesstions on what could have gone wrong?

I noticed today that I have better sound quality when using "default: CARD=CODEC,DEV=0" as audio setting. But after 30 min of good sound during an episode I had another dropout for the remainder of the episode. The only way to get the sound back was to stop the video (stop, not pauze), wait some time and then start it again.

I have been trying every setting and I am really curious why "hw" gives me worse quality than "dmix" and "default".

Regards,

Tim
Reply
#3
http://forum.xbmc.org/showthread.php?tid=34655

Also ls /proc/asound
lsusb
output of dmesg when you insert the DAC
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#4
Hi Guys,

I am sorry for the late reply, I suddenly had to go on a businesstrip and had no acces to my XBMC machine for a few weeks...
Thanks for your help, Nickr!

Here some more info as requested:

System:
Code:
i686
XBMC 11.0 GIT:Unknown(Compiled:Apr 24 2012)
Aeon Nox skin


here are the results of ls /proc/asound:
Code:
card0  cards  devices  Intel    oss  seq     version
card1  CODEC  hwdep    modules  pcm  timers

and lsusb:
Code:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 04e8:5f06 Samsung Electronics Co., Ltd
Bus 003 Device 002: ID 08bb:2902 Texas Instruments Japan PCM2902 Audio Codec

dmesg (when inserting the DAC):
Code:
[  571.372057] usb 3-2: new full-speed USB device number 3 using uhci_hcd
[  571.740346] input: Burr-Brown from TI               USB Audio CODEC  as /devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.3/input/input8
[  571.740703] generic-usb 0003:08BB:2902.0002: input,hidraw0: USB HID v1.00 Device [Burr-Brown from TI               USB Audio CODEC ] on usb-0000:00:1d.1-2/input3

So what am I looking for? How do I go on from here?

thanks,

Tim



Reply
#5
I would observe that the dmesg looks incomplete and XBMC v11 is well outdated.
Post at least the last 10 lines on dmesg to ensure if thers any drivers needed Linux is loadinding them all the time. (as I know Linux is naff with usb driver loading from cold boot)

uNi
Reply
#6
I stuck with XBMC v11 since I never got the audio working in the first place and I heard taht in v12 there are a lot of problems with the audio. But If you think it's better to upgrade to v12, I am willing to try that.

Here is the dmesg with more lines:
(I did a reboot and pluged in the DAC after the machine was booted up)

Code:
...
[   19.947023] ipw2200: Copyright(c) 2003-2006 Intel Corporation
[   20.043278] i915 0000:00:02.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[   20.043287] i915 0000:00:02.0: setting latency timer to 64
[   20.084816] yenta_cardbus 0000:06:01.0: ISA IRQ mask 0x0cf8, PCI irq 18
[   20.084822] yenta_cardbus 0000:06:01.0: Socket status: 30000007
[   20.084828] pci_bus 0000:06: Raising subordinate bus# of parent bus (#06) from #07 to #08
[   20.084838] yenta_cardbus 0000:06:01.0: pcmcia: parent PCI bridge window: [io  0x2000-0x2fff]
[   20.084842] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x2000-0x2fff: excluding 0x2000-0x20ff 0x2400-0x24ff
[   20.090121] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
[   20.090125] [drm] Driver supports precise vblank timestamp query.
[   20.142083] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
[   20.154686]  0x2800-0x28ff
[   20.181350] yenta_cardbus 0000:06:01.0: pcmcia: parent PCI bridge window: [mem 0xb0100000-0xb01fffff]
[   20.181356] pcmcia_socket pcmcia_socket0: cs: memory probe 0xb0100000-0xb01fffff: excluding 0xb0100000-0xb010ffff
[   20.181374] yenta_cardbus 0000:06:01.0: pcmcia: parent PCI bridge window: [mem 0x44000000-0x47ffffff pref]
[   20.181378] pcmcia_socket pcmcia_socket0: cs: memory probe 0x44000000-0x47ffffff: excluding 0x44000000-0x47ffffff
[   20.242624] ipw2200 0000:06:04.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[   20.242657] ipw2200: Detected Intel PRO/Wireless 2200BG Network Connection
[   20.474056] init: failsafe main process (692) killed by TERM signal
[   20.506354] psmouse serio1: synaptics: Touchpad model: 1, fw: 6.2, id: 0x12a0b1, caps: 0xa04713/0x204000/0x0
[   20.543227] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input6
[   20.707261] Bluetooth: Core ver 2.16
[   20.707321] NET: Registered protocol family 31
[   20.707324] Bluetooth: HCI device and connection manager initialized
[   20.707328] Bluetooth: HCI socket layer initialized
[   20.707331] Bluetooth: L2CAP socket layer initialized
[   20.707343] Bluetooth: SCO socket layer initialized
[   20.727563] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   20.727568] Bluetooth: BNEP filters: protocol multicast
[   20.740673] [drm] initialized overlay support
[   20.943755] type=1400 audit(1359752776.276:5): apparmor="STATUS" operation="profile_load" name="/usr/lib/lightdm/lightdm/lightdm-guest-session-wrapper" pid=781 comm="apparmor_parser"
[   20.962682] type=1400 audit(1359752776.296:6): apparmor="STATUS" operation="profile_replace" name="/sbin/dhclient" pid=784 comm="apparmor_parser"
[   20.979568] type=1400 audit(1359752776.312:7): apparmor="STATUS" operation="profile_replace" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=784 comm="apparmor_parser"
[   20.979932] type=1400 audit(1359752776.312:8): apparmor="STATUS" operation="profile_replace" name="/usr/lib/connman/scripts/dhclient-script" pid=784 comm="apparmor_parser"
[   21.064988] type=1400 audit(1359752776.400:9): apparmor="STATUS" operation="profile_load" name="/usr/bin/evince" pid=787 comm="apparmor_parser"
[   21.081951] type=1400 audit(1359752776.416:10): apparmor="STATUS" operation="profile_load" name="/usr/bin/evince//launchpad_integration" pid=787 comm="apparmor_parser"
[   21.085870] type=1400 audit(1359752776.420:11): apparmor="STATUS" operation="profile_load" name="/usr/bin/evince//sanitized_helper" pid=787 comm="apparmor_parser"
[   21.087409] ppdev: user-space parallel port driver
[   21.123247] cfg80211: World regulatory domain updated:
[   21.123252] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   21.123256] cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   21.123260] cfg80211:     (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   21.123264] cfg80211:     (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   21.123267] cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   21.123271] cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   21.172261] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x100-0x3af: excluding 0x170-0x177 0x1f0-0x1f7 0x370-0x377
[   21.270489] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x3e0-0x4ff: excluding 0x3f0-0x3f7 0x4d0-0x4d7
[   21.271214] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x820-0x8ff: clean.
[   21.271804] pcmcia_socket pcmcia_socket0: cs: IO port probe 0xc00-0xcf7: clean.
[   21.349370] pcmcia_socket pcmcia_socket0: cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xc7fff 0xcc000-0xd3fff 0xe0000-0xe3fff 0xe8000-0xfffff
[   21.349412] pcmcia_socket pcmcia_socket0: cs: memory probe 0xa0000000-0xa0ffffff: clean.
[   21.349450] pcmcia_socket pcmcia_socket0: cs: memory probe 0x60000000-0x60ffffff: clean.
[   21.349487] pcmcia_socket pcmcia_socket0: cs: IO port probe 0xa00-0xaff: clean.
[   21.555283] init: alsa-restore main process (868) terminated with status 19
[   21.698199] ipw2200: Radio Frequency Kill Switch is On:
[   21.698201] Kill switch must be turned off for wireless networking to work.
[   21.725149] cfg80211: failed to add phy80211 symlink to netdev!
[   21.749433] cfg80211: Updating information on frequency 2412 MHz for a 20 MHz width channel with regulatory rule:
[   21.749439] cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   21.749442] cfg80211: Updating information on frequency 2417 MHz for a 20 MHz width channel with regulatory rule:
[   21.749446] cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   21.749450] cfg80211: Updating information on frequency 2422 MHz for a 20 MHz width channel with regulatory rule:
[   21.749454] cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   21.749457] cfg80211: Updating information on frequency 2427 MHz for a 20 MHz width channel with regulatory rule:
[   21.749461] cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   21.749464] cfg80211: Updating information on frequency 2432 MHz for a 20 MHz width channel with regulatory rule:
[   21.749468] cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   21.749471] cfg80211: Updating information on frequency 2437 MHz for a 20 MHz width channel with regulatory rule:
[   21.749475] cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   21.749478] cfg80211: Updating information on frequency 2442 MHz for a 20 MHz width channel with regulatory rule:
[   21.749482] cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   21.749485] cfg80211: Updating information on frequency 2447 MHz for a 20 MHz width channel with regulatory rule:
[   21.749489] cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   21.749493] cfg80211: Updating information on frequency 2452 MHz for a 20 MHz width channel with regulatory rule:
[   21.749496] cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   21.749500] cfg80211: Updating information on frequency 2457 MHz for a 20 MHz width channel with regulatory rule:
[   21.749504] cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   21.749507] cfg80211: Updating information on frequency 2462 MHz for a 20 MHz width channel with regulatory rule:
[   21.749511] cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   21.749857] ipw2200: Detected geography ZZM (11 802.11bg channels, 0 802.11a channels)
[   21.860633] ADDRCONF(NETDEV_UP): eth1: link is not ready
[   21.866613] 8139too 0000:06:08.0: eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
[   22.057062] fbcon: inteldrmfb (fb0) is primary device
[   22.058189] Console: switching to colour frame buffer device 160x50
[   22.058235] fb0: inteldrmfb frame buffer device
[   22.058238] drm: registered panic notifier
[   22.058288] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on minor 0
[   22.058342] snd_hda_intel 0000:00:1b.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[   22.058416] snd_hda_intel 0000:00:1b.0: irq 43 for MSI/MSI-X
[   22.058451] snd_hda_intel 0000:00:1b.0: setting latency timer to 64
[   24.760018] ipw2200: Failed to send POWER_MODE: Command timed out.
[   25.005523] init: plymouth-stop pre-start process (1465) terminated with status 1
[   29.284097] ipw2200: Failed to send POWER_MODE: Command timed out.
[   32.664022] eth0: no IPv6 routers present
[   33.154871] Bluetooth: RFCOMM TTY layer initialized
[   33.154880] Bluetooth: RFCOMM socket layer initialized
[   33.154883] Bluetooth: RFCOMM ver 1.11
[  149.848067] usb 3-2: new full-speed USB device number 2 using uhci_hcd
[  150.279172] usbcore: registered new interface driver snd-usb-audio
[  150.307899] input: Burr-Brown from TI               USB Audio CODEC  as /devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.3/input/input7
[  150.308317] generic-usb 0003:08BB:2902.0001: input,hidraw0: USB HID v1.00 Device [Burr-Brown from TI               USB Audio CODEC ] on usb-0000:00:1d.1-2/input3
[  150.310233] usbcore: registered new interface driver usbhid
[  150.310236] usbhid: USB HID core driver

i couldn't paste the full log due to character restrictions, so I pasted the last part only
Reply
#7
And this is what I was hoping to see

Code:
[  150.279172] usbcore: registered new interface driver snd-usb-audio

Make sure that snd-usb-audio is appended to end of /etc/modules for one. that way Linux will always load this driver, so if usb-device is connected before boot it will get detected for sure.

It probably would help if usbcore-autosuspend=0 or -1 was set in grub boot line too..

uNi

Reply
#8
Hi,

Thanks for the help. I did what you said, but still no advancements...
I also upgraded to frodo, but i still have the same problems. It's even worse since apparently I can't select a custom device in frodo and I am stuck with the default settings...

When the audio stopped, I noticed some strange messages in dmesg:
Code:
[ 8362.202794] delay: estimated 177, actual 45
[ 8362.301798] delay: estimated 266, actual 45
[ 8362.328767] delay: estimated 309, actual 44
[ 8362.369805] delay: estimated 177, actual 45
[ 8362.400979] delay: estimated 309, actual 45
[ 8362.436774] delay: estimated 177, actual 44
[ 8362.467508] delay: estimated 309, actual 44
[ 8362.496911] delay: estimated 177, actual 45
[ 8362.527369] delay: estimated 266, actual 1
[ 8362.569809] delay: estimated 133, actual 0
[ 8362.594952] delay: estimated 265, actual 45
[ 8362.628171] delay: estimated 265, actual 1
[ 8362.661459] delay: estimated 309, actual 45
[ 8362.694746] delay: estimated 265, actual 1
[ 8362.728171] usb 3-2: USB disconnect, device number 3
[ 8427.064039] usb 3-2: new full-speed USB device number 4 using uhci_hcd
[ 8427.444145] input: Burr-Brown from TI               USB Audio CODEC  as /devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.3/input/input9
[ 8427.444344] generic-usb 0003:08BB:2902.0003: input,hidraw0: USB HID v1.00 Device [Burr-Brown from TI               USB Audio CODEC ] on usb-0000:00:1d.1-2/input3
any idea what these delays are?

Google led me to this this

The laptop has 2 USB ports: One for the external harddrive (from which I play my movies) and one for the DAC. Could this be the problem?
In that case I am wondering why I don't have this problem when I play files with VLC.

Tim
Reply
#9
Idk but you cant compare VLC as a measure of success or failure since VLC doesn't have a audio engine I dont think.
Obviously a USB introduces latency and apparently this is all being calculated.somehow.

Post a full XBMC debug log and make sure the XBMC settings reflect you best results and also post a screenshot of alsamixer with all devices and xbmc audio settings.
Something you may want to look at is this http://forum.xbmc.org/showthread.php?tid=145430

Perhaps nickr has some suggestions here?

uNi
Reply

Logout Mark Read Team Forum Stats Members Help
(Audio setup) Problems with XBMC + USB DAC configuration1