Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mplayer fills kernel log with sg_write messages
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
LiquidAcid
Apprentice
Apprentice


Joined: 11 Sep 2006
Posts: 164

PostPosted: Sun Jul 08, 2007 7:50 pm    Post subject: mplayer fills kernel log with sg_write messages Reply with quote

Hi there,

I just reconfigured my system to use the new 2.6.21-r3 gentoo-sources kernel, this time enabling the new PATA/SATA subsystem. Everything works now, except for digital audio extraction.

I had to add SCSI generic support for that (sg module), so that mplayer (and cdparanoia) can access the cdrom device. Now every time I use mplayer for playback of an audio CD the kernel log is filled with messages like this:
Code:
sg_write: data in/out 30576/30576 bytes for SCSI command 0xbe--guessing data in;
   program mplayer not setting count and/or reply_len properly


This seems to be related to this problem:
http://readlist.com/lists/vger.kernel.org/linux-kernel/25/125901.html

AFAIK mplayer uses cdparanoia internally for digital audio extraction from the drives. So it's more a cdparanoia problem, which I triggered by enabling the new ATA system. I could somehow solve the problem by modifying the kernel sources (commenting out the logging command) but I'm searching for a more complete fix, maybe on the cdparanoia side. Does anyone know of some kind of (good NOT hacky) patch for this problem?

Thanks,
liquid

EDIT: I think most people don't encounter this problem because they haven't yet switchd to the new ATA system. Maybe I should also create a bugreport and let both cdparanoia, mplayer and sg maintainer know that the problem still exists?
Back to top
View user's profile Send private message
salahx
Apprentice
Apprentice


Joined: 12 Mar 2005
Posts: 296

PostPosted: Sun Jul 08, 2007 8:19 pm    Post subject: Reply with quote

You don't want to use the sg driver; use the regular sr driver instead. In Linux 2.6 and new ioctl, SG_IO was added to allow sending (a subset) of generic SCSI commands. That should make the error go away.
Back to top
View user's profile Send private message
LiquidAcid
Apprentice
Apprentice


Joined: 11 Sep 2006
Posts: 164

PostPosted: Sun Jul 08, 2007 8:20 pm    Post subject: Reply with quote

OK, but mplayer (and also cdparanoia) won't work when giving them the /dev/sr devices for reading. So what should I do?
Back to top
View user's profile Send private message
salahx
Apprentice
Apprentice


Joined: 12 Mar 2005
Posts: 296

PostPosted: Mon Jul 09, 2007 3:45 am    Post subject: Reply with quote

I'm also using the "new" ATA layer; so i decided to give it a try myself - exact same symptoms.

I also tried cdda2wav - it exacted it without the errors though. So it sounds like a problem with cdparanoia (http://xiph.org/paranoia/), although I can't rule out a kernel bug. Last time I checked, cdparanoia hasn't been maintained in quite some time.

<rant>
Sadly, for the many years I used Linux; CD/DVD operation have never truly worked right. On the Linux side, most of the code (isofs, udf) its unreadable and/or unmaintained. No idea on the SCSI layer (see below for reason) The userspace tools are in even worse shape. udftools hasn't been updated in years - not that anyone would notice anyway; as UDF filesystem barely works; and the packet writing drivers STILL OOPSes the latest stable gentoo-source (gentoo-source-2.6.20-r8) - and even with the patch applies it still sometimes OOPSes. Disk-at-once mode doesn't work at all; until i burn a CD in "raw" mode; the resulting CD is gibberish; but the it works in normal mode until the machine reboots.

I have no idea what the status of Linux SCSI layer is, as anything on LKML involving CD-recording will inevitably attract the author of cdrtools; Joerg Schilling. Unfortunately he and the rest of the kernel develops see things...differently. I have no idea who's right (I've heard the stuff Schilling says is wrong with the Linux SCSI layers is quite out of date, back in Linux 2.0/2.2 . ) but rest assured a lengthy flamewar will erupt: http://lkml.org/lkml/2006/1/23/267 .

Evey time I try to do anything with a CD my carpet get a little damper from all the tears of my frustration. And I don't even understand what the problem is; must less who to blame (or how to fix it)
</rant>
Back to top
View user's profile Send private message
LiquidAcid
Apprentice
Apprentice


Joined: 11 Sep 2006
Posts: 164

PostPosted: Mon Jul 09, 2007 10:01 pm    Post subject: Reply with quote

And yes, I can confirm that cdparanoia is not actively maintained. The stable version that you get when emerging the package is from march 2003. There is a testing version on the xiph site, but I think I have a better solution for the problem.

Both Reimar Döffinger (from mplayer ml) and Rocky Bernstein (from cdparanoia ml) suggested to use libcdio instead (http://www.gnu.org/software/libcdio/). libcdio seems to be a fork of cdparanoia and a lot more tools, and it is actively maintained (by R. Bernstein).

So I tried (old) cdparanoia and I gave me lots of warnings in the kernel log. Another thing is that you have also to provide the device name, otherwise cdparanoia won't find any drives.

cd-paranoia (when having emerged the libcdio package the executable is named libcdio-paranoia) works without giving information of the device nodes (it finds them automatically) and generates ZERO messages in the log.

But the best if yet to come: mplayer has support for libcdio, but sadly it is disabled in the standard ebuild (--disable-libcdio). I ask myself: why?? Gonna write bugreport...

cya,
liquid

EDIT: bugreport written. I tested a modified ebuild with cdparanoia disabled and libcdio enabled. Works as long as cddb use flag is also set. But this could also come from libcdio build with cddb useflag set. Checking this tomorrow...
Back to top
View user's profile Send private message
salahx
Apprentice
Apprentice


Joined: 12 Mar 2005
Posts: 296

PostPosted: Tue Jul 10, 2007 5:12 am    Post subject: Reply with quote

Well, it appear threat have already begun on LKML, Linux-scsi; and the Paranoia mailing list:

http://lkml.org/lkml/2007/7/8/41
http://lkml.org/lkml/2007/7/9/215
http://lists.xiph.org/pipermail/paranoia/2007-July/001521.html

Essentially, the message is harmless. When the sg driver was updated to version 3 - way, way back in the early 2.4 series - this message was added to the sg driver and printed whenever an application used the sg interface in an ambiguous way; unfortunately cdparanoia hasn't been updated.

It appear the flamewars have already begun. there's already a bug, too.

I can only hope maybe this time; the state of Linux CD ripping/writing will finally get fixed; I've been waiting for a over a decade now....
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum