Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Piping Flac to Aplay
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
FR3141
n00b
n00b


Joined: 13 Jan 2018
Posts: 39

PostPosted: Tue Jul 24, 2018 6:05 pm    Post subject: Piping Flac to Aplay Reply with quote

I can recall that once I was able to pipe the output of flac to aplay:

flac -d -c file.flac | aplay

But now when I do the same I get harsh noise with the following message:

Playing raw data 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono

Evidently, aplay is no longer able to determine the audio parameters from the piped data and it asumes that the audio stream is 8-bit, 8K mono. I say "no longer" because I tried this command on an older machine with an older alsa and it worked as intended.

What happened? Is this a problem with alsa or is this a new "feature?"
Back to top
View user's profile Send private message
sebaro
Veteran
Veteran


Joined: 03 Jul 2006
Posts: 1141
Location: Romania

PostPosted: Wed Jul 25, 2018 6:03 am    Post subject: Reply with quote

Try with -f FORMAT:
Code:
flac -d -c 'file.flac' | aplay -f cd
Back to top
View user's profile Send private message
FR3141
n00b
n00b


Joined: 13 Jan 2018
Posts: 39

PostPosted: Wed Jul 25, 2018 9:16 am    Post subject: Reply with quote

sebaro wrote:
Try with -f FORMAT:
Code:
flac -d -c 'file.flac' | aplay -f cd


That will work if the audio file happens to be in CD format but not all audio files are in CD format.

Alsa should be able to read the format information from the piped data but it does not do that anymore.

The whole point of piping flac output is to make it easy to play the audio file. If the audio parameters have to be determined beforehand and then given to aplay the command is a lot less easy.

As I stated in the first post, piping audio data to aplay used to work but in the latest alsa versions it no longer works.
Back to top
View user's profile Send private message
sebaro
Veteran
Veteran


Joined: 03 Jul 2006
Posts: 1141
Location: Romania

PostPosted: Thu Jul 26, 2018 6:14 pm    Post subject: Reply with quote

If you must use aplay then you can try the 1.1.2 ebuild version or build it from older sources:
ftp://ftp.alsa-project.org/pub/utils/
Back to top
View user's profile Send private message
FR3141
n00b
n00b


Joined: 13 Jan 2018
Posts: 39

PostPosted: Sat Jul 28, 2018 2:27 pm    Post subject: Reply with quote

Quote:
If you must use aplay then you can try the 1.1.2 ebuild version or build it from older sources


I posted the issue to the Alsa mailig list. It was a bug in Alsa. A patch has been posted to the Alsa list:

https://sourceforge.net/p/alsa/mailman/alsa-user/

This patch may be included in the next Alsa release, but the Gentoo developers may want to be aware of it.

Aplay is a great utility. I am glad to be able to use it again.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum