From owner-freebsd-stable@FreeBSD.ORG Fri May 4 12:57:51 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A308816A406 for ; Fri, 4 May 2007 12:57:51 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from nibbel.kulnet.kuleuven.ac.be (nibbel.kulnet.kuleuven.ac.be [134.58.240.41]) by mx1.freebsd.org (Postfix) with ESMTP id 3358313C4B7 for ; Fri, 4 May 2007 12:57:51 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from localhost (localhost [127.0.0.1]) by nibbel.kulnet.kuleuven.ac.be (Postfix) with ESMTP id 9C5BB4D60C; Fri, 4 May 2007 14:38:45 +0200 (CEST) Received: from smtp02.kuleuven.be (lepidus.kulnet.kuleuven.ac.be [134.58.240.72]) by nibbel.kulnet.kuleuven.ac.be (Postfix) with ESMTP id C9BEE4D609; Fri, 4 May 2007 14:38:44 +0200 (CEST) Received: from kalimero.kotnet.org (kalimero.kotnet.org [10.4.16.222]) by smtp02.kuleuven.be (Postfix) with ESMTP id 251372CAA59; Fri, 4 May 2007 14:38:44 +0200 (CEST) Received: from kalimero.kotnet.org (kalimero.kotnet.org [127.0.0.1]) by kalimero.kotnet.org (8.13.8/8.13.8) with ESMTP id l44CchDb003018; Fri, 4 May 2007 14:38:43 +0200 (CEST) (envelope-from tijl@ulyssis.org) From: Tijl Coosemans To: freebsd-stable@freebsd.org Date: Fri, 4 May 2007 14:38:40 +0200 User-Agent: KMail/1.9.6 References: <20070503181646.GA1527@roadrunner.q.local> In-Reply-To: <20070503181646.GA1527@roadrunner.q.local> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_SlyOGSFrOyBh5Tr" Message-Id: <200705041438.42358.tijl@ulyssis.org> X-Virus-Scanned: by KULeuven Antivirus Cluster Cc: Ulrich Spoerlein Subject: Re: FreeBSD vs Region Code DVDs X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 May 2007 12:57:51 -0000 --Boundary-00=_SlyOGSFrOyBh5Tr Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Thursday 03 May 2007 20:16:46 Ulrich Spoerlein wrote: > I'm having a hard time getting my external (USB, Firewire) Plextor > PX-755UF to read any retail DVDs at all. I can read any kind of CDs > and also DVD-Rs. But mastered DVDs are invisible to FreeBSD. > > I can not even read a single sector from such a DVD with the > external drive, but it's working just fine with the internal one. > It's really driving me nuts. Maybe you have to change the drive region code (RPC 2). I had to do this a couple years ago with a laptop's internal drive. Either that or you need to find a patched firmware to make the drive region free (RPC 1). I wrote 2 simple programs back then to play with this, because I couldn't find anything in the base system. "regionget /dev/cd0" prints out the current drive region info, like: vendor resets left: 4 user changes left: 3 drive region: 2 rpc type: 2 "regionset /dev/cd0 3" sets the drive region code to 3. Don't forget that you can only change the region about 5 times (user changes left field). --Boundary-00=_SlyOGSFrOyBh5Tr Content-Type: text/plain; charset="iso-8859-1"; name="regionget.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="regionget.c" #include #include #include #include #include #include #include int main( int argc, char const *argv[] ) { int ret; int region; int fd; struct dvd_authinfo dvd; if( argc < 2 ) { fprintf( stderr, "Usage: %s \n", argv[ 0 ]); return -1; } fd = open( argv[ 1 ], O_RDONLY ); if( fd < 0 ) { fprintf( stderr, "Failed to open %s\n", argv[ 1 ]); return -1; } memset( &dvd, 0, sizeof( struct dvd_authinfo )); dvd.format = DVD_REPORT_RPC; ret = ioctl( fd, DVDIOCREPORTKEY, &dvd ); close( fd ); if( ret < 0 ) { fprintf( stderr, "Failed to retrieve region info. Try with a disc in the drive.\n" ); return -1; } dvd.region ^= 0xff; for( region = 0; dvd.region; dvd.region >>= 1 ) { region++; if( dvd.region == 1 ) break; } printf( "vendor resets left: %u\n", dvd.vend_rsts ); printf( "user changes left: %u\n", dvd.user_rsts ); printf( "drive region: %u\n", region ); printf( "rpc type: %u\n", dvd.rpc_scheme + 1 ); return 0; } --Boundary-00=_SlyOGSFrOyBh5Tr Content-Type: text/plain; charset="iso-8859-1"; name="regionset.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="regionset.c" #include #include #include #include #include #include #include #include int main( int argc, char const *argv[] ) { int ret, fd; uint8_t region; struct dvd_authinfo dvd; if( argc < 3 ) { fprintf( stderr, "Usage: %s \n", argv[ 0 ]); return -1; } ret = ( uint8_t ) strtol( argv[ 2 ], NULL, 10 ); if( ret <= 0 || ret > 8 ) { fprintf( stderr, "Invalid region.\n" ); return -1; } for( region = 0x01; ret > 1; ret-- ) { region <<= 1; } region ^= 0xff; fd = open( argv[ 1 ], O_RDONLY ); if( fd < 0 ) { fprintf( stderr, "Failed to open %s\n", argv[ 1 ]); return -1; } memset( &dvd, 0, sizeof( struct dvd_authinfo )); dvd.format = DVD_SEND_RPC; dvd.region = region; ret = ioctl( fd, DVDIOCSENDKEY, &dvd ); close( fd ); if( ret < 0 ) { fprintf( stderr, "Failed to set region. Try with a disc in the drive.\n" ); return -1; } return 0; } --Boundary-00=_SlyOGSFrOyBh5Tr--