Products > Programming
[SOLVED] 24bits/96kHz conversion of s32le to f32le in a stdout to stdin pipe?
PKTKS:
--- Quote from: gnif on August 08, 2022, 01:23:23 pm ---
--- Quote from: PKTKS on August 08, 2022, 01:19:25 pm ---Standard DMIX plugin
--- Code: ---pcm.FLOATCNVT {
type dmix
ipc_key 2048
ipc_key_add_uid 0
ipc_perm 0660
slave {
pcm { type hw card 0 }
format "FLOAT_LE"
rate 96000
channels 2
}
bindings {
0 0
1 1
}
}
ctl.FLOATCNVT {
type hw
card 0
}
--- End code ---
Paul
--- End quote ---
This is exactly what plughw is already doing
--- End quote ---
ALSALIB will parse the defined configures at any call.
Unless you have them defined - it will not magically fall from the sky...
It must be defined somewhere. Or... written in the command line
Paul
RoGeorge:
--- Quote from: gnif on August 08, 2022, 12:42:53 pm ---
--- Quote from: RoGeorge on August 08, 2022, 12:36:46 pm ---To my ubuntu 20.04, arecord with plughw: (or sox, or ffmpeg) gives a much slower refresh in baudline making it all jumpy, than using hw: and converting to float with C.
--- End quote ---
It sounds like you have a larger issue at hand, I am getting real-time, smooth output even at 96kHz no matter how I feed baudline.
As a test, do you get smooth framerates if you feed it /dev/urandom instead? If so you have an issue with your sound device, perhaps your period size/count is not dealing well and you need to tune this some.
Further to this, what is your sound device?
--- End quote ---
Not sure how to feed data, do you have an example of the command, please?
Couldn't make arecord to read from /dev/urandom or from stdin, and if you mean to test by feeding /dev/ramdom to baudline, directly, if I do this:
--- Code: ---cat /dev/urandom | bl -format le32f -samplerate 96000
# bl is an alias for "baudline_1.08_linux_x86_64/baudline -stdin -record -channels 2 "
--- End code ---
then cat will flood too much data into baudline, making baudline unresponsive.
I guess some larger buffers come into play inside arecord (or sox or ffmpeg) when using plughw: instead of hw:
Otherwise it all seems to be working fine, baudline shows about 60fps+ and fluid move (the monitor is 60Hz and the driver syncs to that to avoid video tearing).
The soundcard is an onboard Sound Core3D Recon 3D internal (ca0132 chipset from Creative, the followup of emu10k1/2, Audigy, etc.), MB ASRock Fatal1ty Z97 Professional, nVidia GTX760/2GB, i7-4790K, 32GB RAM, SSD.
PKTKS:
--- Quote from: RoGeorge on August 08, 2022, 01:29:02 pm ---Not sure how to feed data, do you have an example of the command, please?
Couldn't make arecord to read from /dev/urandom or from stdin, and if you mean to test by feeding /dev/ramdom to baudline, directly, if I do this:
--- Code: ---cat /dev/urandom | bl -format le32f -samplerate 96000
# bl is an alias for "baudline_1.08_linux_x86_64/baudline -stdin -record -channels 2 "
--- End code ---
then cat will flood too much data into baudline, making baudline unresponsive.
I guess some larger buffers come into play inside arecord (or sox or ffmpeg) when using plughw: instead of hw:
Otherwise it all seems to be working fine, baudline shows about 60fps+ and fluid move (the monitor is 60Hz and the driver syncs to that to avoid video tearing).
--- End quote ---
There seems to be a necessary climbing of some steps....
the use of ALSA LIB plugins is straight like -D plug:[ANY_DEFINED_PLUG_THING]
But... your system REQUIRE the proper CARD DEFINITIONs and NODES (which mostly are messed and subverted by systemd and other problems...)
Basically you just invoke aplay or arecord with the required config plugin
I have some dozens plugins defined to handle al sort of complex things...
including AUDIO ROUTING.. when not using JACK
Paul
gnif:
--- Quote from: RoGeorge on August 08, 2022, 01:29:02 pm ---Not sure how to feed data, do you have an example of the command, please?
Couldn't make arecord to read from /dev/urandom or from stdin, and if you mean to test by feeding /dev/ramdom to baudline, directly, if I do this:
--- Code: ---cat /dev/urandom | bl -format le32f -samplerate 96000
# bl is an alias for "baudline_1.08_linux_x86_64/baudline -stdin -record -channels 2 "
--- End code ---
then cat will flood too much data into baudline, making baudline unresponsive.
I guess some larger buffers come into play inside arecord (or sox or ffmpeg) when using plughw: instead of hw:
Otherwise it all seems to be working fine, baudline shows about 60fps+ and fluid move (the monitor is 60Hz and the driver syncs to that to avoid video tearing).
--- End quote ---
Ah yes, sorry about that, I forgot that the audio device will be rate limiting the input. In any case, I still suspect an issue with your capture method/configuration. What is your sound device?
gnif:
--- Quote from: PKTKS on August 08, 2022, 01:32:07 pm ---
--- Quote from: RoGeorge on August 08, 2022, 01:29:02 pm ---Not sure how to feed data, do you have an example of the command, please?
Couldn't make arecord to read from /dev/urandom or from stdin, and if you mean to test by feeding /dev/ramdom to baudline, directly, if I do this:
--- Code: ---cat /dev/urandom | bl -format le32f -samplerate 96000
# bl is an alias for "baudline_1.08_linux_x86_64/baudline -stdin -record -channels 2 "
--- End code ---
then cat will flood too much data into baudline, making baudline unresponsive.
I guess some larger buffers come into play inside arecord (or sox or ffmpeg) when using plughw: instead of hw:
Otherwise it all seems to be working fine, baudline shows about 60fps+ and fluid move (the monitor is 60Hz and the driver syncs to that to avoid video tearing).
--- End quote ---
There seems to be a necessary climbing of some steps....
the use of ALSA LIB plugins is straight like -D plug:[ANY_DEFINED_PLUG_THING]
But... your system REQUIRE the proper CARD DEFINITIONs and NODES (which mostly are messed and subverted by systemd and other problems...)
Basically you just invoke aplay or arecord with the required config plugin
I have some dozens plugins defined to handle al sort of complex things...
including AUDIO ROUTING.. when not using JACK
Paul
--- End quote ---
Please just stop, as mentioned in another thread, I am not just some general Linux user, I am both a kernel developer and one of my specialities is the Linux audio subsystems. I have written both audio drivers, user space audio applications, DSP chains and full audio pipelines/engines for applications. I am a contributor to some of the largest and most widely used FOSS projects that make use of audio under Linux and the author of the audio engine used by Kodi (formally XBMC) where we ripped out all the ALSA asoundrc junk in favour of directly using alsalib correctly. I am currently working on a DSP processing tool for general desktop users that does real time processing of audio without JACK, etc... your claim is nothing special.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version