# 2.6.8 and cdrecord?

## monkeyhead

so i read about some people having problems with cdrecord and the 2.6.8 kernel because i could not for the life of me get cdrecord to work.

it kept reporting that my drive appeared to be a regular cd-rom and did not support burning.

so after searching gentoo forums, I rebooted to my 2.6.7-gentoo-r9 kernel and sure enough it worked without a hitch.

Anyone found any solutions to this yet? I was using 2.6.8-mm2-rc2 when i encountered the problem.

----------

## scmckenzie

don't know about solution yet .. have to burn discs as root   :Confused: 

----------

## Pink

From k3b.org news:

 *Quote:*   

> 
> 
> Do not use Kernel 2.6.8
> 
> A patch that was introduced into the kernel shortly before the 2.6.8 release makes K3b and also the dvd+rw-tools unusable on Linux (unless run as root but that is not recommended). The very important GET CONFIGURATION MMC command is rejected by the kernel for reasons I cannot see and writing commands like MODE SELECT also fail (K3b cannot detect CD writers without it) even when the device is opened O_RDWR. Until this issue has been solved I strongly recommend to stick to kernel version 2.6.7.

 

On other words there is something wrong with cdrecording in 2.6.8-rc4 upwards.

----------

## Pink

Con has written an extremely simple patch to fix this problem (can;t beat his elegance and style in his patches compared to other brute force patches I could mention).

Anyway, here it is.

HTH   :Very Happy: 

----------

## blaster999

Strange things are happening with the kernel. The second bug in 2.6.8 after the NFS. Shouldn't there be 2.6.8.2 soon?   :Shocked: 

PickledOnion, thanks for the link to the patch! I've discovered the bug when tried to clear a CD-RW today.

P.S. And big thanks to Con Kolivas! I am using ck-sources now.

----------

## teutzz

@PickledOnion: what would be the correct way to patch the kernel with this patch?

----------

## Pink

 *blaster999 wrote:*   

> Strange things are happening with the kernel. The second bug in 2.6.8 after the NFS. Shouldn't there be 2.6.8.2 soon?  
> 
> PickledOnion, thanks for the link to the patch! I've discovered the bug when tried to clear a CD-RW today.
> 
> P.S. And big thanks to Con Kolivas! I am using ck-sources now.

 

