# How I got k3b working with just ATAPI (no ide-scsi, 2.6.x).

## i_hate_your_os

NOTE: I doubt this will work unless you have linux 2.6.x (but if it does, let me know and I'll change this note).

OK, this one was kind of hard.  A little background.  I was doing a huge emerge including kde, gnome, and openoffice updates, when my friend says "hey Greg, I need you to burn these CD's for me before tomorrow".  Well, historically, I have done all my CD burning in Windows, so I decided, "hey, this is a pretty good excuse to figure out how to do this in Gentoo."

So, I popped onto the forums, and the consensus seemed to be that k3b is a good burning program, but that ide-scsi was the standard way to do this.  Well, I compile my ide stuff into my kernel (no modules, which is dumb, since I boot off real scsi)... so ide-scsi was a no-go for my situation.

So, searching the forums again, I found this thread: https://forums.gentoo.org/viewtopic.php?t=121250, which seemed pretty promising.  I did more-or-less as the posters said, something like:

```

# emerge --onlydeps cdrtools cdrdao k3b

# ACCEPT_KEYWORDS="~x86" emerge -u --nodeps cdrtools cdrdao k3b

```

Now, just to be fancy, I decided to emerge dvd+rw-tools and normalize; these may not be essential.  To get dvd+rw-tools to emerge, I did 

```
# ACCEPT_KEYWORDS="~x86" emerge -p dvd+rw-tools
```

, figured out what version it wanted, and then edited that ebuild, turning "~x86" temporarily (until the next emerge rsync) to "x86", since I wanted to get the dependencies, but not upgrade 10 million things... then I just did 

```
# emerge dvd+rw-tools
```

.  If you don't have a dvd then you shouldn't bother with that anyhow.  Finally, I just did 

```
# emerge normalize
```

.

If you are following this as a step-by-step "guide," STOP DOING THAT NOW AND READ THE ENTIRE THING before you continue... this narrative includes descriptions of some mistakes I made with potentially disasterous consequences.  You have been warned!!!

Great, now I think I have the right packages.  Now, as root, I run 

```
# kcmshell k3bsetup2
```

.  Despite the advice of the ebuild, I went ahead and let it set things to run as root.  Sketchy, and perhaps very much so, as you will read about below, but I figured, "hey, I'm a stud, I won't do anything stupid".  Famous last words, as ever... read below and then decide for yourself if you want to do this (if you do not, you will need to make sure that your user account has read/write access to the ide device where your cd burner is).  If you are stumped, play it safe: uncheck the boxes to run things as root.

So I run k3b (neat interface, looks, err.. familiar  :Wink: ).  

I set up my friends playlist like he wants it and go to burn.    :Mad:   :Mad:   :Mad:  No dice!!  It blurts errors at me about using --device option to cdrecord.  I found this a little odd, since the posters to the above-mentioned thread did not have this problem... oh well.

Allright, I read some man pages and search the forums a bit more, and figure out that I need to tell cdrecord to use ATAPI.  Here's what I (eventually) did (you can do this too, should be safe AFAIK):

```
# cdrecord dev=ATAPI:0,0,0 -scanbus
```

You may need to change the first "0" above (they are zero's not alphabetic O's, of course), to the number of your IDE gizmo in your linux.  If you can't remember, look for some program that is already set to talk to your cdrom.  Follow any symlinks back to the source.  It probably looks like "/dev/ide/hostX/busY/targetZ/lun0/cd", where X,Y, and Z are smallish numbers corresponding to the 0,0,0 above, respectively.  So, if it was host4, I would use "dev=ATAPI:4,0,0".

This gave the following output:

```

Cdrecord-Clone 2.01a23-dvd (i686-pc-linux-gnu) Copyright (C) 1995-2003 Jörg Schilling

Note: This version is an unofficial (modified) version with DVD support

Note: and therefore may have bugs that are not present in the original.

Note: Please send bug reports or support requests to <warly@mandrakesoft.com>.

Note: The author of cdrecord should not be bothered with problems in this version.

scsidev: 'ATAPI:0,0,0'

devname: 'ATAPI'

scsibus: 0 target: 0 lun: 0

Warning: Using ATA Packet interface.

Warning: The related libscg interface code is in pre alpha.

Warning: There may be fatal problems.

Using libscg version 'schily-0.7'.

scsibus0:

        0,0,0     0) 'PIONEER ' 'DVD-RW  DVR-105 ' '1.30' Removable CD-ROM

        0,1,0     1) *

        0,2,0     2) *

        0,3,0     3) *

        0,4,0     4) *

        0,5,0     5) *

        0,6,0     6) *

        0,7,0     7) *

```

Well, that pioneer is my burner. great!  So now I know for sure (even though I already suspected) that 0,0,0 is the right thing.   The numbers to the left of your unit are the right ones.

So, back in k3b, I opened up the k3b preferences dialog (settings->k3b config), and picked the "Programs" icon on the left, and then the User Parameters on the right.  Beside cdrecord, I put in: 

```
--device=ATAPI:0,0,0
```

 (use the right numbers for your unit; note the equal sign).

Now, here is where it got really dicey.  DO NOT DO THIS but I went ahead and tried to burn at this time.  My drive would spin, but still no love.  Various results happened, things locked up, crashed, etc... finally I tried dmesg, and to my horror I figured out that it was running cdrdao, and trying to burn the darn image to my SCSI drive!!!  So, don't do that.  Note that, had I followed the instructions I had read from the ebuild, and refused to change things to be run as root, I would have had much less chance to screw up my system.  As it stands, I haven't rebooted since then, and I am slightly scared that things will be borked when I do (fdisk says my partition tables are intact, which seems like a good indicator  :Wink: ).

Instead, do the following:

First, go to http://cdrdao.sourceforge.net/drives.html#dt.  Find the closest match you can to your drive there. You can use the output from cdrecord you generated above to remind yourself of the exact model of your drive.  Then get the text under the "driver" column of this page.  In my case, this was "generic-mmc".  So, to test it, I put in a blank disk (well, I already had it in after all my previous bumbling), and ran 

```
cdrdao disk-info --device ATAPI:0,0,0 --driver generic-mmc
```

 (Of course, you should substitude the same X,Y,Z numbers you used above, and the driver you got from the link above.  Note that this time, there are no "equals" signs).

Bingo, it gave me something that looked OK, and, more importantly, didn't mention my SCSI hard drive  :Wink: .

So, just like for "cdrecord", I put in "user arguments" into the k3b config next to cdrdao: 

```

--device ATAPI:0,0,0 --driver generic-mmc
```

 (make the same substitutions as above).

Now, finally, k3b worked like a charm.  Similar arguments may need to be provided to other programs, if you are doing other fancy things like DVD-burning.  But for burning DAO CD's I was "go".  Yay!

Here are some other threads that deal with these issues and similar, I found quite a number of them:

https://forums.gentoo.org/viewtopic.php?t=122782

https://forums.gentoo.org/viewtopic.php?t=125502

https://forums.gentoo.org/viewtopic.php?t=120984

https://forums.gentoo.org/viewtopic.php?t=117445

https://forums.gentoo.org/viewtopic.php?t=121740

https://forums.gentoo.org/viewtopic.php?t=121250

YMMV. Good luck!

Edit 01.19.04

Modified to clarify that cdrecord wants an equals sign and cdrdao doesn't; fix fdisk/fstab thinko.

----------

## snakattak3

I'd love to get this working. Maybe you can help.

I'm using k3b-cvs, but ATAPI isn't seeming to working. Here's my info:

```
Cdrecord-Clone 2.01a23 (i686-pc-linux-gnu) Copyright (C) 1995-2003 Jörg Schilling

scsidev: 'ATAPI:0,0,0'

devname: 'ATAPI'

scsibus: 0 target: 0 lun: 0

Warning: Using ATA Packet interface.

Warning: The related libscg interface code is in pre alpha.

Warning: There may be fatal problems.

Using libscg version 'schily-0.7'.

scsibus0:

        0,0,0     0) '_NEC    ' 'DV-5700A        ' '1.05' Removable CD-ROM

        0,1,0     1) 'SONY    ' 'CD-RW  CRX140E  ' '1.0h' Removable CD-ROM

        0,2,0     2) *

        0,3,0     3) *

        0,4,0     4) *

        0,5,0     5) *

        0,6,0     6) *

        0,7,0     7) *
```

using kernel 2.6.1-gentoo-dev-sources_rc3. In k3b I have  

```
--device ATAPI:0,1,0 --driver generic-mmc
```

 for my user parameters in cdrdao and in cdrecord.

Here's my error in k3b: 

```

cdrecord

-----------------------

/usr/bin/cdrecord: Badly placed option. Global options must be before any track.

cdrecord comand:

-----------------------

/usr/bin/cdrecord -v gracetime=2 dev=/dev/ide/host1/bus0/target1/lun0/cd speed=6 -dao -eject --device ATAPI:0,1,0 --driver generic-mmc -waiti -data -tsize=512342016 - 
```

I seem to have done everything you did, if you catch something, please let me know. And i didn't just copy your --driver information, i just happen to have the same driver from that list you gave.

----------

## i_hate_your_os

 *snakattak3 wrote:*   

> I'd love to get this working. Maybe you can help.
> 
> I'm using k3b-cvs, but ATAPI isn't seeming to working. Here's my info:
> 
> ```
> ...

 

Try: "--device=ATAPI:0,1,0".  Use an equal sign instead of a space in the argument to cdrecord (but not cdrdao).  That is how I did mine, at least, and it worked for me.

EDIT

OK, a clarification:

cdrecord wants "equals" signs.

cdrdao doesn't want "equals" signs.

Edited the stuff above to clarify this.  Also, the "-driver=" options to cdrecord are different from the ones to cdrdao, I think.  Try "cdrecord -driver=HELP" to get a list.

----------

## snakattak3

Thanks for your help, but still doesn't seem to be working. I've put into the paramters for cdrdao:

```
--device ATAPI:0,1,0
```

, and into cdrecord:

```
dev=ATAPI:0,1,0 driver=mmc_cdr
```

This seems to be the driver I need for my sony, at least this driver gives me no error messages. But when I go to copy a cd, i get this output from k3b in the error console:

```
System

-----------------------

K3b Version: 0.10.99

KDE Version: 3.1.94 (CVS >= 20031206)

QT Version:  3.3.0-snapshot-20031220

cdrecord

-----------------------

scsidev: 'ATAPI:0,1,0'

devname: 'ATAPI'

scsibus: 0 target: 1 lun: 0

Warning: Using ATA Packet interface.

Warning: The related libscg interface code is in pre alpha.

Warning: There may be fatal problems.

SCSI buffer size: 64512

Cdrecord-Clone 2.01a23 (i686-pc-linux-gnu) Copyright (C) 1995-2003 Jörg Schilling

TOC Type: 1 = CD-ROM

Waiting for data on stdin...

Using libscg version 'schily-0.7'.

atapi: 1

Device type    : Removable CD-ROM

Version        : 0

Response Format: 1

Vendor_info    : 'SONY    '

Identifikation : 'CD-RW  CRX140E  '

Revision       : '1.0h'

Device seems to be: Generic mmc CD-RW.

Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).

Driver flags   : MMC-2 SWABAUDIO 

Supported modes: TAO PACKET SAO SAO/R96R RAW/R96R

Drive buf size : 4183808 = 4085 KB

FIFO size      : 4194304 = 4096 KB

Track 01: data   258 MB        

Total size:      296 MB (29:24.94) = 132371 sectors

Lout start:      297 MB (29:26/71) = 132371 sectors

Current Secsize: 2048

ATIP info from disk:

  Indicated writing power: 4

  Is unrestricted

  Is not erasable

  Disk sub type: Medium Type A, low Beta category (A-) (2)

  ATIP start of lead in:  -11634 (97:26/66)

  ATIP start of lead out: 359849 (79:59/74)

Disk type:    Short strategy type (Phthalocyanine or similar)

Manuf. index: 3

Manufacturer: CMC Magnetics Corporation

Blocks total: 359849 Blocks current: 359849 Blocks remaining: 227478

Starting to write CD/DVD at speed 8 in real SAO mode for single session.

Last chance to quit, starting real write in 2 seconds.

   1 seconds.

cdrecord comand:

-----------------------

/usr/bin/cdrecord -v gracetime=2 dev=/dev/ide/host1/bus0/target1/lun0/cd -dao -eject dev=ATAPI:0,1,0 driver=mmc_cdr -waiti -data -tsize=271095808 - 
```

 To me, there doesn't seem to be any error messages, but in the k3b window, everything looks normal untill it tries to read the cd. It says  *k3b wrote:*   

> Error while reading session 1

  If you got any more suggestions, please do post.

----------

## Oo.et.oO

BTW, you can compile scsi disk support into the kernel and leave scsi cdrom and ide-scsi and scsi-generic et. al in modules and load them as needed.

there are definite limitations still to using atapi only. 

there are also limitations to using gui's for cd burning, lest i digress..... 

i'm a pure cdrecord/cdrdao command line guy   :Razz: 

----------

## i_hate_your_os

 *snakattak3 wrote:*   

> Thanks for your help, but still doesn't seem to be working. I've put into the paramters for cdrdao:
> 
> ```
> --device ATAPI:0,1,0
> ```
> ...

 

Well, I am making guesses at this point, I confess.  But, the following do come to mind:

o Try a different driver (Searching the 'net makes me think you have the right one, though... or try no driver specification at all).

o Try a different CD (perhaps yours is a coaster now?)

o Sure you have write permissions on the drive's node in /dev?

o Specify a driver for cdrdao and do it in DAO mode.

o Have k3b build an iso, and use the command line; this way hopefully you won't miss the error output.

Well, probably not helpful, I'm just making this stuff up... sorry if it isn't helpful  :Sad:   If you do get it to work please let us know how you did it.

----------

## i_hate_your_os

 *Oo.et.oO wrote:*   

> BTW, you can compile scsi disk support into the kernel and leave scsi cdrom and ide-scsi and scsi-generic et. al in modules and load them as needed.
> 
> there are definite limitations still to using atapi only. 
> 
> 

 

Hmm, "hard" limitations, or fixable limitations, as in "this is alpha software and won't work so great until more people try it and report bugs"?  I ask because I had the impression that scsi-emulation was kind of a hack...

 *Oo.et.oO wrote:*   

> there are also limitations to using gui's for cd burning, lest i digress..... 
> 
> i'm a pure cdrecord/cdrdao command line guy  

 

Well, k3b apparently just builds an .iso and pipes it to cdrecord, as you can see in the command line it dumps above.  Although apparently in snakattak3's case, it's not showing the error output, which I agree is not helpful.

So, sure, I guess it's a philosophical or personal preference type of thing.  Personally, I like gui AND command-line computing, they both have a place on my box (and building a CD from .mp3's and .ogg files is more of a gui type of task in my mind... although I could see why the actual burning might be a little less awkward if done at the command-line, especially when it doesn't "just work.")

----------

## Radi

i'm getting this error when try to compile cdrdao. I'm using gentoo-dev-sources-2.6.1 and i don'T want the scsi-ide emulation.

```
make[1]: Entering directory `/var/tmp/portage/cdrdao-1.1.7-r3/work/cdrdao-1.1.7/dao'

Makefile:107: port.d: No such file or directory

Makefile:107: data.d: No such file or directory

Makefile:107: CdrDriver.d: No such file or directory

Makefile:107: CDD2600Base.d: No such file or directory

Makefile:107: CDD2600.d: No such file or directory

Makefile:107: PlextorReader.d: No such file or directory

Makefile:107: GenericMMC.d: No such file or directory

Makefile:107: SubChannel.d: No such file or directory

Makefile:107: PQSubChannel16.d: No such file or directory

Makefile:107: PWSubChannel96.d: No such file or directory

Makefile:107: PQChannelEncoder.d: No such file or directory

Makefile:107: GenericMMCraw.d: No such file or directory

Makefile:107: PlextorReaderScan.d: No such file or directory

Makefile:107: RicohMP6200.d: No such file or directory

Makefile:107: TaiyoYuden.d: No such file or directory

Makefile:107: YamahaCDR10x.d: No such file or directory

Makefile:107: TeacCdr55.d: No such file or directory

Makefile:107: SonyCDU920.d: No such file or directory

Makefile:107: SonyCDU948.d: No such file or directory

Makefile:107: ToshibaReader.d: No such file or directory

Makefile:107: CdTextEncoder.d: No such file or directory

Makefile:107: Settings.d: No such file or directory

Makefile:107: dao.d: No such file or directory

Makefile:107: ScsiIf-lib.d: No such file or directory

Makefile:107: main.d: No such file or directory

Creating dependencies for main.cc

Creating dependencies for ScsiIf-lib.cc

Creating dependencies for dao.cc

ScsiIf-lib.cc:37:21: xconfig.h: No such file or directory

ScsiIf-lib.cc:38:22: standard.h: No such file or directory

ScsiIf-lib.cc:39:24: scg/scgcmd.h: No such file or directory

ScsiIf-lib.cc:40:28: scg/scsitransp.h: No such file or directory

make[1]: *** [ScsiIf-lib.d] Error 1

make[1]: *** Waiting for unfinished jobs....

make[1]: Leaving directory `/var/tmp/portage/cdrdao-1.1.7-r3/work/cdrdao-1.1.7/dao'

