New FAMILUG

The PyMiers

Sunday 4 August 2013

AudioCD, cdrom, iso 9660

1. AudioCD
Mua được quyển sách học ngoại ngữ kèm được 2 cái audio CD mang về. Vừa giở sách định học một tí thì phát hiện ra là phải nghe. Nhét cái CD phần 1 vào, chạy VLC mở thì nó treo cứng cả VLC, CPU 200% @@

Thế là kill VLC để mount bằng tay xem:

 mount -t iso9660 -o ro /dev/sr0 /mnt/cd

Đập ngay vào mặt cái lỗi:

mount: wrong fs type, bad option, bad superblock on /dev/sr0,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
Thế là công việc chuyển từ học ngoại ngữ giờ đã thành debug và tìm hiểu về CD ~.~

The reason is you cannot mount Audio CD's. Not now, not ever.
ISO9660 is a format, and Audio CD's have to comply with the Redbook specification; not with ISO9660 format specs.
https://bbs.archlinux.org/viewtopic.php?pid=1023931#p1023931



Nghĩa là
  • bạn không thể mount 1 cái Audio CD được,  (thứ bạn thấy khi dùng Windows browse CD nó chỉ là một kiểu giả lập) 
  • Audio CD phải theo chuẩn Redbook link này gồm rất nhiều thông tin về CD, audio, cho bạn nào thích tìm hiểu...

You can't copy a track from an AudioCD, you need to rip it, right? If there was a filesystem, you could just copy it.
You can mount a data CD / DVD, but neither AudioCDs not blank discs have a filesystem.

  • Bạn phải rip AudioCD chứ không thể copy track trực tiếp.
  • Bạn mount được các CD dữ liệu vì nó có 1 filesystem, AudioCD và đĩa trắng không có filesystem
https://bbs.archlinux.org/viewtopic.php?pid=1023944#p1023944

Và sau đó tớ khám phá ra một chương trình có cái tên hay nhất tớ từng thấy:
abcde

[root@archhvn hvn]# pacman -Ss abcde
community/abcde 2.5.4-5 [installed]
    A frontend command-line utility that grabs tracks off a CD, encodes them to ogg or mp3 format, and tags them, all in one go.

nhưng sau đó thử rip cái AudioCD bằng abcde thì vẫn không thành công, có lẽ 2 cái CD này hàng lởm rồi =.=

[root@archhvn hvn]# dmesg | tail && abcde -o vorbis -d /dev/sr0
[ 4654.167770] sr 1:0:0:0: [sr0] 
[ 4654.167778] Result: hostbyte=0x00 driverbyte=0x08
[ 4654.167783] sr 1:0:0:0: [sr0] 
[ 4654.167786] Sense Key : 0x5 [current]
[ 4654.167792] sr 1:0:0:0: [sr0] 
[ 4654.167795] ASC=0x64 ASCQ=0x0
[ 4654.167800] sr 1:0:0:0: [sr0] CDB:
[ 4654.167802] cdb[0]=0x28: 28 00 00 00 00 10 00 00 01 00
[ 4654.167816] end_request: I/O error, dev sr0, sector 64
[ 4654.167843] isofs_fill_super: bread failed, dev=sr0, iso_blknum=16, block=16
cd-discid: /dev/sr0: CDROMREADTOCHDR: Input/output error
[ERROR] abcde: CD could not be read. Perhaps there's no CD in the drive?

học chay tiếp vậy ...

2. CDROM
là viết tắt của cụm từ "Compact Disc Read-only Memory"
chi tiết của CDROM được mô tả trong Yellow book , có thể thấy trong bộ rainbow books
Máy tính có thể đọc CDROM vì CDROM có filesystem ISO 9660

3. ISO 9660
Theo wiki: 
ISO 9660 (also known as ECMA-119), also referred to as CDFS (Compact Disc File System) by some hardware and software providers, is a file system standard published by the International Organization for Standardization (ISO) for optical disc media. It aims at supporting different computer operating systems such as Windows, classic Mac OS, and Unix-like systems, so that data may be exchanged.  

ISO 9660 còn được gọi là CDFS, file system cho CD. Đó là lý do khi mount CDROM trên Linux, bạn phải khai báo option: -t iso9660

No comments:

Post a Comment