No, it not a bug, the code was changed to try and close the security breach the cdrecord process has when recording a cd. Obviously any update to the code will affect cdrecording programmes and k3b are working on changeing their code to fit with the new kernel. Until that time, the fix will revert the code to the older way of doing it and the seciruty issue is still there (although I do haver to say I think it is a bogus security issue and is wrong to change it, but then I'm not a kernel programmer)   :Very Happy: 

----------

## blaster999

 *PickledOnion wrote:*   

>  the code was changed to try and close the security breach the cdrecord process has when recording a cd

 

Oh, sorry   :Embarassed:  Then we'll have to wait the next k3b. BTW, shouldn't setting cdrecord suid be a solution? Or it is a bigger security risk?

EDIT: Just noticed it IS suid.

----------

## Pink

Well, amazingly that is the basis of the so called 'security' problem. The fact that a user can record a cd is the whole security issue. The official answer is that you should be root to do that and only root should be able to record cds. 

Now to me, and it is only my opinion, logging in as root to record cds is a far bigger security issue than a user recording cds. They say that anyone can come to your computer and record something but my argument would be that if that is the case then all, and I mean all, disk writing should be done as root. No user should be able to write or save or read something on a computer if using a cdr is a problem. 

Obviously, my argument is not going to happen and would be ridiculous if it was even considered as realistic but that is the basis of the argument for the so called security issue.

Meh, at least we can record cds again   :Very Happy: 

----------

## Pink

 *teutzz wrote:*   

> @PickledOnion: what would be the correct way to patch the kernel with this patch?

 

To apply the fix do the following things, in this order and all will be fixed for you:

1. download the adjusted fix (see link above)

2. cd into your kernel directory (ie: cd /usr/src/linux-2.6.8.1)

3. enter the following command:

```
patch -p1 < /path/to/cddvd-cmdfilter-drop.patch
```

4. You will see one line telling you code has been patched

5. recompile the kernel using:

```
make && make modules_install
```

This will only take a few seconds as you are not recompiling the whole kernel again, just the adjusted file.

6. Mount /boot

7. copy the new bzImage over

8. reboot 

Enjoy recording again.

HTH   :Very Happy: 

----------

## teutzz

10x

----------

## teutzz

looks like i have to start learning manual patching (a thing that a lot of time i avoided)

----------

## blaster999

Well, may be alittle offtopic (just alittle). I've found  this article  on kerneltrap. Another issue with 2.6.8.1 and cdrecord - now memleak when recording audio cds. Patch included.

EDIT: After applying patch I haven't noticed the leak when writing audio cds. Didn't test before patching though (too lazy  :Smile:  )

EDIT2: Too optimistic: the CD recorded fine, but it sounds AWFUL! something is b0rked. Can someone confirm this misbehavior? Or maybe after ck's patch the patch by Kurt Garloff isn't necessary?

----------

## Phlogiston

I'm using the Love-Sources 2.6.8-rc4-love2 aka Staircase to Heaven Kernel and when I want to apply the patch I get this:

```

patch -p1 < /tmp/cddvd-cmdfilter-drop.patch

patching file drivers/block/scsi_ioctl.c

Reversed (or previously applied) patch detected!  Assume -R? [n] y

```

Could anybody help me? I can't delete my cdrw's....  :Sad: 

----------

## blaster999

Well, I reverted the memleak patch and got a huge memleak and a hangup while trying to write an audio CD (reset helped a lot  :Smile:  ). Now rebooted in 2.6.7-ck5 and tried to write the same tracks on the same cd-rewritable - and everything works (sound is good and no memleaks). Be warned: if you have a cd burner, using 2.6.8.1 is not a good idea.

----------

## Phlogiston

hmm i just burned a cd with my 2.6.8-rc4 and had no problems. And i can also delete cdrws again: on console it works fine, i think its a k3b related issue...

----------

## blaster999

Writing data cds doesn't reveal the memory leak. The bug can be seen only when burning audio cds. Get a cd-rw and try to write some audio tracks on it - you'll see what I mean (save all unsaved work before doing it - your system most probably will become unusable till next reboot).

----------

## Phlogiston

hmm ok, so I won't try it, but I changed the default kernel back to 2.6.7  :Wink: 

Will this problem be fixed in the next kernel version? Or is there a patch that really fixes this problem?

----------

## blaster999

There is a patch, but the Audio CD I've recorded using the patched 2.6.8.1 sounded AWFULLY. The patch (and info about the bug) can be found here:

http://kerneltrap.org/node/view/3659

----------

## deadmoo

what exactly sounded so bad about your audio cd? I made a cd with the unpatched 2.6.8 and it was not playable at all. is the audio cd made with the patched kernel playable at least? if you are using a cdrw that me be the cause of bad audio quality and not the kernel. do you get the same results with a cdr?

----------

## blaster999

Well, there was some audio when recorded with patched 2.6.8.1 but I hardly recognized the soundtracks. They sounded more like white noise than music. I rebooted into 2.6.7-ck5 and wrote the same tracks on the same cd-rw, the quality was good, so it's not the medium.

----------

## squeegy

 *Phlogiston. wrote:*   

> I'm using the Love-Sources 2.6.8-rc4-love2 aka Staircase to Heaven Kernel and when I want to apply the patch I get this:
> 
> ```
> 
> patch -p1 < /tmp/cddvd-cmdfilter-drop.patch
> ...

 

You're using 2.6.8-rc4 not 2.6.8.1 that's probably why.

----------

## Pink

If anyone wants to try it 2.6.8.1-mm2 contains fixes for the memory leak in recording cds.

it also has reiser4 in it (which will be interesting).

HTH   :Very Happy: 

----------

## Phlogiston

Hmm why is reiserfs4 interesting? Which advantages will it habe? Is ist faster?

----------

## Pink

I think it will be interesting as it has been in patchsets such as love-sources for some months and has kind of been tested heavily in those patches.

Now, instead of using one of the patchsets or downloading directly from namesys and patching your own kernel, anyone can simply emerge (when it appears in portage) the latest mm-sources and give the filesystem a go.

This will exponentially increase exposure of this young file system to users. Something that can only be good for it I think. 

The interesting part (for me) is whether it can stand the use and abuse it will receive from the hugely increased number of users and different setups and so-on.

That's all, it really is the first big exposure it has had. I think a lot of posts on lkml will be about it and I think there will be many problems (but then the mm patchset really is bleeding edge and users should know this), but in the long run it should help to mature it a bit, which it desperately needs 

As for performance, there are lots of threads about it, but in summary it is meant to be faster than other filesystems due to it's structure, etc. Apart from 1 or 2 things (such as diffing patches, etc) I found it significantly slower and unstable so I removed it from my system. I really am looking forward to when it goes in the mainsteam kernels.

 :Very Happy: 

----------

## deadmoo

here is the final fix

https://bugs.gentoo.org/show_bug.cgi?id=60779

i tested it and it works

i can now burn an audio cd without mem leak and the cd isn't corrupt

i hope it gets put in the genpatches soon

also there is a bug filed on the cd burner being detected as a regular cdrom

it is here

https://bugs.gentoo.org/show_bug.cgi?id=60756

some more useful information on it there

----------

## blaster999

Thanks for the info! I'll check the patch when KDE 3.3 compilation finishes.

----------

## tomaw

 *PickledOnion wrote:*   

> Con has written an extremely simple patch to fix this problem (can;t beat his elegance and style in his patches compared to other brute force patches I could mention).
> 
> Anyway, here it is.
> 
> HTH  

 

This wonderful patch causes my system to consume all ram whilst writing a cd.  Not in disc cache note, it just seems to vanish with this free output:

```
             total       used       free     shared    buffers     cached

Mem:       1036284    1006488      29796          0      11864     160816

-/+ buffers/cache:     833808     202476

Swap:       987956       1496     986460
```

This memory isn't reclaimed as applications require it, so I presume it must be a kernel problem.  Going back to 2.6.7-r14 works fine for me.

Also, I just noticed that the audio cd's (75minute, single audio track) aren't actually playable.  Nice beeps come out of the speakers.  Thankfully they are on rewriteable cd's.

Cheers,

----------

## Pink

Have you tried the other patches in this thread that address the memory leak issue? The others report differing results with it, but it may be worth while (or, as you say, stick with a working kernel).   :Very Happy: 

----------

## blaster999

 *Quote:*   

> This wonderful patch causes my system to consume all ram whilst writing a cd

 

This was an issue with 2.6.8.1, not the patch. It is fixed now

----------

## forbjok

 *PickledOnion wrote:*   

> Well, amazingly that is the basis of the so called 'security' problem. The fact that a user can record a cd is the whole security issue. The official answer is that you should be root to do that and only root should be able to record cds. 
> 
> Now to me, and it is only my opinion, logging in as root to record cds is a far bigger security issue than a user recording cds. They say that anyone can come to your computer and record something but my argument would be that if that is the case then all, and I mean all, disk writing should be done as root. No user should be able to write or save or read something on a computer if using a cdr is a problem. 
> 
> Obviously, my argument is not going to happen and would be ridiculous if it was even considered as realistic but that is the basis of the argument for the so called security issue.
> ...

 

If this is the case, wouldn't it be better to add a kernel config option for it, rather than just replacing the whole thing? So that you could choose whether to use the new "secure" code, or the old "insecure" code that allows users to write CDs. I can see how the "secure" code would be an improvement for servers where users have access to shells or such, and shouldn't be able to burn CDs anyway.

Just my 1 cent   :Wink: 

----------

## zerb

There is a patch in gentoo-dev-sources-2.6.8-r2. You still can't burn audio cd's though. Just tried it and all i get is what sounds like some experimental electronica.

----------

## Boohbah

 *zerb wrote:*   

> There is a patch in gentoo-dev-sources-2.6.8-r2. You still can't burn audio cd's though. Just tried it and all i get is what sounds like some experimental electronica.

 

Me too.

----------

## Phlogiston

I'm now using the 2.6.8.1 nitro5 kernel and I have no problems with burning audio cds  :Wink: 

----------

## Woocash

As root ?

----------

## Phlogiston

 *Woocash wrote:*   

> As root ?

 

no as the normal user  :Smile:  does this make a difference?

----------

## pilla

 *Phlogiston. wrote:*   

>  *Woocash wrote:*   As root ? 
> 
> no as the normal user  does this make a difference?

 

Yes, 2.6.8.x was also presenting an issue avoiding that other users (other than root) could burn CDs even with correct device permissions.

----------

## zerb

Yes, but latest gentoo-dev-sources incorporate a patch that makes it possible to burn cd's as a user again. It works like a charm except for audio cd's. You just get some weird beeps and clicks as a result.

----------

## Illissius

Eh, I hope this whole CD burning thing gets sorted out soon, I've been rebooting into windows for it because I just don't have the patience to keep experimenting. I've tried three times and none have worked - an audio cd that became bad electronica, another where the last track got cut off for no apparent reason, and a third time copying a CD and it wouldn't even read the disc afterwards.

Also, is it normal for the 'buffer' meter in k3b to jump around a lot? It stays pegged at 95-100% with Nero...

----------

## zerb

The 'buffer' behavior is the same here and has always been like that on many system I've had.

You're right with what you're saying about the whole cd writing thing. First there was only SCSI emulation and now that ATAPI burning works flawless (essential if you really want linux on desktops) they mess it up on the kernel side. Ok, you can see it as a security risk that users are able to write cds (and therefore can mess with your hardware). But what if you want someone being able to write cds on your system? With the new system you have to give them root privileges. I wonder if this really is that more secure.

For sure it's anything but user-friendly.

----------

## janiskr

buffer stands still at 100% no matter with what i'm writing CD writer or DVD writer, all the same 100%

CD writer is OLD philips 12x but DVD is LiteON cheapy one  :Wink: 

----------

## Broot

 *PickledOnion wrote:*   

> Well, amazingly that is the basis of the so called 'security' problem. The fact that a user can record a cd is the whole security issue. The official answer is that you should be root to do that and only root should be able to record cds. 
> 
> Now to me, and it is only my opinion, logging in as root to record cds is a far bigger security issue than a user recording cds. They say that anyone can come to your computer and record something but my argument would be that if that is the case then all, and I mean all, disk writing should be done as root. No user should be able to write or save or read something on a computer if using a cdr is a problem. 
> 
> Obviously, my argument is not going to happen and would be ridiculous if it was even considered as realistic but that is the basis of the argument for the so called security issue.
> ...

 

This seems like a perfectly logical counter-point to me. I'm hoping that the application-breaking changes that were made to the kernel weren't just to enforce root-only disc-recording privileges.   :Confused: 

2.6.9 can't get here fast enough.

----------

## robfish

I too am hanging out for a fix.

2.6.8 gentoo-dev-sources-r2 did fix the non-root user problem but audio CD's are still a problem.

----------

## pilla

AFAIK gentoo-dev-sources are mm-based, and mm does not work very well with my LVM/EVMS setup.

----------

## MasterMind

I installed and compiled new kernel.. No working  :Sad: . Do I have to enable something? Do I have to reemerge k3b?

----------

## deadmoo

 *pilla wrote:*   

> AFAIK gentoo-dev-sources are mm-based, and mm does not work very well with my LVM/EVMS setup.

 

gentoo-dev-sources are not mm based. they are based on vanilla with a dozen or so bug fix patches hand picked by gentoo. if you look at the genpatches* tarballs in distfiles you can see exactly what patches are being applied.

----------

## pilla

 *deadmoo wrote:*   

>  *pilla wrote:*   AFAIK gentoo-dev-sources are mm-based, and mm does not work very well with my LVM/EVMS setup. 
> 
> gentoo-dev-sources are not mm based. they are based on vanilla with a dozen or so bug fix patches hand picked by gentoo. if you look at the genpatches* tarballs in distfiles you can see exactly what patches are being applied.

 

Sorry, I stand corrected.  Are the love-sources mm-based?

----------

## rush_ad

fixed in 2.6.8-r2

----------

## Boohbah

 *rush_ad wrote:*   

> fixed in 2.6.8-r2

 

2.6.8-r2?  It's still not possible to burn audio CDs with gentoo-dev-sources-2.6.8-r2

 *Boohbah wrote:*   

>  *zerb wrote:*   There is a patch in gentoo-dev-sources-2.6.8-r2. You still can't burn audio cd's though. Just tried it and all i get is what sounds like some experimental electronica. 
> 
> Me too.

 

 *zerb wrote:*   

> Yes, but latest gentoo-dev-sources incorporate a patch that makes it possible to burn cd's as a user again. It works like a charm except for audio cd's. You just get some weird beeps and clicks as a result.

 

 *robfish wrote:*   

> I too am hanging out for a fix.
> 
> 2.6.8 gentoo-dev-sources-r2 did fix the non-root user problem but audio CD's are still a problem.

 

----------

## Boohbah

 *pilla wrote:*   

> 
> 
> Sorry, I stand corrected.  Are the love-sources mm-based?

 

love-sources used to be mm-based but are recently for the vanilla kernel.

----------

## MasterMind

 *rush_ad wrote:*   

> fixed in 2.6.8-r2

 

I forgot to mention this. I installed this kernel...

----------

## deadmoo

This is fixed in gentoo-dev-sources-2.6.8-r3 according to the changelog:

http://www.gentoo.org/cgi-bin/viewcvs.cgi/*checkout*/sys-kernel/gentoo-dev-sources/ChangeLog

----------

## Moloch

The latest nitro-sources (nitro5 at the moment) fixed it for me. This morning I was burning an audio CD, while burning I was listening to some mp3's, that's it, I normally browse the web or other things at the same time. Everything was going smoothly, memory usage remained low, cpu usage for cdrecord around 5% I guess, wasn't paying much attenttion. XMMS was only using 3-5%. At the end of the CD maybe around track 9 of 11 everything got choppy. Buffer was getting unstable. 

Before choppiness: FIFO at a steady 100%(assuming drive buffer) and buffer at a steady 97%(assuming system memory buffer)

During choppiness: lowest point was at 13%, not too sure I started to panic at this time. Quickly stopped XMMS and kept an eye on torsmo (cpu, memory usage monitor & etc).

After the burn was completed cdrecord said burnfree was never used and the buffer's lowest point was at 13%

I played the CD and it seemed fine, skipped to the last few tracks and did not discover any obvious problems. During all of this I didn't notice memory getting high, but like I said I was more in a panic making sure I don't create another coaster.

I preceded to burn a second audio CD with nothing open, min buffer was at %85, still should be higher. CD came out fine though.

This was burning as root actually, because cdrecord does that realtime priority setting. I'm wondering if I should be burning as a user and/or try running cdrecord with schedtool -I since I am  using a kernel patched with the various sched patches.

I've finally been happy with bashburn as I've had a difficult time parting from Nero on Windows. IMHO cdburning is the one area Linux is really struggling at. I'm an FVWM user, ex-KDE user, I still prefer QT/KDE apps, but K3B has always given me problems.

EDIT:

Almost forgot, system specs

Athlon 1800+

768 MB ram

Lite-On (CD only) 52x32x52x

----------

## deadmoo

 *Moloch wrote:*   

> The latest nitro-sources (nitro5 at the moment) fixed it for me. This morning I was burning an audio CD, while burning I was listening to some mp3's, that's it, I normally browse the web or other things at the same time. Everything was going smoothly, memory usage remained low, cpu usage for cdrecord around 5% I guess, wasn't paying much attenttion. XMMS was only using 3-5%. At the end of the CD maybe around track 9 of 11 everything got choppy. Buffer was getting unstable. 

 

Are you using write barriers? I had this problem when i was using write barriers. I got rid of write barriers (not just the kernel option but reversed the patches for it), and it stop doing this.

----------

## Moloch

 *Quote:*   

> Are you using write barriers? I had this problem when i was using write barriers. I got rid of write barriers (not just the kernel option but reversed the patches for it), and it stop doing this.

 

Uh yea... damn it. Write barriers seems like such a good thing.

----------

## robfish

I now have my audio CD's burning again with 2.6.8 gentoo-dev-sources-r3.

Yahoo!!!

----------

## Boohbah

 *robfish wrote:*   

> I now have my audio CD's burning again with 2.6.8 gentoo-dev-sources-r3.
> 
> Yahoo!!!

 

Me too.

Yahoo!!!!  :Laughing: 

----------

## MasterMind

I disabled the patching of fbsplash. I hope it's going to work  :Very Happy:  (I use the bootsplash patch.. And it don't patch if it is allredy patched with fbsplash...).

----------

