You are not logged in.

#1 2011-12-26 19:14:07

pilgrim689
Member
Registered: 2011-12-23
Posts: 6

Can't enable DMA on cd rom drive

Hey,

How could I get my CD ROM drive, recognized as /dev/sr0, to get Direct Memory Access enabled?

The reason for this is when I use mplayer to read from an audio CD, the cache gets emptied pretty fast (and without it, audio is too choppy to listen to), and I'm guessing enabling DMA will make it run smoothly.

After some searching I tried 'hdparm':

hdparm -d /dev/sr0

And I get:

/dev/sr0:
HDIO_GET_DMA failed: Inappropriate ioctl for device

Any help would be appreciated!

Offline

#2 2011-12-26 19:18:55

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: Can't enable DMA on cd rom drive

Can you post the exact command you use with mplayer? Have you tried

mplayer cdda:// -cache 8192

Offline

#3 2011-12-26 19:28:07

pilgrim689
Member
Registered: 2011-12-23
Posts: 6

Re: Can't enable DMA on cd rom drive

Thanks for the swift reply.

Here's the result:

[pilgrim@archie ~]$ mplayer cdda:// -cache 8192
MPlayer SVN-r34426-4.6.2 (C) 2000-2011 MPlayer Team
181 audio & 384 video codecs
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing cdda://.
Can't open CDDA device.
Failed to open cdda://.


Exiting... (End of file)

When I manage to get it playing I'm running:

[pilgrim@archie ~]$ sudo mplayer -cdrom-device /dev/sr0 cdda:// -cache 8192
MPlayer SVN-r34426-4.6.2 (C) 2000-2011 MPlayer Team
181 audio & 384 video codecs
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing cdda://.
Found audio CD with 20 tracks.
Cache fill:  0.00% (0 bytes)   
Track 1
Cache fill: 19.91% (1669920 bytes)   

rawaudio file format detected.
Cache not responding! [performance issue]
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
[AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:   8.7 (08.7) of 4454.4 ( 1:14:14.3)  0.6% 13% 

Notice how just 8 seconds in, the cache dropped from 20 to 13, and it won't refill... it just keeps emptying until I get the choppy behavior again. I think making the cache huge would be a workaround but maybe there's a better solution.

Last edited by pilgrim689 (2011-12-26 19:33:38)

Offline

#4 2011-12-26 19:32:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: Can't enable DMA on cd rom drive

Have you tried other tools like cdcd?


When pasting code, please use [ code ] tags, not [quote ] tags https://bbs.archlinux.org/help.php#bbcode

like this

It makes the code more readable and more convenient to scroll through.


Edit:
You need to use 'sdparm', not 'hdparm':

[karol@black ~]$ sdparm -d /dev/sr0
    /dev/sr0: HL-DT-ST  CD-RW GCE-8481B   1.10  [cd/dvd]
Read write error recovery mode page:
  AWRE        0  [cha: n, def:  0]
  ARRE        0  [cha: n, def:  0]
  PER         0  [cha: n, def:  0]
Write parameters (MMC) mode page:
  BUFE        1  [cha: y, def:  1]
  WR_T        1  [cha: y, def:  1]
  MULTI_S     0  [cha: y, def:  0]
[karol@black ~]$ hdparm -d /dev/sr0

/dev/sr0:
 HDIO_GET_DMA failed: Inappropriate ioctl for device

No idea what it does, but it at least works ;P

Last edited by karol (2011-12-26 19:46:01)

Offline

#5 2011-12-26 20:25:53

pilgrim689
Member
Registered: 2011-12-23
Posts: 6

Re: Can't enable DMA on cd rom drive

I've changed the quote blocks to code blocks.

I tried playing the cd through 'cdcd' but the cd was playing without sound... (notice the seek time growing)

cdcd> play
cdcd> info
Album name:     
Total tracks:   20      Disc playing:   00:07 of 74:16
Playing:         01 00:05 of 05:55
cdcd> info
Album name:     
Total tracks:   20      Disc playing:   00:13 of 74:16
Playing:         01 00:11 of 05:55

Rather than figure out the issue with cdcd, I went all out and tried VLC tongue.
VLC runs the CD fine with no choppy playback.

I guess it has a smarter caching mechanism?

So then the solution is to ditch mplayer for VLC when playing CD's

edit:

The sdparm solution you give does not work for my original issue (to enable DMA on /dev/sr0). 'man sdparm' shows that the '-d' option is completly different from 'hdparm -d'

Last edited by pilgrim689 (2011-12-26 20:27:09)

Offline

#6 2011-12-26 20:31:58

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: Can't enable DMA on cd rom drive

Yeah, I couldn't find a suitable option in sdparm, but I though this was the right tool for playing with CD drives. Guess I was wrong ;P

CD playing seems tricky, other people had similar problems with cdcd, but it works for me.
I think you can mark the thread as solved.

Last edited by karol (2011-12-26 20:32:14)

Offline

#7 2011-12-27 03:19:23

pilgrim689
Member
Registered: 2011-12-23
Posts: 6

Re: Can't enable DMA on cd rom drive

Thanks for the help smile

I'm thinking it would be more appropriate to mark it as solved once the original issue is solved (getting DMA enabled on my cd drive)... or if I figure out why it is not possible.

Offline

#8 2011-12-31 15:37:30

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: Can't enable DMA on cd rom drive

What's the output of 'hdparm -i /dev/sr0'?

Offline

#9 2011-12-31 16:55:23

pilgrim689
Member
Registered: 2011-12-23
Posts: 6

Re: Can't enable DMA on cd rom drive

[pilgrim@archie network.d]$ hdparm -i /dev/sr0

/dev/sr0:
 HDIO_DRIVE_CMD(identify) failed: Bad address

 Model=MATSHITADVD-RAM UJ892, FwRev=SB01, SerialNo=HG97  693542
 Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }
 RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0
 BuffType=unknown, BuffSize=unknown, MaxMultSect=0
 (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4 
 DMA modes:  sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 
 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 
 AdvancedPM=no
 Drive conforms to: Unspecified:  ATA/ATAPI-3,4,5,6,7

 * signifies the current active mode

Offline

Board footer

Powered by FluxBB