Re: [Qemu-devel] Audio cd's in guest OS

2005-11-07 Thread Jens Axboe
On Sat, Nov 05 2005, Oliver Gerlich wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Lars Roland schrieb:
  On 11/4/05, Mike Swanson [EMAIL PROTECTED] wrote:
  
 I've found on systems where traditional rippers don't work (eg,
 cdparanoia), CDFS has a greater chance of ripping the CDs (by default
 into WAV, but you can enable an option to rip it in the pure CDDA
 format if you want).
  
  
  Thanks - I should have known that someone had made a file system for
  this. However I still think it would be great to be able to pass the
  actual /dev/cdrom on to the guest OS, but I must admit that I have not
  grasped the complexity yet on doing this, so I am going to do some
  Qemu code reading before continuing - I am not even sure if it can be
  done in VMWare although I  seam to remember that Windows as a host OS
  running VMWare allows the guest access to a audio cdrom.
  
 
 Not sure how VMware does that; but actually I didn't even succeed
 accessing /dev/cdrom on the host when an audio cd is inserted:
 
 dd if=/dev/hdc of=/dev/null bs=2352 count=1
 dd: reading `/dev/hdc': Input/output error
 0+0 records in
 0+0 records out
 0 bytes transferred in 0.077570 seconds (0 bytes/sec)
 
 I used a blocksize of 2352 because I've read that's the size for audio
 cds... It didn't work with bs=1 either.

While the block size you gave is correct for cdda frames, you cannot
read them this way. The commands you use for reading data from a data
track varies, and the CDROM driver will always use the READ_10 command
for io originating from the file system layer. You would also need to
put some effort into the page cache to allow non-power-of-2 block sizes
for this to work. So it's not trivial :-)

For reading audio tracks, you can use either some pass through command
mechanism like CDROM_SEND_PACKET or SG_IO. Or the CDROMREADAUDIO ioctl,
which is the easiest to use since it doesn't require an understanding of
the command set.

-- 
Jens Axboe



___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] Audio cd's in guest OS

2005-11-07 Thread Jens Axboe
On Sat, Nov 05 2005, Fabrice Bellard wrote:
 Lars Roland wrote:
 On 11/4/05, Mike Swanson [EMAIL PROTECTED] wrote:
 
 I've found on systems where traditional rippers don't work (eg,
 cdparanoia), CDFS has a greater chance of ripping the CDs (by default
 into WAV, but you can enable an option to rip it in the pure CDDA
 format if you want).
 
 
 Thanks - I should have known that someone had made a file system for
 this. However I still think it would be great to be able to pass the
 actual /dev/cdrom on to the guest OS, but I must admit that I have not
 grasped the complexity yet on doing this, so I am going to do some
 Qemu code reading before continuing - I am not even sure if it can be
 done in VMWare although I  seam to remember that Windows as a host OS
 running VMWare allows the guest access to a audio cdrom.
 
 QEMU does not currently support reading raw CD tracks, but it is 
 definitely possible to add it (along with play audio features and even 
 CD recording).

I actually implemented the commands needed for recording some months
ago, but never really wrapped it up and submitted it. If there's any
interesting in this, I'll dust it off when I have some spare time.

-- 
Jens Axboe



___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] Audio cd's in guest OS

2005-11-07 Thread Lars Roland
On 11/7/05, Jens Axboe [EMAIL PROTECTED] wrote:
 I actually implemented the commands needed for recording some months
 ago, but never really wrapped it up and submitted it. If there's any
 interesting in this, I'll dust it off when I have some spare time.

Well I am interested and will happily spend some time checking the code.



Regards.

Lars Roland


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] Audio cd's in guest OS

2005-11-05 Thread Oliver Gerlich
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lars Roland schrieb:
 On 11/4/05, Mike Swanson [EMAIL PROTECTED] wrote:
 
I've found on systems where traditional rippers don't work (eg,
cdparanoia), CDFS has a greater chance of ripping the CDs (by default
into WAV, but you can enable an option to rip it in the pure CDDA
format if you want).
 
 
 Thanks - I should have known that someone had made a file system for
 this. However I still think it would be great to be able to pass the
 actual /dev/cdrom on to the guest OS, but I must admit that I have not
 grasped the complexity yet on doing this, so I am going to do some
 Qemu code reading before continuing - I am not even sure if it can be
 done in VMWare although I  seam to remember that Windows as a host OS
 running VMWare allows the guest access to a audio cdrom.
 

Not sure how VMware does that; but actually I didn't even succeed
accessing /dev/cdrom on the host when an audio cd is inserted:

dd if=/dev/hdc of=/dev/null bs=2352 count=1
dd: reading `/dev/hdc': Input/output error
0+0 records in
0+0 records out
0 bytes transferred in 0.077570 seconds (0 bytes/sec)

I used a blocksize of 2352 because I've read that's the size for audio
cds... It didn't work with bs=1 either.

So maybe Qemu would have to access the cd drive on a lower level than
via /dev/cdrom?

Just my 2 cents,
Oliver Gerlich
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDbJjvTFOM6DcNJ6cRAvMxAKChRu5Hs2CMtRcKdygnbKwBl5GoigCeL7XM
XLYxM01N6If3A+9hCbF5wUQ=
=edig
-END PGP SIGNATURE-


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] Audio cd's in guest OS

2005-11-05 Thread Fabrice Bellard

Lars Roland wrote:

On 11/4/05, Mike Swanson [EMAIL PROTECTED] wrote:


I've found on systems where traditional rippers don't work (eg,
cdparanoia), CDFS has a greater chance of ripping the CDs (by default
into WAV, but you can enable an option to rip it in the pure CDDA
format if you want).



Thanks - I should have known that someone had made a file system for
this. However I still think it would be great to be able to pass the
actual /dev/cdrom on to the guest OS, but I must admit that I have not
grasped the complexity yet on doing this, so I am going to do some
Qemu code reading before continuing - I am not even sure if it can be
done in VMWare although I  seam to remember that Windows as a host OS
running VMWare allows the guest access to a audio cdrom.


QEMU does not currently support reading raw CD tracks, but it is 
definitely possible to add it (along with play audio features and even 
CD recording).


Note that there is already an emulation for reading raw CD tracks 
because it is needed to boot Darwin on CDROM, but it only works on the 
data tracks of the CDROM.


Fabrice.


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] Audio cd's in guest OS

2005-11-05 Thread Jim C. Brown
On Sat, Nov 05, 2005 at 12:35:12PM +0100, Oliver Gerlich wrote:
  Thanks - I should have known that someone had made a file system for
  this. However I still think it would be great to be able to pass the
  actual /dev/cdrom on to the guest OS, but I must admit that I have not
  grasped the complexity yet on doing this, so I am going to do some
  Qemu code reading before continuing - I am not even sure if it can be
  done in VMWare although I  seam to remember that Windows as a host OS
  running VMWare allows the guest access to a audio cdrom.
  
 

That is interesting. I wonder how they did it.

 Not sure how VMware does that; but actually I didn't even succeed
 accessing /dev/cdrom on the host when an audio cd is inserted:
 
 dd if=/dev/hdc of=/dev/null bs=2352 count=1
 dd: reading `/dev/hdc': Input/output error
 0+0 records in
 0+0 records out
 0 bytes transferred in 0.077570 seconds (0 bytes/sec)
 
 I used a blocksize of 2352 because I've read that's the size for audio
 cds... It didn't work with bs=1 either.
 

It is the sector size. But audio cds are stored in a different format than
digital cds (the ones that contain filesystems on them such as ISO9660).
It is even possible to have both formats on a single cd-rom (so it works to hold
music for an audio cd player as well as music videos that can be played on a
computer).

dd only supports accessing the digital side of things. I don't recall how hard
it is to access raw audio, but I wouldn't be suprised if one needed low level
controller commands (like it's needed to burn cd-r(w)s or dvd-r(w)s).

 So maybe Qemu would have to access the cd drive on a lower level than
 via /dev/cdrom?
 

Yes.

A quickeasy hack might be to have an -audio-cdrom option, that takes a 
directory
full of *.wav's and generates an emulated audio cd for the guest. (Might have
to make it a monitor option as well, to allow swapping of audio and digital
cdroms).

Then to use real audio cdroms from the host, just mount them via CDFS.

May not be worth the effort.

 Just my 2 cents,
 Oliver Gerlich

-- 
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] Audio cd's in guest OS

2005-11-04 Thread Mike Swanson
I've found on systems where traditional rippers don't work (eg,
cdparanoia), CDFS has a greater chance of ripping the CDs (by default
into WAV, but you can enable an option to rip it in the pure CDDA
format if you want). It requires patching the Linux source, so if you
aren't experienced with compiling your own kernel, then it might not
be the best option.

http://www.elis.rug.ac.be/~ronsse/cdfs/

If you get it to work, then you may use LAME, oggenc, FLAC, or
whatever to encode the audio tracks into your favorite format (mp3,
Ogg Vorbis, and FLAC in my examples).

On 11/4/05, Lars Roland [EMAIL PROTECTED] wrote:
 Hi all

 Is it somehow possible to pass a audio cd from a host running Linux to
 the guest OS ? -

 I am basiclly trying to rip a cd using itunes inside my guest OS
 (Windows XP) but as audio cd's does not has a traditional filesystem
 on them you cannot mount them in Linux (host OS). The: -cdrom
 predicate in Qemu 0.7.2 only works if the block device contains a
 mounted filesystem so I am unable to see how I can pass on an audio
 cd.


 Regards.

 Lars Roland


 ___
 Qemu-devel mailing list
 Qemu-devel@nongnu.org
 http://lists.nongnu.org/mailman/listinfo/qemu-devel



--
Mike


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel