Recherche avancée

Médias (91)

Autres articles (104)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (11782)

  • My FFMPEG converter is not allowing mp4 to webm conversions.

    2 novembre 2016, par Fred Garbutt

    heres the command :

    ffmpeg -i videos/test.mp4 -c:v libvpx -level 216 -profile 0 -qmax 42 -qmin 10 -c:a libvorbis -f webm out.webm

    i keep getting this error :

    Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

    here is the full response

    # ffmpeg -i videos/test.mp4 -c:v libvpx -level 216 -profile 0 -qmax 42 -qmin 10 -c:a

    libvorbis -f webm out.webm
    ffmpeg version N-49225-g7e059c9 Copyright (c) 2000-2013 the FFmpeg developers
     built on Jan 24 2013 05:14:06 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-54)
     configuration: --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-gpl --enable-postproc --enable-nonfree
     libavutil      52. 15.101 / 52. 15.101
     libavcodec     54. 90.100 / 54. 90.100
     libavformat    54. 61.104 / 54. 61.104
     libavdevice    54.  3.102 / 54.  3.102
     libavfilter     3. 33.100 /  3. 33.100
     libswscale      2.  2.100 /  2.  2.100
     libswresample   0. 17.102 /  0. 17.102
     libpostproc    52.  2.100 / 52.  2.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'videos/test.mp4':
     Metadata:
       major_brand     : mp42
       minor_version   : 1
       compatible_brands: mp42avc1
       creation_time   : 2010-08-12 15:42:21
     Duration: 00:00:34.20, start: 0.000000, bitrate: 358 kb/s
       Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 100 kb/s
       Metadata:
         creation_time   : 2010-08-12 15:42:21
         handler_name    : Apple Sound Media Handler
       Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 640x320, 251 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 5994 tbc
       Metadata:
         creation_time   : 2010-08-12 15:42:21
         handler_name    : Apple Video Media Handler
    Please use -profile:a or -profile:v, -profile is ambiguous
    File 'out.webm' already exists. Overwrite ? [y/N] y
    v0.9.6
    [libvpx @ 0x7e38d20] Failed to initialize encoder: ABI version mismatch
    Output #0, webm, to 'out.webm':
     Metadata:
       major_brand     : mp42
       minor_version   : 1
       compatible_brands: mp42avc1
       Stream #0:0(eng): Video: vp8, yuv420p, 640x320, q=10-42, 200 kb/s, 90k tbn, 29.97 tbc
       Metadata:
         creation_time   : 2010-08-12 15:42:21
         handler_name    : Apple Video Media Handler
       Stream #0:1(eng): Audio: none, 44100 Hz, stereo, fltp
       Metadata:
         creation_time   : 2010-08-12 15:42:21
         handler_name    : Apple Sound Media Handler
    Stream mapping:
     Stream #0:1 -> #0:0 (h264 -> libvpx)
     Stream #0:0 -> #0:1 (aac -> libvorbis)
    Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

    does anybody have any idea whats going on ? I am completely lost. I have tried so many different commands. converting from mp4 to ogg works fine, and i have had mp4 to webm working before, but i reinstalled ffmpeg to get the mp4 to ogg working and now ive lost my mp4 to webm conversions. >.< this whole installation process is such a damn nightmare. does anyone havea good tutorial for centos installation of ffmpeg that will work for mp4 ogg and webm ? I have used the centos tut that came off of the ffmpeg site, but it failed me. If anyone has any ideas that could point me in the right direction i would much appreciate it !

  • FFMPEG enocde flv with alpha channel

    25 octobre 2013, par tree

    I'm trying to encode a video (mov) to an flv with alpha channel in FFMPEG but I can't seem to either

    1. find a codec that is supported
    2. find one that actually maintains the alpha

    Does anyone know how to set that up ?

    Thanks,

    ffmpeg -i abc_btr_1280x800_Takeover.mov -vcodec flv -pix_fmt yuv444p -s 1280x800 test4.flv

    here is the report...

    ffmpeg started on 2013-10-25 at 15:47:30
    Report written to "ffmpeg-20131025-154730.log"
    Command line:
    ffmpeg -i abc_btr_1280x800_Takeover.mov -vcodec flv -pix_fmt yuv444p -s 1280x800     test4.flv -report
    ffmpeg version N-57367-g2f31b73 Copyright (c) 2000-2013 the FFmpeg developers
     built on Oct 23 2013 20:34:17 with gcc 4.8.2 (GCC)
     configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --    disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --    enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-    libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --    enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
     libavutil      52. 47.101 / 52. 47.101
     libavcodec     55. 38.101 / 55. 38.101
     libavformat    55. 19.104 / 55. 19.104
     libavdevice    55.  4.100 / 55.  4.100
     libavfilter     3. 89.100 /  3. 89.100
     libswscale      2.  5.101 /  2.  5.101
     libswresample   0. 17.104 /  0. 17.104
     libpostproc    52.  3.100 / 52.  3.100
    Splitting the commandline.
    Reading option &#39;-i&#39; ... matched as input file with argument     &#39;abc_btr_1280x800_Takeover.mov&#39;.
    Reading option &#39;-vcodec&#39; ... matched as option &#39;vcodec&#39; (force video codec (&#39;copy&#39; to     copy stream)) with argument &#39;flv&#39;.
    Reading option &#39;-pix_fmt&#39; ... matched as option &#39;pix_fmt&#39; (set pixel format) with argument &#39;yuv444p&#39;.
    Reading option &#39;-s&#39; ... matched as option &#39;s&#39; (set frame size (WxH or abbreviation)) with argument &#39;1280x800&#39;.
    Reading option &#39;test4.flv&#39; ... matched as output file.
    Reading option &#39;-report&#39; ... matched as option &#39;report&#39; (generate a report) with argument &#39;1&#39;.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option report (generate a report) with argument 1.
    Successfully parsed a group of options.
    Parsing a group of options: input file abc_btr_1280x800_Takeover.mov.
    Successfully parsed a group of options.
    Opening an input file: abc_btr_1280x800_Takeover.mov.
    [mov,mp4,m4a,3gp,3g2,mj2 @ 000000000085ac00] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 000000000085ac00] ISO: File Type Major Brand: qt  
    [mov,mp4,m4a,3gp,3g2,mj2 @ 000000000085ac00] File position before avformat_find_stream_info() is 281624339
    [mov,mp4,m4a,3gp,3g2,mj2 @ 000000000085ac00] All info found
    [mov,mp4,m4a,3gp,3g2,mj2 @ 000000000085ac00] File position after avformat_find_stream_info() is 288732
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#39;abc_btr_1280x800_Takeover.mov&#39;:
     Metadata:
       major_brand     : qt  
       minor_version   : 537199360
       compatible_brands: qt  
       creation_time   : 2013-09-22 02:50:18
     Duration: 00:00:10.00, start: 0.000000, bitrate: 225299 kb/s
       Stream #0:0(eng), 1, 1/24: Video: qtrle (rle  / 0x20656C72), bgra, 1280x800, 225293 kb/s, SAR 1280:1280 DAR 8:5, 24 fps, 24 tbr, 24 tbn, 24 tbc (default)
       Metadata:
         creation_time   : 2013-09-22 02:50:18
         handler_name    : Apple Alias Data Handler
         timecode        : 00:00:00:00
       Stream #0:1(eng), 0, 1/24: Data: none (tmcd / 0x64636D74), 0 kb/s (default)
       Metadata:
         creation_time   : 2013-09-22 02:50:22
         handler_name    : Apple Alias Data Handler
         timecode        : 00:00:00:00
    Successfully opened the file.
    Parsing a group of options: output file test4.flv.
    Applying option vcodec (force video codec (&#39;copy&#39; to copy stream)) with argument flv.
    Applying option pix_fmt (set pixel format) with argument yuv444p.
    Applying option s (set frame size (WxH or abbreviation)) with argument 1280x800.
    Successfully parsed a group of options.
    Opening an output file: test4.flv.
    Successfully opened the file.
    detected 4 logical cores
    [graph 0 input from stream 0:0 @ 0000000000303bc0] Setting &#39;video_size&#39; to value &#39;1280x800&#39;
    [graph 0 input from stream 0:0 @ 0000000000303bc0] Setting &#39;pix_fmt&#39; to value &#39;30&#39;
    [graph 0 input from stream 0:0 @ 0000000000303bc0] Setting &#39;time_base&#39; to value &#39;1/24&#39;
    [graph 0 input from stream 0:0 @ 0000000000303bc0] Setting &#39;pixel_aspect&#39; to value &#39;1280/1280&#39;
    [graph 0 input from stream 0:0 @ 0000000000303bc0] Setting &#39;sws_param&#39; to value &#39;flags=2&#39;
    [graph 0 input from stream 0:0 @ 0000000000303bc0] Setting &#39;frame_rate&#39; to value &#39;24/1&#39;
    [graph 0 input from stream 0:0 @ 0000000000303bc0] w:1280 h:800 pixfmt:bgra tb:1/24 fr:24/1 sar:1/1 sws_param:flags=2
    [scaler for output stream 0:0 @ 00000000003056a0] Setting &#39;w&#39; to value &#39;1280&#39;
    [scaler for output stream 0:0 @ 00000000003056a0] Setting &#39;h&#39; to value &#39;800&#39;
    [scaler for output stream 0:0 @ 00000000003056a0] Setting &#39;flags&#39; to value &#39;0x4&#39;
    [scaler for output stream 0:0 @ 00000000003056a0] w:1280 h:800 flags:&#39;0x4&#39; interl:0
    Incompatible pixel format &#39;yuv444p&#39; for codec &#39;flv&#39;, auto-selecting format &#39;yuv420p&#39;
    [format @ 00000000002f8320] compat: called with args=[yuv420p]
    [format @ 00000000002f8320] Setting &#39;pix_fmts&#39; to value &#39;yuv420p&#39;
    [AVFilterGraph @ 000000000085bc60] query_formats: 5 queried, 4 merged, 0 already done, 0 delayed
    [scaler for output stream 0:0 @ 00000000003056a0] w:1280 h:800 fmt:bgra sar:1/1 -> w:1280 h:800 fmt:yuv420p sar:1/1 flags:0x4
    [flv @ 0000000000374be0] intra_quant_bias = 0 inter_quant_bias = -64
    Output #0, flv, to &#39;test4.flv&#39;:
     Metadata:
       major_brand     : qt  
       minor_version   : 537199360
       compatible_brands: qt  
       encoder         : Lavf55.19.104
       Stream #0:0(eng), 0, 1/1000: Video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p,             1280x800 [SAR 1:1 DAR 8:5], q=2-31, 200 kb/s, 1k tbn, 24 tbc (default)
       Metadata:
         creation_time   : 2013-09-22 02:50:18
             handler_name    : Apple Alias Data Handler
             timecode        : 00:00:00:00        
       Stream mapping:
         Stream #0:0 -> #0:0 (qtrle -> flv)
    Press [q] to stop, [?] for help
    frame=   27 fps=0.0 q=31.0 size=     351kB time=00:00:01.12 bitrate=2554.2kbits/s    
    frame=   46 fps= 45 q=31.0 size=     477kB time=00:00:01.91 bitrate=2039.5kbits/s    
    frame=   60 fps= 39 q=31.0 size=     543kB time=00:00:02.50 bitrate=1779.4kbits/s    
    frame=   74 fps= 36 q=31.0 size=     629kB time=00:00:03.08 bitrate=1672.4kbits/s    
    frame=   96 fps= 37 q=31.0 size=     795kB time=00:00:04.00 bitrate=1627.4kbits/s    
    frame=  123 fps= 40 q=31.0 size=     924kB time=00:00:05.12 bitrate=1477.0kbits/s    
    frame=  149 fps= 41 q=31.0 size=    1133kB time=00:00:06.20 bitrate=1494.7kbits/s    
    frame=  175 fps= 43 q=31.0 size=    1224kB time=00:00:07.29 bitrate=1375.5kbits/s    
    frame=  201 fps= 44 q=31.0 size=    1352kB time=00:00:08.37 bitrate=1322.7kbits/s    
    frame=  228 fps= 45 q=31.0 size=    1461kB time=00:00:09.50 bitrate=1260.1kbits/s    
    [output stream 0:0 @ 00000000003053c0] EOF on sink link output stream 0:0:default.
    No more output streams to write to, finishing.
    frame=  240 fps= 45 q=31.0 Lsize=    1600kB time=00:00:10.00 bitrate=1310.4kbits/s    

    video:1596kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.252476%
    240 frames successfully decoded, 0 decoding errors
    [AVIOContext @ 000000000032dfc0] Statistics: 3 seeks, 242 writeouts
    [AVIOContext @ 000000000085bde0] Statistics: 281664506 bytes read, 3 seeks
  • Xbox Sphinx Protocol

    21 octobre 2013, par Multimedia Mike — DRM, xbox

    I’ve gone down the rabbit hole of trying to read the Xbox DVD drive from Linux. Honestly, I’m trying to remember why I even care at this point. Perhaps it’s just my metagame of trying to understand how games and related technologies operate. In my last post of the matter, I determined that it is possible to hook an Xbox drive up to a PC using a standard 40-pin IDE interface and read data sectors. However, I learned that just because the Xbox optical drive is reading an Xbox disc, that doesn’t mean it’s just going to read the sectors in response to a host request.

    Oh goodness, no. The drive is going to make the host work for those sectors.

    To help understand the concept of locked/unlocked sectors on an Xbox disc, I offer this simplistic diagram :


    Xbox locked disc diagram

    Any DVD drive (including the Xbox drive) is free to read those first 6992 sectors (about 14 MB of data) which just contain a short DVD video asking the user to insert the disc into a proper Xbox console. Reading the remaining sectors involves performing a sequence of SCSI commands that I have taken to calling the “Sphinx Protocol” for reasons I will explain later in this post.

    References
    Doing a little Googling after my last post on the matter produced this site hosting deep, technical Xbox information. It even has a page about exactly what I am trying to achieve : Use an Xbox DVD Drive in Your PC. The page provides a tool named dvdunlocker written by “The Specialist” to perform the necessary unlocking. The archive includes a compiled Windows binary as well as its source code. The source code is written in Delphi Pascal and leverages Windows SCSI APIs. Still, it is well commented and provides a roadmap, which I will try to describe in this post.

    Sphinx Protocol
    Here is a rough flowchart of the steps that are (probably) involved in the unlocking of those remaining sectors. I reverse engineered this based on the Pascal tool described in the previous section. Disclaimer : at the time of this writing, I haven’t tested all of the steps due to some Linux kernel problems, described later.


    Xbox SCSI Unlock Protocol

    Concerning the challenge/response table that the drive sends back, it’s large (0×664 / 1636 bytes), and not all of the bytes’ meanings are known. However, these are the bytes that seem to be necessary (all multi-byte numbers are big endian) :

     bytes 0-1        Size of mode page payload data (should be 0x0662)
     bytes 2-771      Unknown
     byte  772        Should be 1
     byte  773        Number of entries in challenge/response table
     bytes 774-1026   Encrypted challenge/response table
     bytes 1027-1186  Unknown
     bytes 1187-1230  Key basis (44 bytes)
     bytes 1231-1635  Unknown
    

    The challenge/response table is the interesting part, but it’s encrypted with RC4 a.k.a. ARCFOUR. The key is derived from the 44 bytes I have labeled “key basis”– cryptographic literature probably has a better term for it ; chime in if you know what that might be. An SHA-1 hash is computed over the 44 bytes.

    The resulting SHA-1 hash — the first part of it, to be exact — is fed as the key into the RC4 decryption. The output of SHA-1 contains 160 bits of information. 160 / 8 = 20 bytes of information. To express this as a printable hex digest requires 40 characters. The SHA-1 hash is converted to a hex digest and then the first 7 of the characters are fed into the RC4 initialization function as the key. Then, the RC4 decrypter does its work on the 253 bytes of the challenge/response table.

    So that’s why I took to calling this the “Sphinx Protocol” — I felt like I was being challenged with a bizarre riddle. Perhaps that describes a lot of cryptosystems, though You have to admit it sounds kind of cool.

    The challenge/response table contains 23 11-byte records. The format of this table is (again, multi-byte numbers are big-endian) :

     byte  0     This is 1 if this challenge/response pair is valid
     byte  1     Challenge ID
     bytes 2-5   Challenge
     byte  6     Response ID
     bytes 7-10  Response
    

    Example
    It’s useful to note that the challenge/response table and associated key is different for every disc (at least all the ones I have looked at). So this might be data that comes from the disc, since the values will always be the same for a given disc.

    Let’s examine Official Xbox Magazine disc #16 (Indiana Jones and The Emperor’s Tomb) :


    Xbox Magazine #16 featuring Indiana Jones

    Before I decrypt the challenge/response table, it looks like this :

       0 : 180, 172 : 0xEB100059 ;  66 : 0xD56AFB56
       1 :  34,  71 : 0x8F9BF03A ; 192 : 0xC32CBDF8
       2 : 226, 216 : 0xA29B77F2 ;  12 : 0x4474A6F1
       3 :  72, 122 : 0x9F5ABF33 ; 255 : 0xC5E3C304
       4 :   1, 103 : 0x76142ADA ; 233 : 0xDE145D42 ****
       5 :  49, 193 : 0xA1CD6192 ; 189 : 0x2169DBA5
       6 : 182, 250 : 0x9977894F ;  96 : 0x5A929E2B
       7 : 148,  71 : 0x6DD10A54 ; 115 : 0xF0BDAC4F
       8 :  12,  45 : 0x5D5EB6FD ; 148 : 0x84E60A00
       9 :  99, 121 : 0xFEAED372 ; 201 : 0xDA9986F9
      10 : 172, 230 : 0xE6C0D0B4 ; 214 : 0x9050C250
      11 :  84,  65 : 0x95CB8775 ; 104 : 0x550886C6
      12 : 210,  65 : 0x1ED23619 ; 171 : 0x6DF4A35B
      13 :   2, 155 : 0xD0AAE1E0 ; 130 : 0x00D1FFCF
      14 :  40,   2 : 0x172EFEB8 ; 159 : 0x37E03E50
      15 :  49,  15 : 0x43E5E378 ; 223 : 0x267F9C9A
      16 : 240, 173 : 0x357D5D1C ; 250 : 0x24965D67
      17 :  80, 184 : 0x5E7AF1A3 ;  81 : 0x3A8F69A7
      18 : 154, 186 : 0x6626BEAC ; 245 : 0xE639540A
      19 : 231, 249 : 0xFABAAFB7 ; 227 : 0x4C686A07
      20 : 150, 186 : 0x9A6D7AA3 ; 133 : 0x25971CF0
      21 : 236, 192 : 0x5CD97DD4 ; 247 : 0x26655EFB
      22 :  68, 173 : 0xE2D372E4 ; 207 : 0x103FBF94
    there are 1 valid pairs in the list : 4
    

    My best clue that it’s not right is that there is only 1 valid entry (denoted by my tool using ****). The source I reverse engineered for this data indicates that there needs to be at least 2 valid pairs. After running the RC4 decryption on the table, it looks like this and I get far more valid pairs :

       0 :   1, 174 : 0xBD628255 ;   0 : 0x9F0A31AF ****
       1 :   2, 176 : 0x3151B341 ;   2 : 0x9C87C180
       2 :   3, 105 : 0x018879E5 ;   1 : 0xFF068B5C
       3 :   2,   7 : 0x1F316AAF ;   3 : 0xF420D3ED
       4 :   3,  73 : 0xC2EBFBE9 ;   0 : 0x17062B5B
       5 : 252, 163 : 0xFF14B5CB ; 236 : 0xAF813FBC
       6 :   2, 233 : 0x5EE95C49 ;   1 : 0x37AA5511
       7 :   1, 126 : 0xBD628255 ;   0 : 0x5BA3FBD4 ****
       8 :   3,   4 : 0xB68BFEE6 ;   3 : 0xA8F3B918
       9 :   3,  32 : 0xEA614943 ;   2 : 0xA678D715
      10 :   2, 248 : 0x1BDD374E ;   0 : 0x8D2AC2C7
      11 :   3,  17 : 0x0EABCE81 ;   2 : 0xC90A7242
      12 :   1, 186 : 0xBD628255 ;   0 : 0xC4820242 ****
      13 :   3, 145 : 0xB178F942 ;   3 : 0x4D78AD62
      14 :   3,  37 : 0x4A6CE5E2 ;   2 : 0xBF94E1C6
      15 :   1, 102 : 0xBD628255 ;   0 : 0xFFB83D8D ****
      16 :   3, 122 : 0xF97B0905 ;   1 : 0x38533125
      17 :   3, 197 : 0x57A6865D ;   2 : 0xA61D31EF
      18 :   3,  27 : 0xC7227D7C ;   2 : 0xA3F9BA1E
      19 :   1,  16 : 0xBD628255 ;   0 : 0x8557CCC8 ****
      20 :   2,  53 : 0x1DA9D156 ;   3 : 0xC9051754
      21 :   2,  90 : 0x3CD66BEE ;   3 : 0xFD851D3E
      22 :   1, 252 : 0xBD628255 ;   0 : 0xB3F22701 ****
    there are 6 valid pairs in the list : 0 7 12 15 19 22
    

    So, hopefully, I have the decryption correct.

    Also of note is that you only get one chance to get this unlocking correct– fail, and the drive won’t return a valid DVD structure block again. You will either need to reboot the Xbox or eject & close the tray before you get to try again.

    Problems Making It Work In Linux
    There are a couple of ways to play with SCSI protocols under Linux. In more recent kernels, block devices are named /dev/sda, /dev/sdb, etc. Each of these block devices has a corresponding character device named /dev/sg0, /dev/sg1, etc. ‘sg’ stands for SCSI generic. This character devices can be opened as readable and/or writable and SCSI commands can be freely written with write() and data retrieved with read(). Pretty powerful.

    Except that the one machine I still possess which supports 40-pin IDE/ATAPI devices is running Linux kernel 2.6.24 which dates back to early 2008 and it still enumerates the IDE block devices as /dev/hda, /dev/hdb, etc. There are no corresponding /dev/sgX character devices. What to do ? It seems that a program can still issue SCSI commands using an ioctl() facility named SG_IO.

    I was able to make the SG_IO ioctl() work for the most part (except for the discovery that the Xbox drive doesn’t respond to a basic SCSI Inquiry command). However, I ran into a serious limitation– a program can only open a /dev/hdX block device in read-only mode if the device corresponds to a read-only drive like, for example, a DVD-ROM drive. This means that a program can’t issue SCSI mode select commands to the drive, which counts as writing. This means that my tool can’t unlock the drive.

    Current Status
    So this is where my experiment is blocked right now. I have been trying to compile various Linux kernels to remedy the situation. But I always seem to find myself stuck in one of 2 situations, depending on the configuration options I choose : Either the drives are enumerated with the /dev/hdX convention and I am stuck in read-only mode (with no mode select) ; or the drives are enumerated with /dev/sdX along with corresponding /dev/sgN character devices, in which case the kernel does not recognize the Xbox DVD-ROM drive.

    This makes me wonder if there’s a discrepancy between the legacy ATA/ATAPI drivers (which sees the drive) and the newer SATA/PATA subsystem (which doesn’t see the drive). I also wonder about hacking the kernel logic to allow SCSI mode select logic to proceed to the device for a read-only file handle.