Re: aplay fails on amd64 laptop

2017-12-24 Thread Pierre Frenkiel

On Sun, 24 Dec 2017, Georgi Naplatanov wrote:


if you are using PulseAudio just remove any exiting content of
~/.asoundrc and put this:


  hi Georgi,
  thank you for your suggestion, but I can't launch pulseaudio:

   Failed to load module "module-alsa-sink"

   and as I have a working config with plughw, I don't want to spend
   too much time with pulsequdio

best regards,
--
Pierre Frenkiel



Re: aplay fails on amd64 laptop

2017-12-24 Thread Georgi Naplatanov
On 12/21/2017 09:04 PM, Pierre Frenkiel wrote:
> hi,
> the sound works perfectly with vlc or audacity, but I can't make aplay
> to work.
> the "aplay -l" output is:
>     List of PLAYBACK Hardware Devices 
>    card 0: HDMI [HDA ATI HDMI], device 3: Generic Digital [Generic Digital]
>    Subdevices: 1/1
>    Subdevice #0: subdevice #0
>    card 1: Generic [HD-Audio Generic], device 0: ALC233 Analog [ALC233
> Analog]
>    Subdevices: 1/1
>    Subdevice #0: subdevice #0
> 
> and both audacity and vlc actually use the  HD-Audio output.
> 
> After configuring ~/.aoundrc like this:
> 
> pcm.!default {
>     type hw
>     card 1
> }
> 
> ctl.!default {
>     type hw
>     card 1
> }
> 
> running "aplay file.wav" gives:
>    aplay: set_params:1081: Sample format non available
>    Available formats:
>    - S16_LE
>    - S32_LE
> 
> I get the same thing with all .wav files I try.
> 
> This problem is specific to my amd64 laptop, as I don't have it on my
> desktop,
> running the same OS version (Stretch), and with the same files.
> 
> Looking at Google didn't gave me any useful information.
> Has anybody an idea?
> 

Hi Pierre,

if you are using PulseAudio just remove any exiting content of
~/.asoundrc and put this:

pcm.pulse {
type pulse
}

ctl.pulse {
type pulse
}

pcm.!default {
type pulse
}

ctl.!default {
type pulse
}

This redirects ALSA to PulseAudio - see
https://wiki.archlinux.org/index.php/PulseAudio/Examples

then just run:

$ aplay test.wav

OR

$ aplay --device=pcm:pulse test.wav

and you should hear the wave file.

BUT if you are not using PulseAudio then aplay parameters should look
like this:

$ aplay --device=hw:X,Y test.wav

Where X is your sound device number and Y is sub-device number.

For example output of

$ aplay -l

is this on my computer:

 List of PLAYBACK Hardware Devices 
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC887-VD Analog [ALC887-VD Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 1: ALC887-VD Digital [ALC887-VD Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Headset [Logitech USB Headset], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

and

$ aplay --device=hw:2,0 test.wav

works just fine.

hw:2,0 is my USB headset on my computer.

Kind regards
Georgi



Re: aplay fails on amd64 laptop

2017-12-24 Thread Pierre Frenkiel

On Sat, 23 Dec 2017, deloptes wrote:


but I told you also about plughw - no?


  yes, but I told you before that I found it myself by accident, when
  trying on an other wav file.


no idea why you are so resistant to getting the knowledge yourself - the man
page is even not that long and you should start reading yourself.


  I read it, but it seems that you didn't unserstand that it gives just an
  example, and doesn't provide any way to find the right parameters
  for an other file.

  None of the parameters I tried worked, until I used the -Dplughw
  syntax.

  Anyway, I think useless to continue talking with somebody who
  can say that "teaching the hungry how to make food" is equivalent to
  "tell them to find themselves"

  I hope that the Education Minister will not read that, otherwise he
  could think that it is useless to pay thousands of teachers, as
  it is enough to tell the students "find yourself"

best regards,
--
Pierre Frenkiel



Re: aplay fails on amd64 laptop

2017-12-23 Thread deloptes
Pierre Frenkiel wrote:

> do you think that "find yourself" matches this definition?

It might surprise you but yes :)

If you have read man aplay to the end you would have found following

aplay -c 1 -t raw -r 22050 -f mu_law foobar
  will play the raw file "foobar" as a 22050-Hz, mono, 8-bit,
Mu-Law .au file.

Adjusting it a bit to my setup (-Ddefault) produces following with sound

$ aplay -Ddefault -c 1 -t raw -r 22050 -f
mu_law /usr/share/sounds/alsa/Side_Left.wav
Warning: format is changed to S16_LE
Playing WAVE '/usr/share/sounds/alsa/Side_Left.wav' : Signed 16 bit Little
Endian, Rate 48000 Hz, Mono

I use default because pulseaudio is hooked at the alsa device

regards



Re: aplay fails on amd64 laptop

2017-12-23 Thread Pierre Frenkiel

On Sat, 23 Dec 2017, deloptes wrote:


you know there are two types of help: feed the hungry or teach them make
food themselves - I prefer the 2nd one - you the 1st one - no reason to get
personal


  from wikipedia:
 A teacher is a person who helps others to acquire knowledge, competences
 or values.

  do you think that "find yourself" matches this definition?

  FYI, I tried all -f options, and no one worked.



Re: aplay fails on amd64 laptop

2017-12-23 Thread deloptes
Pierre Frenkiel wrote:

> It's a strange way to help people to say them "find yourself"
> Generally, when people ask for help, it's that there are, like me,
> too stupid to find themselves.
> I suggest to avoid useless posts

but I told you also about plughw - no?

a brief look into man aplay tells you the -f option could be used example -f
cd (I think it was 44100Hz)

no idea why you are so resistant to getting the knowledge yourself - the man
page is even not that long and you should start reading yourself.

you know there are two types of help: feed the hungry or teach them make
food themselves - I prefer the 2nd one - you the 1st one - no reason to get
personal

regards



Re: aplay fails on amd64 laptop

2017-12-23 Thread Pierre Frenkiel

On Sat, 23 Dec 2017, deloptes wrote:


Pierre Frenkiel wrote:


aplay -D hw:1,0

this also gives
aplay: set_params:1299: Sample format non available


you could also set the sample format ;-) - I was hoping you try to find out
the way yourself.


  1/ I don't see why I should loose time with hw:1,0, when the
 plughw syntax works perfectly

  2/ It's a strange way to help people to say them "find yourself"
 Generally, when people ask for help, it's that there are, like me,
 too stupid to find themselves.
 I suggest to avoid useless posts

best regards,
--
Pierre Frenkiel



Re: aplay fails on amd64 laptop

2017-12-23 Thread deloptes
Pierre Frenkiel wrote:

>> aplay -D hw:1,0
> this also gives
> aplay: set_params:1299: Sample format non available

you could also set the sample format ;-) - I was hoping you try to find out
the way yourself.

regards



Re: aplay fails on amd64 laptop

2017-12-23 Thread Pierre Frenkiel

On Sat, 23 Dec 2017, deloptes wrote:


man aplay

  the useful information is given by "aplay -L", which lists
  19 devices, among which 2 are working:
sysdefault:CARD=Generic
plughw:CARD=Generic,DEV=0


aplay -D hw:1,0

  this also gives
 aplay: set_params:1299: Sample format non available


or -Dplughw:1,0

  this works, and also  -Dplughw:Generic

  Actually, I found the plughw syntax by accident, when trying once
  aplay file.wav, which gave:

Playing WAVE 'file.wav' : Signed 16 bit Little Endian, Rate 11025 Hz, Stereo
Warning: rate is not accurate (requested = 11025Hz, got = 44100Hz)
 please, try the plug plugin (-Dplug:default)

I appreciate this  comment in the alsa doc:
It would be even nicer if the --help and man output of aplay would
define what NAME of "--device=NAME" should be set to. Then people
would not have to search the Internet to find out.

best regards,
--
Pierre Frenkiel



Re: aplay fails on amd64 laptop

2017-12-22 Thread deloptes
Pierre Frenkiel wrote:

> On Fri, 22 Dec 2017, Tom Furie wrote:
> 
>> Are the 1:0 and 1,0 above typos in the mail? If not, they should be 1.0.
> 
>no: look at : http://www.alsa-project.org/main/index.php/Asoundrc
>I checked with aplay -D hw:1.0 brahms.wav.
>this gives :
>   Invalid value for card
> 
> best regards,

I think it should be hw:1,0 or plughw:1,0

but are you sure it you have unmuted your channels (alsamixer)

also try by disabling HDMI in bios

regards



Re: aplay fails on amd64 laptop

2017-12-22 Thread deloptes
Pierre Frenkiel wrote:

> thank you for your reply, but can you be a little more specific:
> what do you mean exactly by "use hw:1.0" ?
> where? in a config file, in the aplay command line ...?

man aplay

aplay -D hw:1,0

or -Dplughw:1,0

look also at alsa docs to understand how sound system in linux works. IMO
best is to configure the modules/drivers to have your analog as first card.
or disable HDMI (it was workaround in such cases)

regards



Re: aplay fails on amd64 laptop

2017-12-22 Thread Pierre Frenkiel

On Fri, 22 Dec 2017, Tom Furie wrote:


Are the 1:0 and 1,0 above typos in the mail? If not, they should be 1.0.


  no: look at : http://www.alsa-project.org/main/index.php/Asoundrc
  I checked with aplay -D hw:1.0 brahms.wav.
  this gives :
 Invalid value for card

best regards,
--
Pierre Frenkiel



Re: aplay fails on amd64 laptop

2017-12-22 Thread Tom Furie
On Fri, Dec 22, 2017 at 06:03:22PM +0100, Pierre Frenkiel wrote:

> with hw:1:0, same result
> ->aplay -D hw:1,0 file.wav
>Playing WAVE 'file.wav' : Unsigned 8 bit, Rate 11025 Hz, Stereo
>aplay: set_params:1299: Sample format non available
>Available formats:
>- S16_LE
>- S32_LE

Are the 1:0 and 1,0 above typos in the mail? If not, they should be 1.0.

Cheers,
Tom

-- 
And now for something completely different.


signature.asc
Description: Digital signature


Re: aplay fails on amd64 laptop

2017-12-22 Thread Pierre Frenkiel

On Fri, 22 Dec 2017, to...@tuxteam.de wrote:


Either in the command line (option -D, i.e. "device", cf aplay man
page) or in the config file (possibly ~/.asoundrc, don't know off
the top of my head how you specify that there, but try

 http://www.alsa-project.org/main/index.php/Asoundrc)


I already did, as reported in my 1st post: aplay -D default file.wav
with the config given in the above link
->aplay -D default file.wav
   Playing WAVE 'file.wav' : Unsigned 8 bit, Rate 11025 Hz, Stereo
   aplay: set_params:1299: Sample format non available
   Available formats:
   - S16_LE
   - S32_LE

with hw:1:0, same result
->aplay -D hw:1,0 file.wav
   Playing WAVE 'file.wav' : Unsigned 8 bit, Rate 11025 Hz, Stereo
   aplay: set_params:1299: Sample format non available
   Available formats:
   - S16_LE
   - S32_LE

the given link gives no new information

best regards,
--
Pierre Frenkiel



Re: aplay fails on amd64 laptop

2017-12-22 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Fri, Dec 22, 2017 at 02:21:42PM +0100, Pierre Frenkiel wrote:
> On Thu, 21 Dec 2017, deloptes wrote:
> 
> >you need to use hw:1.0
> >as you target your second card, or configure snd module to initialize the
> >analog as first card
> 
>   thank you for your reply, but can you be a little more specific:
>   what do you mean exactly by "use hw:1.0" ?
>   where? in a config file, in the aplay command line ...?

Either in the command line (option -D, i.e. "device", cf aplay man
page) or in the config file (possibly ~/.asoundrc, don't know off
the top of my head how you specify that there, but try

  http://www.alsa-project.org/main/index.php/Asoundrc)

Cheers 

- -- t
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlo9NEUACgkQBcgs9XrR2kZ27ACeP1FgOdrogp8DfnFk0KNb4Pfn
sSEAnjGr9q8ht2QznIWDkXfPj7c5q9hg
=g3Sc
-END PGP SIGNATURE-



Re: aplay fails on amd64 laptop

2017-12-22 Thread Pierre Frenkiel

On Thu, 21 Dec 2017, deloptes wrote:


you need to use hw:1.0
as you target your second card, or configure snd module to initialize the
analog as first card


  thank you for your reply, but can you be a little more specific:
  what do you mean exactly by "use hw:1.0" ?
  where? in a config file, in the aplay command line ...?

best regards,
--
Pierre Frenkiel



Re: aplay fails on amd64 laptop

2017-12-21 Thread deloptes
Pierre Frenkiel wrote:

> card 1: Generic [HD-Audio Generic], device 0: ALC233 Analog [ALC233
> Analog] Subdevices: 1/1
> Subdevice #0: subdevice #0

you need to use hw:1.0
as you target your second card, or configure snd module to initialize the
analog as first card

regards