make: *** [all] Error 1

!!! ERROR: app-cdr/cdrdao-1.1.7-r3 failed.

!!! Function src_compile, Line 76, Exitcode 2

!!! (no error message)

```

Has someone got this error before ?

----------

## snakattak3

 *i_hate_your_os wrote:*   

> Well, probably not helpful, I'm just making this stuff up... sorry if it isn't helpful   If you do get it to work please let us know how you did it.

 

Will do. I'm beginning to think its something do do with the source code in k3b. I'm taking a look at that, because it seems to pass 2 device options to cdrecord even if you specify your own. ie - it will use 

```
dev=/dev/ide/....pathto/lun0/target0
```

, and then add my own device options later on in the command. I guess k3b is still very new to atapi burning, even in cvs. I only really want to get this working because i like having on-the-fly ccopy mode, instead of making it create an image, then burning the image, because i don't like using scsi emulation on my other dvd drive, as it makes dvd playback slow (only because hdparm can't handle scsi devices..they usually are already fast). Anywyas, i'm rambling. I'm taking some more looks at the src-code, and maybe even will email the k3b developers. Wish me luck. Again..if you got an idea, please post.

----------

## sawanv

@Radi:

You need to emerge the unstable cdrecord tools in order to get rid of the errors:

```
ACCEPT_KEYWORDS=~86 emerge cdrecord cdrdao
```

Sawan

----------

## sawanv

@Radi:

You need to emerge the unstable cdrecord tools in order to get rid of the errors:

```
ACCEPT_KEYWORDS=~86 emerge cdrecord cdrdao
```

Sawan

----------

## sawanv

@Radi:

You need to emerge the unstable cdrecord tools in order to get rid of the errors:

```
ACCEPT_KEYWORDS=~86 emerge cdrecord cdrdao
```

Sawan

----------

## Kow

Whenever I try to burn an Audio CD I get:

No audio decoder plugins found. You won't be able to add any files to the audio project!

*  media-libs/libmad

      Latest version available: 0.15.0b-r1

      Latest version installed: 0.15.0b-r1

/usr/lib/libmad.la

/usr/lib/libmad.so

/usr/lib/libmad.a

/usr/lib/libmad.so.0.2.0

/usr/lib/libmad.so.0

----------

## i_hate_your_os

 *Kow wrote:*   

> Whenever I try to burn an Audio CD I get:
> 
> No audio decoder plugins found. You won't be able to add any files to the audio project!
> 
> *  media-libs/libmad
> ...

 

Not sure about this; one possible factor is that k3b has been upgraded since I wrote this guide.  Will try to look into it soon unless some other poster has an answer for you.

----------

## Kow

Thanks, I think it's related to KDE 3.2

Im going to try and compile k3b by hand and see what happens, specifying my own lib dirs.

----------

## TheEternalVortex

This worked for me with:

cdrecord dev=ATAPI:0,0,0 --driver mmc_cdr

Thanks for the guide.

----------

## Kow

There must be something wrong with the k3b ebuild settings library directories or something, because I ./configure'd by hand and got success:

Configure results:

------------------------------------------

Ogg Vorbis support:                    yes

Mp3 decoding support (libmad):         yes

    ID3 Tag handling with libid3:      yes

FLAC support:                          yes

Audio resampling:        using K3b version

Resmgr support:                         no

Audioplayer available (aRts)           yes

Compile K3bSetup 2:                    yes

------------------------------------------

.. output from ./configure

PS: New k3b ebuilds have k3bsetup disabled in the prefix... ebuild code:

```

        use debug && myconf="${myconf} --enable-debugging --enable-profiling" \

                || myconf="${myconf} --disable-debugging --disable-profiling"

        use kde || myconf="${myconf} --without-k3bsetup"

```

Notice the --without-k3bsetup

----------

## Kow

At any rate k3bsetup does still not run and it says audio decoders not found even tho configure found them....

Something is either messed up with kde 3.2 or k3b.. kde 3.2 was from the ebuild gentoo released so if its kde 3.2 then gentoo needs to fix that.

----------

## Kow

When I run k3b from console and get to the audio decoders problem i get:

k3b: (K3bDeviceManager) request for empty device!

QMetaObject::findSignal:K3bAudioListView: Conflict with QListView::doubleClicked(QListViewItem*,const QPoint&,int)

and when i run k3bsetup from shell

bash-2.05b$ k3bsetup

bash-2.05b$

thats it, no errors, nothing.

----------

## Kow

thanks for all the help as you can see im still waiting for any type of response

----------

## Bionic_Redneck

I don't know why but mine setup fine with k3b setup and you can just click on the text on right side under devices to choose driver, max read speed, and max write speed. only problem is I choose to write @ 8x but was dropped down to 4x complaining that medium only supported up to 4x but these cdrw's are rated for up to 12x

----------

## i_hate_your_os

wow, sounds pretty messed up.  k3bsetup ran for me but i have not tried burning yet with the new version.

----------

## yourtt

the ATAPI XYZ order seems not correct

Instead, it should be /dev/ide/host0/busX/targetY/lunZ/cd.

eg. /dev/ide/host0/bus1/target0/lun0/cd

would be ATAPI:1,0,0

(NOT ATAPI:0,1,0)

----------

## i_hate_your_os

 *yourtt wrote:*   

> the ATAPI XYZ order seems not correct
> 
> Instead, it should be /dev/ide/host0/busX/targetY/lunZ/cd.
> 
> eg. /dev/ide/host0/bus1/target0/lun0/cd
> ...

 

really... that's interesting, I never thought about it, since in my case it was all zero's either way... but since this notation obviously excludes either the host# or the lun#, I am surprised that the lun# would be used, since it rarely matters (whereas having multiple scsi hosts is just a matter of multiple cards).

Can anyone confirm or deny this?

----------

## CrashPat

w00t.  

Works for me if I use 

cdrecord dev=ATAPI:0,0,0 --driver generic-mmx

----------

## Strukt

I just want to place my thanks to the thread-creator, what you wrote in this thread helped me get my DVD burning working with the 2.6.3-r1 kernel using KDE windowmanager and ofcourse Gentoo as the base system.

Thanks  :Smile: 

Some info about my system.

AMD XP CPU at 2100Mhz (yes, mhz..)

Nforce 2-based mobo

SIL3112 SATA controller (amazingly got it to work with my raptor drive)

512MB DDR Dual Channel

NEC 1300A DVD Writer

Thanks again  :Wink: 

----------

## rtwick

bumping to try it later

----------

## calhoun

bump

----------

## cptmorgan

Well the reason I tried this out was that before I upgraded to 2.6 kernel I could burn cds fine and it would fly. Now with 2.6 kernel the buffer stays way low and jumps around and burns at avg 10x even without atapi.  This is ridiculous and Ive tried everything, even this guide. Everything still works but my system bogs down and it burns way slow.... anyone have any ideas ?

----------

## Shan

NOTE:  I found that I had to use "dev=ATAPI:0,1,0" for my CDRecord options in K3b, not the suggested --device=ATAPI:0,1,0 (adjusting to the proper dev numbers of course).

Other than that, your guide worked great, and I didn't have to do any extra configuration to get DVD's to burn either (outside of having dvd+rw-tools installed)

----------

## farceb

If something fails, you can check out this link http://gentoo-wiki.com/HOWTO_ATAPI_CD_Burning, it was usefull to me.

----------

