plughw is probably better at sharing a device than hw would be.  And
plughw probably allows for some conversion of content.  Otherwise they
are functionally the same IMO.  Not that I'd know since I haven't
really delved that deep into things.  You might check lsof or fuser to
see if something is using the sound device and keeping you from using
hw instead of plughw.  Or just use plughw since it works.

If it's a content conversion issue, you might try to create a
converted version of the media and see if that fixes the issue when
using hw.  Sox can do a lot of conversions.  Ffmpeg as well.  Many
means to an end.  Not that it fixes the issue, but it can help to
better understand the issue.

You might also try renaming your .asoundrc to see if that frees up hw
to be used in the way that you are trying to use it.  If that works,
then there's something in your .asoundrc that's getting in the way.

- James


On 6/21/11, Pierre Habraken <pierre.habra...@free.fr> wrote:
> On 06/20/2011 10:06 PM, alsa-user-requ...@lists.sourceforge.net wrote:
>>
>> Date: Mon, 20 Jun 2011 22:34:46 +0400
>> From: Vladimir Mosgalin<mosga...@vm10124.spb.edu>
>> Subject: Re: [Alsa-user] plughw versus hw
>> To: alsa-user@lists.sourceforge.net
>> Message-ID:<20110620183446.ga14...@vm10124.spb.edu>
>> Content-Type: text/plain; charset=us-ascii
>>
>> Hi Pierre Habraken!
>>
>>   On 2011.06.20 at 19:32:28 +0200, Pierre Habraken wrote next:
>>
>>> I can imagine that this is a FAQ, but I could not find a clear answer :
>>> which precise difference(s) distinguish(es) plughw and hw from each other
>>> ?
>>> Does plughw apply sound processing that hw does not ?
>>
>> plughw *might* apply simple sound processing if needed, mostly channels
>> conversion and rate conversion if required. It doesn't have to apply
>> processing.
>> hw doesn't support such processing only works when operating strictly in
>> mode that audio card support.
>>
>> If you have device that supports only 2 channel, 16 bit 48000 mode then
>> "hw" device won't be able to playback 2/16/44100 stream, or mono stream
>> for example; you'll get an error when you try. But plughw will accept
>> such streams and do the conversion. However, if you use plughw and
>> output 2/16/48000 stream then no conversion is needed and most likely
>> plughw won't be doing any processing.
>>
>> Note that using both hw and plughw can lead to specific problems, so
>> it's best to use "default" device unless you have very specific
>> requirements.
>
> Hello Vladimir,
>
> Thank you for your reply.
>
> I just bought an Asus Xonar DX sound card, for sending 24bits/96KHz
> stereo flac files to an external DAC.
> I am using Alsa 1.0.21 on a PC running Ubuntu 10.04 with Linux kernel
> 2.6.32-32.
> Running aplay, I can't use hw for reading 24/96 files:
>
> $ aplay -D hw:0,1 Prelude.wav
> Playing WAVE 'Prelude.wav' : Signed 24 bit Little Endian in 3bytes, Rate
> 96000 Hz, Stereo
> aplay: set_params:990: Sample format non available
> Available formats:
> - S16_LE
> - S32_LE
> $
>
> Adding the switch -f S32_LE does not help:
>
> $ aplay -D hw:0,1 -f S32_LE Prelude.wav
> Warning: format is changed to S24_3LE
> Playing WAVE 'Prelude.wav' : Signed 24 bit Little Endian in 3bytes, Rate
> 96000 Hz, Stereo
> aplay: set_params:990: Sample format non available
> Available formats:
> - S16_LE
> - S32_LE
> $
>
> If I use plughw instead of hw, it works fine:
>
> $ aplay -D plughw:0,1 Prelude.wav
> Playing WAVE 'Prelude.wav' : Signed 24 bit Little Endian in 3bytes, Rate
> 96000 Hz, Stereo
> ^CAborted by signal Interrupt...
> $
>
> Does it mean that the 24bits stream has to be converted to 16bits before
> being sent to the device and then to the DAC ?
>
> Pierre
>
>
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> Alsa-user mailing list
> Alsa-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-user
>

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to