Bug 380064 - [MATSHITA BD-MLT UJ240AS] Estimated writing speed: 4046 KB/s (0,9x)*?
Summary: [MATSHITA BD-MLT UJ240AS] Estimated writing speed: 4046 KB/s (0,9x)*?
Status: RESOLVED FIXED
Alias: None
Product: k3b
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: k3b developers
URL:
Keywords:
: 384566 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-05-22 00:38 UTC by Cristian Aravena Romero
Modified: 2017-11-12 23:01 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
k3b_git85105cd (88.95 KB, image/png)
2017-05-22 00:38 UTC, Cristian Aravena Romero
Details
k3b_version-git85105cd (12.83 KB, image/png)
2017-05-22 00:39 UTC, Cristian Aravena Romero
Details
k3b_git85105cd.log (843.74 KB, text/plain)
2017-05-22 01:28 UTC, Cristian Aravena Romero
Details
k3b.log (228.67 KB, text/plain)
2017-06-06 16:44 UTC, Cristian Aravena Romero
Details
k3b burn (90.44 KB, image/png)
2017-06-10 03:20 UTC, Cristian Aravena Romero
Details
k3b_giteb55cd2.log (1.03 MB, text/plain)
2017-06-12 01:53 UTC, Cristian Aravena Romero
Details
k3b_giteb55cd2.png (135.19 KB, image/png)
2017-06-12 01:54 UTC, Cristian Aravena Romero
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cristian Aravena Romero 2017-05-22 00:38:51 UTC
Created attachment 105664 [details]
k3b_git85105cd

Hi,

I am recording to BD. And I doubt the speeds. Is the estimate "(0.9x)" right?

o Writing speed: 5678 KB/s (4,1x)
o Estimated writing speed: 4046 KB/s (0,9x)*

Thanks,
--
Cristian
Comment 1 Cristian Aravena Romero 2017-05-22 00:39:24 UTC
Created attachment 105665 [details]
k3b_version-git85105cd
Comment 2 Cristian Aravena Romero 2017-05-22 01:28:01 UTC
Created attachment 105667 [details]
k3b_git85105cd.log
Comment 3 Cristian Aravena Romero 2017-05-22 22:10:56 UTC
https://bugs.launchpad.net/k3b/+bug/1692730
Comment 4 Leslie Zhai 2017-06-06 03:16:53 UTC
Hi Cristian,

But what about the speed for CDEmu? could you provide another log when using CDEmu for recording compare? thanks!

Regards,
Leslie Zhai
Comment 5 Cristian Aravena Romero 2017-06-06 16:44:48 UTC
Created attachment 105946 [details]
k3b.log

Hello Leslie Zhai,

Is this a good log?

Thanks,
--
Cristian
Comment 6 Leslie Zhai 2017-06-07 01:58:28 UTC
Hi Cristian,

Thanks for your test!

> Is this a good log?

very good! I will check out why Writing speed (5678 KB/s) is different with Estimated writing speed (3596 KB/s)

Regards,
Leslie Zhai
Comment 7 Leslie Zhai 2017-06-08 04:09:21 UTC
Git commit d4b6d1f25717e777c040e64f9183532d2184954c by Leslie Zhai.
Committed on 08/06/2017 at 04:07.
Pushed by lesliezhai into branch 'master'.

Why growisofs Current Write Speed is different from Estimated writing speed?

M  +5    -2    libk3b/projects/k3bgrowisofshandler.cpp
M  +7    -3    libk3b/projects/k3bgrowisofswriter.cpp
A  +3    -0    tests/test-blank-cdr.sh
A  +3    -0    tests/test-blank-dvd+r.sh

https://commits.kde.org/k3b/d4b6d1f25717e777c040e64f9183532d2184954c
Comment 8 Leslie Zhai 2017-06-08 04:25:52 UTC
Hi Thomas,

Please give me some hint, thanks a lot!

> Why growisofs Current Write Speed is different from Estimated writing speed?
> 
> M  +5    -2    libk3b/projects/k3bgrowisofshandler.cpp
> M  +7    -3    libk3b/projects/k3bgrowisofswriter.cpp
> A  +3    -0    tests/test-blank-cdr.sh
> A  +3    -0    tests/test-blank-dvd+r.sh
> 
> https://commits.kde.org/k3b/d4b6d1f25717e777c040e64f9183532d2184954c

growisofs Current Write Speed -> DEBUG: void K3b::GrowisofsHandler::handleLine(const QString&) 25484 18.4 1385

Estimated writing speed -> DEBUG: void K3b::GrowisofsWriter::slotReceivedStderr(const QString&) 104013 75.1 1385

Regards,
Leslie Zhai
Comment 9 Thomas Schmitt 2017-06-08 07:28:40 UTC
Hi,

i see confusions about DVD and BD speed units and about SI compliant
kB = 1000 bytes versus programmer's KiB = 1024 bytes.


"Writing speed: 5678 KB/s (4,1x)" obviously implies the speed factor
for DVD of 1385 kB/s, rather than the factor of 4495 kB/s of BD.
As BD speed 5678 kB/s would be about 1.3x.
It is not clear which of both numbers is the computed one.
Combined with the growisofs message
  /dev/sr0: "Current Write Speed" is 4.1x4390KBps.
i'd expect that 5678 is wrong and should be about 18500.
(4390 KiB/s = 4495.36 kB/s.)

"Estimated writing speed: 4046 KB/s (0,9x)" on the other hand is
converted correctly.

One may ask the drive and inserted medium for its announced speed 
values by this shell command:

  dvd+rw-mediainfo /dev/sr0

A PHILIP/R04 BD-R medium in ASUS BW-16D1HT drive reports
  Write Speed #0:        8.0x4495=35968KB/s
  Write Speed #1:        6.0x4495=26976KB/s
  Write Speed #2:        4.0x4495=17984KB/s

The value "4.1x" reported by K3B could be really "4.0x" if K3B
misunderstands 17984 kB/s as 17984 KiB/s (17984*1.024/4495 = 4.0969).

One should check K3B for such 1024 = 1000 mistakes. SCSI/MMC always
reports and expects SI compliant kB/s. I.e. "k" = 1000, not 1024.
This applies to the output of dvd+rw-mediainfo and to the reply of
SCSI command GET PERFORMANCE.


If i shall guess, then "Writing speed" is what K3B asks growisofs
to use by option "-speed=4", and "Estimated writing speed" would be
the real throughput measured between K3B and growisofs.

0.9x effective speed at 4x nominal speed is not very good. Only for
a short time (around 43 %) throughput accelerated to 1.6x for a short
time.
With Defect Management enabled 4x nominal should be about 1.5x to 2x
effective throughput.

As for CDEmu, it obviously does not feel restricted to the speed wish
18.4x DVD (= 6x BD) issued by K3 to growisofs, but rather burns as fast
as the computer can copy bytes.


Have a nice day :)

Thomas
Comment 10 Leslie Zhai 2017-06-08 08:55:08 UTC
Git commit cb723c528e8bf4ac3a60a244690439230d1e2346 by Leslie Zhai.
Committed on 08/06/2017 at 08:53.
Pushed by lesliezhai into branch 'master'.

Add MediaType for GrowisofsHandler

So it is able to calculate Current Write Speed with DVD or BD speed
factor depends on MediaType.

M  +10   -10   libk3b/projects/k3bgrowisofshandler.cpp
M  +5    -0    libk3b/projects/k3bgrowisofshandler.h
M  +1    -3    libk3b/projects/k3bgrowisofswriter.cpp

https://commits.kde.org/k3b/cb723c528e8bf4ac3a60a244690439230d1e2346
Comment 11 Leslie Zhai 2017-06-08 09:07:39 UTC
Hi Thomas,

Thanks for your help!

> "Writing speed: 5678 KB/s (4,1x)" obviously implies the speed factor
> for DVD of 1385 kB/s, rather than the factor of 4495 kB/s of BD.
> As BD speed 5678 kB/s would be about 1.3x.
> It is not clear which of both numbers is the computed one.
> Combined with the growisofs message
>   /dev/sr0: "Current Write Speed" is 4.1x4390KBps.
> i'd expect that 5678 is wrong and should be about 18500.
> (4390 KiB/s = 4495.36 kB/s.)
Yes, original GrowisofsHandler only considered about DVD, so I simply added setMediaType for it to consider about Device::SPEED_FACTOR_BD too https://github.com/KDE/k3b/blob/master/libk3b/projects/k3bgrowisofshandler.cpp#L177


> 
> "Estimated writing speed: 4046 KB/s (0,9x)" on the other hand is
> converted correctly.
> 
> One may ask the drive and inserted medium for its announced speed 
> values by this shell command:
> 
>   dvd+rw-mediainfo /dev/sr0
> 
> A PHILIP/R04 BD-R medium in ASUS BW-16D1HT drive reports
>   Write Speed #0:        8.0x4495=35968KB/s
>   Write Speed #1:        6.0x4495=26976KB/s
>   Write Speed #2:        4.0x4495=17984KB/s
> 
> The value "4.1x" reported by K3B could be really "4.0x" if K3B
> misunderstands 17984 kB/s as 17984 KiB/s (17984*1.024/4495 = 4.0969).
> 
> One should check K3B for such 1024 = 1000 mistakes. SCSI/MMC always
> reports and expects SI compliant kB/s. I.e. "k" = 1000, not 1024.
> This applies to the output of dvd+rw-mediainfo and to the reply of
> SCSI command GET PERFORMANCE.
> 
> 
> If i shall guess, then "Writing speed" is what K3B asks growisofs
> to use by option "-speed=4", and "Estimated writing speed" would be
Yes! in the K3b::GrowisofsWriter::prepareProcess() https://github.com/KDE/k3b/blob/master/libk3b/projects/k3bgrowisofswriter.cpp#L291


Regards,
Leslie Zhai
Comment 12 Thomas Schmitt 2017-06-08 10:50:08 UTC
Hi,

the strange speed value 4.1x seems to stem from a 1024/1000 confusion
in growisofs.
growisofs_mmc.cpp has:

  #define BD_1X   4390    // 4495.5 * 1000 / 1024
  ...
        _1x = BD_1X;
  ...
      page2A = pull_page2A (cmd);
  ...
    hlen = 8 + (page2A[6]<<8|page2A[7]);

    unsigned char * const p = page2A + hlen;
  ...
    {   velocity = p[28]<<8|p[29];
  ...
        fprintf (stderr,"%s: \"Current Write Speed\" is %.1fx%dKBps.\n",
                        ioctl_device,velocity/(double)_1x,_1x);

Page 0x2A is the obsolete "CD/DVD Capabilities and Mechanical Status Page"
last mentioned in MMC-3. One can ask a drive to fill it out and return it.
Its bytes 28 and 29 then contain the "Current Write Speed Selected".
To my knowledge, all drives return this value as kB/sec. So growisofs
should divide it by 4495, not by 4390.

Not K3B's fault. growisofs needs a maintainer.


Have a nice day :)

Thomas
Comment 13 Leslie Zhai 2017-06-08 14:51:45 UTC
Hi Cristian,

> Not K3B's fault. growisofs needs a maintainer.

Why not cdrskin as Writing app?

Regards,
Leslie Zhai
Comment 14 Cristian Aravena Romero 2017-06-10 03:20:14 UTC
Created attachment 106021 [details]
k3b burn
Comment 15 Leslie Zhai 2017-06-12 01:37:32 UTC
Hi Cristian,

> k3b burn

Have you tried cdrskin as Writing app? and please attach the log and screenshot, thanks!

Regards,
Leslie Zhai
Comment 16 Cristian Aravena Romero 2017-06-12 01:53:34 UTC
Created attachment 106051 [details]
k3b_giteb55cd2.log
Comment 17 Cristian Aravena Romero 2017-06-12 01:54:13 UTC
Created attachment 106052 [details]
k3b_giteb55cd2.png
Comment 19 Leslie Zhai 2017-11-12 03:30:27 UTC
*** Bug 384566 has been marked as a duplicate of this bug. ***