Re: plughw versus hw

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/20/2011 10:06 PM, alsa-user-request@xxxxxxxxxxxxxxxxxxxxx wrote:
>
> Date: Mon, 20 Jun 2011 22:34:46 +0400
> From: Vladimir Mosgalin<mosgalin@xxxxxxxxxxxxxxx>
> Subject: Re:  plughw versus hw
> To: alsa-user@xxxxxxxxxxxxxxxxxxxxx
> Message-ID:<20110620183446.GA14919@xxxxxxxxxxxxxxx>
> 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@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user


[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux