You are not logged in.

#1 2012-05-26 18:00:30

dobo
Member
Registered: 2010-07-09
Posts: 21

[tuner card] cx88 alsa buffer under-run (on xc4000)

I'm having really weird bug and I don't know where should I look for help.
I own Leadtek WinFast DTV2000 H Plus card with Conexant CX2388x PCI bridge and Xcieve XC4000 tuner.

I'm using it with mplayer to watch analog cable tv. I'm suffering from buffer underrun caused by alsa driver (cx88_alsa). What's more interesting it's occurring more often when I'm watching channels only on specific frequencies (mostly high). The side effect of this is that mplayer (also mplayer2) has a memory leak which causes to drop frames after aprox. 10 minutes.
When I'm having underruns dmesg shows something like this:

May 26 11:26:12 localhost kernel: [81922.660861] cx88[0]: irq aud [0x1101] dn_risci1* dnf_of dn_sync*
May 26 11:26:14 localhost kernel: [81924.159913] cx88[0]: irq aud [0x1101] dn_risci1* dnf_of dn_sync*
May 26 11:26:16 localhost kernel: [81926.855046] cx88[0]: irq aud [0x1101] dn_risci1* dnf_of dn_sync*
May 26 11:26:19 localhost kernel: [81929.550115] cx88[0]: irq aud [0x1101] dn_risci1* dnf_of dn_sync*
May 26 11:26:22 localhost kernel: [81932.245248] cx88[0]: irq aud [0x1101] dn_risci1* dnf_of dn_sync*
May 26 11:26:25 localhost kernel: [81935.341748] cx88[0]: irq aud [0x1001] dn_risci1* dn_sync*
May 26 11:26:25 localhost kernel: [81935.352431] cx88[0]: irq aud [0x1101] dn_risci1* dnf_of dn_sync*
May 26 11:26:25 localhost kernel: [81935.352440] cx88[0]: irq aud [0x1001] dn_risci1* dn_sync*

I've figured a simple workaround but it's causing sound stuttering on high frequencies (because of more buffer underruns). Disable audio in mplayer and run:

sox -t alsa hw:1,0 -t alsa hw:0,0

I've found similar problem but no one has found a soultion: http://www.digipedia.pl/usenet/thread/17087/5974/
I've tried also applying workaround from https://bugs.launchpad.net/ubuntu/+sour … bug/836062 post #5 but it doesn't work.

I really don't know where should I report this bug. Any help will be really appreciated.

Info and configs:
lspci:

08:07.0 Multimedia video controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder (rev 05)
        Subsystem: LeadTek Research Inc. Device 6f42
        Flags: bus master, medium devsel, latency 32, IRQ 21
        Memory at f9000000 (32-bit, non-prefetchable) [size=16M]
        Capabilities: <access denied>
        Kernel driver in use: cx8800

08:07.1 Multimedia controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder [Audio Port] (rev 05)
        Subsystem: LeadTek Research Inc. Device 6f42
        Flags: bus master, medium devsel, latency 32, IRQ 21
        Memory at fb000000 (32-bit, non-prefetchable) [size=16M]
        Capabilities: <access denied>
        Kernel driver in use: cx88_audio

08:07.2 Multimedia controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder [MPEG Port] (rev 05)
        Subsystem: LeadTek Research Inc. Device 6f42
        Flags: bus master, medium devsel, latency 32, IRQ 21
        Memory at fa000000 (32-bit, non-prefetchable) [size=16M]
        Capabilities: <access denied>
        Kernel driver in use: cx88-mpeg driver manager

mplayer config:

# Write your default config options here!

tv=driver=v4l2:input=1:norm=PAL-DK:channels=119250-ch1,127250-ch2,135250-ch3,143250-ch4,151250-ch5,159250-ch6,167250-ch7,175250-ch8,183250-ch9,191250-ch10,199250-ch11,215250-ch12,223250-ch13,231250-ch14,239250-ch15,247250-ch16,255250-ch17,263250-ch18,271250-ch19,279250-ch20,287250-ch21,295250-ch22,303250-ch23,311250-ch24,319250-ch25,327250-ch26,335250-ch27,343250-ch28,351250-ch29,359250-ch30,367250-ch31,375250-ch32,383250-ch33,391250-ch34,399250-ch35,407250-ch36,415250-ch37,423250-ch38,431250-ch39,439250-ch40,447250-ch41,455250-ch42,463250-ch43,471250-ch44,479250-ch45,487250-ch46,495250-ch47,503250-ch48,511250-ch49,527250-ch50,535250-ch51,591200-ch52

Example output of sox underruns:

hw:1,0: (alsa)

  Encoding: Signed PCM    
  Channels: 2 @ 16-bit   
Samplerate: 48000Hz      
Replaygain: off         
  Duration: unknown      

In:0.00% 00:00:00.17 [00:00:00.00] Out:4.10k [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:02.05 [00:00:00.00] Out:94.2k [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:03.24 [00:00:00.00] Out:152k  [     -|-     ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:04.78 [00:00:00.00] Out:225k  [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:07.17 [00:00:00.00] Out:340k  [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:08.53 [00:00:00.00] Out:406k  [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:10.07 [00:00:00.00] Out:479k  [     -|-     ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:11.43 [00:00:00.00] Out:545k  [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:13.14 [00:00:00.00] Out:627k  [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:14.51 [00:00:00.00] Out:692k  [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:15.70 [00:00:00.00] Out:750k  [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:16.55 [00:00:00.00] Out:791k  [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:18.77 [00:00:00.00] Out:897k  [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:19.97 [00:00:00.00] Out:954k  [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:20.31 [00:00:00.00] Out:971k  [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:22.19 [00:00:00.00] Out:1.06M [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:23.38 [00:00:00.00] Out:1.12M [     -|-     ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:24.58 [00:00:00.00] Out:1.18M [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:25.77 [00:00:00.00] Out:1.23M [     -|-     ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:26.97 [00:00:00.00] Out:1.29M [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:28.16 [00:00:00.00] Out:1.35M [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:30.21 [00:00:00.00] Out:1.45M [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:31.23 [00:00:00.00] Out:1.50M [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:32.94 [00:00:00.00] Out:1.58M [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:33.96 [00:00:00.00] Out:1.63M [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:35.33 [00:00:00.00] Out:1.69M [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:36.86 [00:00:00.00] Out:1.77M [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:38.06 [00:00:00.00] Out:1.82M [      |      ]        Clip:0    sox WARN alsa: under-run
In:0.00% 00:00:39.08 [00:00:00.00] Out:1.87M [     -|-     ]        Clip:0    sox WARN alsa: under-run

Offline

#2 2012-06-07 11:10:43

igorc
Member
Registered: 2012-06-07
Posts: 1

Re: [tuner card] cx88 alsa buffer under-run (on xc4000)

Hi mate,

Just to let you know you are not alone. I have the same issue with Leadtek WinFast DTV2000 H (rev. J) card. It's card=82 on the cx88 driver support list on v4l site.

I'm seeing the same messages on Mythbuntu Lucid 10.04 I just noticed it today troubleshooting some tunning issue. I found some other people having same issue dating from 2007 and 2009 with some other cards too, not sure if the same driver though.

$ dmesg | egrep "cx2388|dvb|DVB|cx88"
[   18.686379] cx88/2: cx2388x MPEG-TS Driver Manager version 0.0.7 loaded
[   18.686470] cx88/0: cx2388x v4l2 driver version 0.0.7 loaded
[   18.698803] cx88[0]: subsystem: 107d:6f2b, board: WinFast DTV2000 H rev. J [card=82,autodetected], frontend(s): 1
[   18.698805] cx88[0]: TV tuner type 63, Radio tuner type -1
[   18.701199] cx2388x alsa driver version 0.0.7 loaded
[   18.916524] tuner 0-0043: chip found @ 0x86 (cx88[0])
[   18.927543] tuner 0-0061: chip found @ 0xc2 (cx88[0])
[   18.988392] input: cx88 IR (WinFast DTV2000 H rev. as /devices/pci0000:00/0000:00:14.4/0000:03:07.2/input/input6
[   18.988524] cx88[0]/2: cx2388x 8802 Driver Manager
[   18.988555] cx88-mpeg driver manager 0000:03:07.2: PCI INT A -> GSI 21 (level, low) -> IRQ 21
[   18.988565] cx88[0]/2: found at 0000:03:07.2, rev: 5, irq: 21, latency: 32, mmio: 0xfb000000
[   18.988572] IRQ 21/cx88[0]: IRQF_DISABLED is not guaranteed on shared IRQs
[   18.989608] cx8800 0000:03:07.0: PCI INT A -> GSI 21 (level, low) -> IRQ 21
[   18.989618] cx88[0]/0: found at 0000:03:07.0, rev: 5, irq: 21, latency: 32, mmio: 0xfa000000
[   18.989630] IRQ 21/cx88[0]: IRQF_DISABLED is not guaranteed on shared IRQs
[   18.989753] cx88[0]/0: registered device video0 [v4l2]
[   18.989804] cx88[0]/0: registered device vbi0
[   18.989852] cx88[0]/0: registered device radio0
[   19.007549] cx88/2: cx2388x dvb driver version 0.0.7 loaded
[   19.007554] cx88/2: registering cx8802 driver, type: dvb access: shared
[   19.007557] cx88[0]/2: subsystem: 107d:6f2b, board: WinFast DTV2000 H rev. J [card=82]
[   19.007561] cx88[0]/2: cx2388x based DVB/ATSC card
[   19.007563] cx8802_alloc_frontends() allocating 1 frontend(s)
[   19.007791] cx88_audio 0000:03:07.1: PCI INT A -> GSI 21 (level, low) -> IRQ 21
[   19.007801] IRQ 21/cx88[0]: IRQF_DISABLED is not guaranteed on shared IRQs
[   19.007827] cx88[0]/1: CX88x/0: ALSA support for cx2388x boards
[   19.036402] DVB: registering new adapter (cx88[0])
[   19.036405] DVB: registering adapter 0 frontend 0 (Conexant CX22702 DVB-T)...
[   28.937066] cx88[0]: irq aud [0x1001] dn_risci1* dn_sync*
[   28.937078] cx88[0]: irq aud [0x1001] dn_risci1* dn_sync*
[   28.937089] cx88[0]: irq aud [0x1001] dn_risci1* dn_sync*
[   28.937097] cx88[0]: irq aud [0x1001] dn_risci1* dn_sync*
[   28.937105] cx88[0]: irq aud [0x1001] dn_risci1* dn_sync*
[   28.937113] cx88[0]: irq aud [0x1001] dn_risci1* dn_sync*
[   28.937129] cx88[0]: irq aud [0x1001] dn_risci1* dn_sync*
[   28.937137] cx88[0]: irq aud [0x1001] dn_risci1* dn_sync*
[   28.937145] cx88[0]: irq aud [0x1001] dn_risci1* dn_sync*

Some of them solved their issue by unloading the cards ALSA driver cx88_alsa but not sure if that is a good idea since that module is used by snd_pcm and will probably have audio impact.

My IRQ assignments:

$ cat /proc/interrupts
           CPU0       CPU1       
  0:         27        115   IO-APIC-edge      timer
  1:          0          2   IO-APIC-edge      i8042
  4:          0          2   IO-APIC-edge   
  6:          0          5   IO-APIC-edge      floppy
  7:          0          0   IO-APIC-edge      parport0
  8:          0          1   IO-APIC-edge      rtc0
  9:          0          0   IO-APIC-fasteoi   acpi
12:          0          4   IO-APIC-edge      i8042
14:          0          0   IO-APIC-edge      pata_atiixp
15:          0          0   IO-APIC-edge      pata_atiixp
16:          0       1223   IO-APIC-fasteoi   ohci_hcd:usb3, ohci_hcd:usb4, HDA Intel
17:          0          0   IO-APIC-fasteoi   ehci_hcd:usb1
18:          1         28   IO-APIC-fasteoi   ohci_hcd:usb5, ohci_hcd:usb6, ohci_hcd:usb7
19:       3454      25488   IO-APIC-fasteoi   ehci_hcd:usb2, HDA Intel
21:     676891      17268   IO-APIC-fasteoi   cx88[0], cx88[0], cx88[0]
22:          0          3   IO-APIC-fasteoi   ohci1394
25:      42059        164   PCI-MSI-edge      eth0
26:          3     635727   PCI-MSI-edge      ahci
27:          0          0   PCI-MSI-edge      fglrx[0]@PCI:1:5:0
NMI:          0          0   Non-maskable interrupts
LOC:    5877466    5852321   Local timer interrupts
SPU:          0          0   Spurious interrupts
PMI:          0          0   Performance monitoring interrupts
PND:          0          0   Performance pending work
RES:    2710497    3588734   Rescheduling interrupts
CAL:       1027         64   Function call interrupts
TLB:      91005      89118   TLB shootdowns
TRM:          0          0   Thermal event interrupts
THR:          0          0   Threshold APIC interrupts
MCE:          0          0   Machine check exceptions
MCP:        115        115   Machine check polls
ERR:          2
MIS:          0


The card is sharing the same IRQ 21 for all three devices I guess DVB, analog TV and radio.

03:07.0 Multimedia video controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder (rev 05)
    Subsystem: LeadTek Research Inc. Device 6f2b
    Flags: bus master, medium devsel, latency 32, IRQ 21
    Memory at fa000000 (32-bit, non-prefetchable) [size=16M]
    Capabilities: <access denied>
    Kernel driver in use: cx8800
    Kernel modules: cx8800

03:07.1 Multimedia controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder [Audio Port] (rev 05)
    Subsystem: LeadTek Research Inc. Device 6f2b
    Flags: bus master, medium devsel, latency 32, IRQ 21
    Memory at f9000000 (32-bit, non-prefetchable) [size=16M]
    Capabilities: <access denied>
    Kernel driver in use: cx88_audio
    Kernel modules: cx88-alsa

03:07.2 Multimedia controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder [MPEG Port] (rev 05)
    Subsystem: LeadTek Research Inc. Device 6f2b
    Flags: bus master, medium devsel, latency 32, IRQ 21
    Memory at fb000000 (32-bit, non-prefetchable) [size=16M]
    Capabilities: <access denied>
    Kernel driver in use: cx88-mpeg driver manager
    Kernel modules: cx8802

I'm using this card on MythTV setup for watching and recording DVB-T TV and can't say I've noticed any sound issues during playback. But what I've noticed is that the card can't tune some DVB channels here in Australia after I upgraded to MythTV 0.25 and Mythbuntu 10.04.

If you ask me this issue should go to the v4l list since I think is driver related.

Cheers,
Igor

Offline

Board footer

Powered by FluxBB