DragonFly BSD
 

Issue1068

Title DVD playback not working
Priority bug Status resolved
Superseder Nosy List corecode
Assigned To Topics

Created on 2008-07-13.11:13:06 by corecode, last changed 2008-08-19.13:22:33 by matthias.

Messages
msg5275 (view) Author: matthias Date: 2008-08-19.13:22:33
Fix committed by dillon@
msg5227 (view) Author: steve Date: 2008-08-11.21:55:02
On Mon, 11 Aug 2008 08:22:19 -0700 (PDT)
Matthew Dillon <dillon@apollo.backplane.com> 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.
msg5225 (view) Author: dillon Date: 2008-08-11.15:24:01
:> 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 
					<dillon@backplane.com>
msg5215 (view) Author: steve Date: 2008-08-11.09:03:01
On Mon, 11 Aug 2008 11:37:32 +0300
Hasso Tepper <hasso@estpak.ee> wrote:

	It broke for me when I switched from an up to date preview to head
from 7 January.
msg5214 (view) Author: hasso Date: 2008-08-11.08:39:01
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.
msg5213 (view) Author: steve Date: 2008-08-11.08:39:00
On Sun, 10 Aug 2008 13:04:19 -0700 (PDT)
Matthew Dillon <dillon@apollo.backplane.com> wrote:

	Works perfectly - thank you.
msg5209 (view) Author: dillon Date: 2008-08-10.20:07:00
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 
					<dillon@backplane.com>
msg5208 (view) Author: dillon Date: 2008-08-10.16:47:00
:    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 
					<dillon@backplane.com>
msg5207 (view) Author: steve Date: 2008-08-10.12:40:05
On Sat, 9 Aug 2008 09:49:01 -0700 (PDT)
Matthew Dillon <dillon@apollo.backplane.com> 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).
msg5206 (view) Author: steve Date: 2008-08-09.21:31:36
On Sat, 9 Aug 2008 09:49:01 -0700 (PDT)
Matthew Dillon <dillon@apollo.backplane.com> wrote:

	'fraid not - to be honest I'm not sure how to go about it.
msg5205 (view) Author: steve Date: 2008-08-09.21:31:18
On Sat, 09 Aug 2008 18:22:13 +0100
"Simon 'corecode' Schubert" <corecode@fs.ei.tum.de> wrote:

	Not unless it's been fixed between preview and current. I'd say it
is the same issue though.
msg5204 (view) Author: dillon Date: 2008-08-09.18:31:01
: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 
					<dillon@backplane.com>
msg5203 (view) Author: corecode Date: 2008-08-09.18:26:08
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
msg5202 (view) Author: dillon Date: 2008-08-09.16:51:03
:	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 
					<dillon@backplane.com>
msg5200 (view) Author: steve Date: 2008-08-09.07:48:01
Hi,

	I found that compiling libdvdcss with CCVER=gcc34 makes encrypted
DVD reading work.
msg4925 (view) Author: steve Date: 2008-07-13.14:30:03
On Sun, 13 Jul 2008 13:21:36 +0200
Michael Neumann <mneumann@ntecs.de> 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.
msg4924 (view) Author: mneumann Date: 2008-07-13.11:28:00
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
msg4923 (view) Author: corecode Date: 2008-07-13.11:13:02
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.
History
Date User Action Args
2008-08-19 13:22:33matthiassetpriority: bug
status: chatting -> resolved
messages: + msg5275
2008-08-11 21:55:08stevesetmessages: + msg5227
2008-08-11 15:24:01dillonsetmessages: + msg5225
2008-08-11 09:03:01stevesetmessages: + msg5215
2008-08-11 08:39:02hassosetmessages: + msg5214
2008-08-11 08:39:01stevesetmessages: + msg5213
2008-08-10 20:07:01dillonsetmessages: + msg5209
2008-08-10 16:47:01dillonsetmessages: + msg5208
2008-08-10 12:40:15stevesetmessages: + msg5207
2008-08-09 21:31:40stevesetmessages: + msg5206
2008-08-09 21:31:36stevesetmessages: + msg5205
2008-08-09 18:31:02dillonsetmessages: + msg5204
2008-08-09 18:26:22corecodesetmessages: + msg5203
2008-08-09 16:51:07dillonsetmessages: + msg5202
2008-08-09 07:48:03stevesetmessages: + msg5200
2008-07-13 14:30:10stevesetmessages: + msg4925
2008-07-13 11:28:00mneumannsetstatus: unread -> chatting
messages: + msg4924
2008-07-13 11:13:06corecodecreate