qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Audio cd's in guest OS
@ 2005-11-04 12:47 Lars Roland
  2005-11-04 17:40 ` Mike Swanson
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Roland @ 2005-11-04 12:47 UTC (permalink / raw)
  To: qemu-devel

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] Audio cd's in guest OS
  2005-11-04 12:47 [Qemu-devel] Audio cd's in guest OS Lars Roland
@ 2005-11-04 17:40 ` Mike Swanson
  2005-11-05 10:08   ` Lars Roland
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Swanson @ 2005-11-04 17:40 UTC (permalink / raw)
  To: qemu-devel

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 <lroland@gmail.com> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] Audio cd's in guest OS
  2005-11-04 17:40 ` Mike Swanson
@ 2005-11-05 10:08   ` Lars Roland
  2005-11-05 11:35     ` Oliver Gerlich
  2005-11-05 11:55     ` Fabrice Bellard
  0 siblings, 2 replies; 9+ messages in thread
From: Lars Roland @ 2005-11-05 10:08 UTC (permalink / raw)
  To: qemu-devel

On 11/4/05, Mike Swanson <mikeonthecomputer@gmail.com> 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.



Regards

Lars Roland

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] Audio cd's in guest OS
  2005-11-05 10:08   ` Lars Roland
@ 2005-11-05 11:35     ` Oliver Gerlich
  2005-11-05 14:55       ` Jim C. Brown
  2005-11-07  8:15       ` Jens Axboe
  2005-11-05 11:55     ` Fabrice Bellard
  1 sibling, 2 replies; 9+ messages in thread
From: Oliver Gerlich @ 2005-11-05 11:35 UTC (permalink / raw)
  To: qemu-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lars Roland schrieb:
> On 11/4/05, Mike Swanson <mikeonthecomputer@gmail.com> 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-----

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] Audio cd's in guest OS
  2005-11-05 10:08   ` Lars Roland
  2005-11-05 11:35     ` Oliver Gerlich
@ 2005-11-05 11:55     ` Fabrice Bellard
  2005-11-07  8:16       ` Jens Axboe
  1 sibling, 1 reply; 9+ messages in thread
From: Fabrice Bellard @ 2005-11-05 11:55 UTC (permalink / raw)
  To: qemu-devel

Lars Roland wrote:
> On 11/4/05, Mike Swanson <mikeonthecomputer@gmail.com> 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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] Audio cd's in guest OS
  2005-11-05 11:35     ` Oliver Gerlich
@ 2005-11-05 14:55       ` Jim C. Brown
  2005-11-07  8:15       ` Jens Axboe
  1 sibling, 0 replies; 9+ messages in thread
From: Jim C. Brown @ 2005-11-05 14:55 UTC (permalink / raw)
  To: Oliver Gerlich; +Cc: qemu-devel

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 quick&easy 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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] Audio cd's in guest OS
  2005-11-05 11:35     ` Oliver Gerlich
  2005-11-05 14:55       ` Jim C. Brown
@ 2005-11-07  8:15       ` Jens Axboe
  1 sibling, 0 replies; 9+ messages in thread
From: Jens Axboe @ 2005-11-07  8:15 UTC (permalink / raw)
  To: qemu-devel

On Sat, Nov 05 2005, Oliver Gerlich wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Lars Roland schrieb:
> > On 11/4/05, Mike Swanson <mikeonthecomputer@gmail.com> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] Audio cd's in guest OS
  2005-11-05 11:55     ` Fabrice Bellard
@ 2005-11-07  8:16       ` Jens Axboe
  2005-11-07 10:57         ` Lars Roland
  0 siblings, 1 reply; 9+ messages in thread
From: Jens Axboe @ 2005-11-07  8:16 UTC (permalink / raw)
  To: qemu-devel

On Sat, Nov 05 2005, Fabrice Bellard wrote:
> Lars Roland wrote:
> >On 11/4/05, Mike Swanson <mikeonthecomputer@gmail.com> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] Audio cd's in guest OS
  2005-11-07  8:16       ` Jens Axboe
@ 2005-11-07 10:57         ` Lars Roland
  0 siblings, 0 replies; 9+ messages in thread
From: Lars Roland @ 2005-11-07 10:57 UTC (permalink / raw)
  To: qemu-devel

On 11/7/05, Jens Axboe <qemu@kernel.dk> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-11-07 10:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-04 12:47 [Qemu-devel] Audio cd's in guest OS Lars Roland
2005-11-04 17:40 ` Mike Swanson
2005-11-05 10:08   ` Lars Roland
2005-11-05 11:35     ` Oliver Gerlich
2005-11-05 14:55       ` Jim C. Brown
2005-11-07  8:15       ` Jens Axboe
2005-11-05 11:55     ` Fabrice Bellard
2005-11-07  8:16       ` Jens Axboe
2005-11-07 10:57         ` Lars Roland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).