[mythtv] WriteAudio: buffer underrun, when playing from CD/DVD combo drives

Mr. Demeanour mrdemeanour at jackpot.uk.net
Sun Mar 15 15:23:25 UTC 2009


Hi,

I'm running 0.21 svn-fixes, compiled locally.

Hardware is an Via EPIA SP fanless motherboard, with 512 Mb of RAM. The
system boots Debian lenny off an NFS server; there is no local hard
disk. This machine runs the frontend only - the backend is elsewhere.

Problem: I cannot play CDs or DVDs in MythTV, due to "WriteAudio: buffer
underrun" problems. I can play both CDs and DVDs in Xine, however, and
CD audio also works fine in alsaplayer and vlc. Interestingly, Mplayer
_doesn't_ work; it has the same trouble with CD audio exhibited by
MythTV (it pauses output at the same places).

At one time this hardware worked; I can't think of anything _relevant_
that I changed, other than updating MythTV. When CD and DVD playback
last worked, this system was booting off a local hard disk - I changed
quite a lot of things to get network boot working the way I wanted, but
I can't see how those changes might have given rise to this problem.

The following output shows an audio CD being played:

2009-03-15 13:27:42.129 CD status has changed.
2009-03-15 13:27:45.445 Opening audio device 'default'. ch 2(2) sr 44100
2009-03-15 13:27:45.446 Opening ALSA audio device 'default'.
2009-03-15 13:27:54.914 AO: dropping back audio_buffer_unused
2009-03-15 13:28:00.117 WriteAudio: buffer underrun
2009-03-15 13:28:00.160 AO: dropping back audio_buffer_unused
2009-03-15 13:28:00.220 AO: dropping back audio_buffer_unused
2009-03-15 13:28:00.281 AO: dropping back audio_buffer_unused
2009-03-15 13:28:00.348 AO: dropping back audio_buffer_unused
2009-03-15 13:28:00.384 AO: dropping back audio_buffer_unused
2009-03-15 13:28:00.451 AO: dropping back audio_buffer_unused
2009-03-15 13:28:00.487 AO: dropping back audio_buffer_unused
2009-03-15 13:28:00.523 AO: dropping back audio_buffer_unused
2009-03-15 13:28:00.589 AO: dropping back audio_buffer_unused
2009-03-15 13:28:00.625 AO: dropping back audio_buffer_unused
2009-03-15 13:28:00.695 AO: dropping back audio_buffer_unused
2009-03-15 13:28:00.731 AO: dropping back audio_buffer_unused
2009-03-15 13:28:00.799 AO: dropping back audio_buffer_unused
2009-03-15 13:28:18.564 WriteAudio: buffer underrun
2009-03-15 13:28:23.733 WriteAudio: buffer underrun

Each "buffer underrun" message corresponds to either the initial pause
before playback commences, or a stutter during playback. Playback
consistently runs OK for the first 10-20 seconds, then stops for a few
seconds. Thereafter audio becomes choppy over a timescale of one or two
seconds.

The optical drive is as follows:
hdb: MATSHITACD-RW CW-8124, ATAPI CD/DVD-ROM drive

The following all work fine (on the whole):
- DVB-T Live TV
- DVB-T recording (to an NFS mount)
- Playback of recordings
- Ripping of CDs (from this frontend) to FLAC
- Playback of ripped CDs

Audio playback uses ALSA:default, through the stereo analogue output.

Things I have tried:
- Using an external Samsung USB CD/DVD combo drive
- Using an external SB Live! USB soundcard
- Using PATA_VIA driver instead of BLK_DEV_VIA82CXXX and BLK_DEV_IDE
- Tinkering with kernel scheduler options
- Disabling ACPI either on the motherboard or in the kernel, or both
- running as root

None of these have had any effect on the problem.

Mythfrontend has the following options set:
- Aggressive Sound card Buffering
- Extra audio buffering

mythtv at sila:~$ lspci
00:00.0 Host bridge: VIA Technologies, Inc. CN333/CN400/PM880 Host Bridge
00:00.1 Host bridge: VIA Technologies, Inc. CN333/CN400/PM880 Host Bridge
00:00.2 Host bridge: VIA Technologies, Inc. CN333/CN400/PM880 CPU Host
Bridge
00:00.3 Host bridge: VIA Technologies, Inc. CN333/CN400/PM880 Host Bridge
00:00.4 Host bridge: VIA Technologies, Inc. CN333/CN400/PM880 Host Bridge
00:00.7 Host bridge: VIA Technologies, Inc. CN333/CN400/PM880 Host Bridge
00:01.0 PCI bridge: VIA Technologies, Inc. VT8237/VX700 PCI Bridge
00:0d.0 FireWire (IEEE 1394): VIA Technologies, Inc. VT6306 Fire II IEEE
1394 OHCI Link Layer Controller (rev 80)
00:0f.0 IDE interface: VIA Technologies, Inc.
VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)
00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1
Controller (rev 81)
00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1
Controller (rev 81)
00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1
Controller (rev 81)
00:10.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1
Controller (rev 81)
00:10.4 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 86)
00:11.0 ISA bridge: VIA Technologies, Inc. VT8237 ISA bridge
[KT600/K8T800/K8T890 South]
00:11.5 Multimedia audio controller: VIA Technologies, Inc.
VT8233/A/8235/8237 AC97 Audio Controller (rev 60)
00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II]
(rev 78)
01:00.0 VGA compatible controller: VIA Technologies, Inc.
CN400/PM800/PM880/PN800/PN880 [S3 UniChrome Pro] (rev 02)

sila:/home/mythtv# hdparm -i /dev/hdb

/dev/hdb:

  Model=MATSHITACD-RW CW-8124, FwRev=DZ13, SerialNo=
  Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }
  RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0
  BuffType=unknown, BuffSize=0kB, MaxMultSect=0
  (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0
  IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
  PIO modes:  pio0 pio1 pio2 pio3 pio4
  DMA modes:  sdma0 sdma1 sdma2 mdma0 mdma1 mdma2
  UDMA modes: udma0 udma1 *udma2
  AdvancedPM=no
  Drive conforms to: Unspecified:  ATA/ATAPI-2,3,4,5,6

  * signifies the current active mode

At one time I suspected IRQ problems, but I think this is now OK
(especially since the same problems were encountered using the external
soundcard and CD combo):
sila:/home/mythtv# cat /proc/interrupts
            CPU0
   0:    6636678    XT-PIC-XT        timer
   1:          2    XT-PIC-XT        i8042
   2:          0    XT-PIC-XT        cascade
   7:          1    XT-PIC-XT
   8:          1    XT-PIC-XT        rtc0
  10:      70938    XT-PIC-XT        uhci_hcd:usb4, uhci_hcd:usb5
  11:          4    XT-PIC-XT        ehci_hcd:usb1, VIA8233A
  14:     493429    XT-PIC-XT        ide0
  15:     523550    XT-PIC-XT        uhci_hcd:usb2, uhci_hcd:usb3, eth0,
via at pci:0000:01:00.0
NMI:          0   Non-maskable interrupts
TRM:          0   Thermal event interrupts
SPU:          0   Spurious interrupts
ERR:          1

Unfortunately the BIOS on this motherboard doesn't enable me to rejig
the IRQs on the PCI devices. All of the devices are motherboard devices
- there is nothing in the solitary PCI slot, and the graphics is
motherboard graphics. AFAICS there is no APIC on this motherboard.

Google turns up a lot of "WriteAudio: buffer underrun" problems, but
none of the solutions I've seen have worked for me. Has anyone got a
suggestion that I might not have tried?

Thanks,
-- 
MrD.



More information about the mythtv-dev mailing list