Project

General

Profile

Actions

Bug #1068

closed

DVD playback not working

Added by corecode over 13 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Hey,

Yesterday night I tried to play a DVD. No luck. I tried with Ubuntu,
no luck either until I installed libdvdcss. So my drive works, but
DragonFly has no means of playing a DVD.

That's pathetic.

A selection of error messages (all with libdvdcss installed):

ogle:
(from dmesg)
ata0: FAILURE - non aligned DMA transfer attempted
acd0: setting up DMA failed

mplayer:
(from dmesg):
ata0: FAILURE - non aligned DMA transfer attempted
acd0: setting up DMA failed

now hangs in wchan "ATA re"

pathetic.

Actions #1

Updated by mneumann over 13 years ago

Googling for "non aligned DMA transfer attempted" lead me to this page
(in German):

http://www.bsdforen.de/showthread.php?p=185404

So it seems FreeBSD (7.0) has the same problem. Someone suggests the
following:

natacontrol mode acd0 pio4

Regards,

Michael
Actions #2

Updated by steve over 13 years ago

On Sun, 13 Jul 2008 13:21:36 +0200
Michael Neumann <> wrote:

This does work - at the cost of very high CPU utilisation
(especially when trying to read a DVD at high speed with dvdbackup etc).
This problem has been around a while - see "Reading DVD video broken in
recent current" in bugs@ from 11 Jan. It started between preview and
current at that time. I've made periodic attempts to track it down without
success.
Actions #3

Updated by steve over 13 years ago

Hi,

I found that compiling libdvdcss with CCVER=gcc34 makes encrypted
DVD reading work.
Actions #4

Updated by dillon over 13 years ago

: Hi,
:
: I found that compiling libdvdcss with CCVER=gcc34 makes encrypted
:DVD reading work.
:

Nice sleuthing!  Sigh.  What is with all of these linux-centric
programmers these days? Did you track down what in libdvdcss was
not being compiled properly with gcc-4?
-Matt
Matthew Dillon
&lt;&gt;
Actions #5

Updated by corecode over 13 years ago

I think this is the same thing that I found several weeks ago (and
forgot to post): buffer alignment to page boundaries on read()/ioctl().
Or did we fix that already?

cheers
simon

Actions #6

Updated by dillon over 13 years ago

:Matthew Dillon wrote:
:> : I found that compiling libdvdcss with CCVER=gcc34 makes encrypted
:> :DVD reading work.
:> Nice sleuthing! Sigh. What is with all of these linux-centric
:> programmers these days? Did you track down what in libdvdcss was
:> not being compiled properly with gcc-4?
:
:I think this is the same thing that I found several weeks ago (and
:forgot to post): buffer alignment to page boundaries on read()/ioctl().
: Or did we fix that already?
:
:cheers
: simon

I don't think it has been fixed.  I was hoping someone would take
up the charge :-) Its physio() that needs to deal with the
alignment issue.
-Matt
Matthew Dillon
&lt;&gt;
Actions #7

Updated by steve over 13 years ago

On Sat, 09 Aug 2008 18:22:13 +0100
"Simon 'corecode' Schubert" <> wrote:

Not unless it's been fixed between preview and current. I'd say it
is the same issue though.
Actions #8

Updated by steve over 13 years ago

On Sat, 9 Aug 2008 09:49:01 -0700 (PDT)
Matthew Dillon <> wrote:

'fraid not - to be honest I'm not sure how to go about it.
Actions #9

Updated by steve over 13 years ago

On Sat, 9 Aug 2008 09:49:01 -0700 (PDT)
Matthew Dillon <> wrote:

Is it because this sort of thing:
if( psz_cache )
{
uint8_t p_sector[DVDCSS_BLOCK_SIZE];
...
i_ret = dvdcss->pf_read( dvdcss, p_sector, 1 );
}
Can leave p_sector not aligned suitably for DMA in gcc-4 ? (pf_read
winds up calling read on the DVD device with p_sector as the buffer).
Actions #10

Updated by dillon over 13 years ago

: if( psz_cache )
: {
: uint8_t p_sector[DVDCSS_BLOCK_SIZE];
:...
: i_ret = dvdcss->pf_read( dvdcss, p_sector, 1 );
: }
:
: Can leave p_sector not aligned suitably for DMA in gcc-4 ? (pf_read
:winds up calling read on the DVD device with p_sector as the buffer).

It's a roll of dice, really.  Neither gcc-3 nor gcc-4 guarantee any
sort of alignment for a char array, and our kernel's physio() doesn't
realign the data.
Well, I guess since nobody has bitten on fixing physio() I'll have to
do it myself :-). I'll do it today.
-Matt
Matthew Dillon
&lt;&gt;
Actions #11

Updated by dillon over 13 years ago

Ok, I have committed fixes to the kernel's physio() to HEAD. Please
test w/ a gcc-4 built DVD playback gizmo! If the tests work out
I will MFC the change to 2.0.

-Matt
Matthew Dillon
&lt;&gt;
Actions #12

Updated by steve over 13 years ago

On Sun, 10 Aug 2008 13:04:19 -0700 (PDT)
Matthew Dillon <> wrote:

Works perfectly - thank you.
Actions #13

Updated by hasso over 13 years ago

Indeed it fixes the issue. Which makes me wonder what broke it as I'm sure
that I've been watching DVD's using DragonFly and gcc4 was default for
sure then.

Actions #14

Updated by steve over 13 years ago

On Mon, 11 Aug 2008 11:37:32 +0300
Hasso Tepper <> wrote:

It broke for me when I switched from an up to date preview to head
from 7 January.
Actions #15

Updated by dillon over 13 years ago

:> Indeed it fixes the issue. Which makes me wonder what broke it as I'm
:> sure that I've been watching DVD's using DragonFly and gcc4 was default
:> for sure then.
:
: It broke for me when I switched from an up to date preview to head
:from 7 January.

I think it was a complete luck of the draw prior to the physio fix,
whether that char buffer declared on the stack in the dvd library
happened to be properly aligned or not for DMA.
-Matt
Matthew Dillon
&lt;&gt;
Actions #16

Updated by steve over 13 years ago

On Mon, 11 Aug 2008 08:22:19 -0700 (PDT)
Matthew Dillon <> wrote:

It was better than that - I've been running DragonFly and playing
and backing up DVDs with it since early 2005, it was rock solid up until
that Jan 7 update (and before that in FreeBSD 4.x) it's never worked after
that until now.
Actions #17

Updated by matthias over 13 years ago

Fix committed by dillon@

Actions

Also available in: Atom PDF