Petrov's resampler for ALSA

OSS specific Linux discussion (x86/amd64)

Moderators: dev, hannu, cesium

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Petrov's resampler for ALSA

Postby ossuserr » Wed Jan 14, 2015 3:54 pm

Alas! I spoiled my hearing today. Played via aplay -r 192000 -c 2 -f S32_LE song.flac and sound level was highest on card which of course gave me terrible noise since aplay can play only waves that is RAW. I switched off the speakers within 20 seconds or so but still have feeling of noise in ears.
So i installed Petrov's solution for alsa and could employ my hw4 device of audigy 2 zs. An interesting fact about it is that the master volume slider does not effect it at all. It's a separate chip which is supposed to play much cleaner than hw0 with DSP. But I am kind of deaf today to compare sounding. Also i uninstalled speex and libsamplerate. While uninstaling libsamplerate i got a notice that it's used by alsa_in and alsa_out and i must reemerge/recompile packages without its support. WHich means libsamplerate is heavily integrated into alsa drivers. Thanks to gento I have a choice to get rid of them. Now i have enough pure and clear sound with aplay -r 192000 -c 2 -f S32_LE so i can't compare to OSS + EAC or OSS + DB since i can use only the inferior hw0 there with 48\16.

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: Petrov's resampler for ALSA

Postby igorzwx » Wed Jan 14, 2015 4:20 pm

ossuserr wrote:Now i have enough pure and clear sound with aplay -r 192000 -c 2 -f S32_LE


You may post the output on terminal.

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: Petrov's resampler for ALSA

Postby ossuserr » Wed Jan 14, 2015 5:24 pm

Code: Select all

$ aplay -c 2 -f S32_LE -r 192000 /mnt/song.wav
Warning: format is changed to S24_3LE
Playing WAVE '/mnt/song.wav' : Signed 24 bit Little Endian in 3bytes, Rate 48000 Hz, Stereo
Converter: fftrate (build: Jan 31 2013, 18:43:10, linux-x86_64)
Input:  48000 Hz, 8 ch, 's24_3le' (0x20): dummy = 0, period = 511
Output: 192000 Hz, 8 ch, 's32_le' (0xa): dummy = 0, period = 2046
Rates:  32704 --> 130944 (J: 0.10%, T: DCT, W: Vorbis)
Ok.

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: Petrov's resampler for ALSA

Postby ossuserr » Wed Jan 14, 2015 5:28 pm

By the way I had to place libasound_module_rate_fftrate.so to another folder that is /usr/lib/alsa-lib/ to make Petrov's alsa solution work. But that is for gento not for ubunto.

Again my question is why Petrov uses inferoir DCT in alsa solution. Can you ask him to make FFT also?

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: Petrov's resampler for ALSA

Postby ossuserr » Wed Jan 14, 2015 5:35 pm

And this is output for DB [ALSA]. Subjectively the quality sound is the same as with aplay commadn above.

Code: Select all

selected output plugin: ALSA output plugin
INFO: loading playlist Default
INFO: from file /home/user/.config/deadbeef/playlists/0.dbpl
convgui: gtkui plugin not found
plugin Converter GTK3 UI failed to connect to dependencies, deactivated.
plugin Playlist browser GTK3 failed to connect to dependencies, deactivated.
gtkui plugin compiled for gtk version: 2.24.24
connecting button tray signals

** (deadbeef:14012): WARNING **: Widget not found: Skip to_menu

Converter: fftrate (build: Jan 31 2013, 18:43:10, linux-x86_64)
Input:  48000 Hz, 8 ch, 's24_3le' (0x20): dummy = 0, period = 511
Output: 192000 Hz, 8 ch, 's32_le' (0xa): dummy = 0, period = 2046
Rates:  32704 --> 130944 (J: 0.10%, T: DCT, W: Vorbis)
Ok.

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: Petrov's resampler for ALSA

Postby ossuserr » Wed Jan 14, 2015 5:42 pm

You know in DB's settings there is an option Always convert 8 bit to 16 bit. I had it switched on. While playing a song i switched it off and the playback stopped for a second. However nothing new appeared in the terminal output. I just think that probably we need to switch off those boxes "always convert" to make sure that no other resamplers are used besides Petrov's.

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: Petrov's resampler for ALSA

Postby ossuserr » Wed Jan 14, 2015 6:31 pm

I am enjoyin music now. Even mp3s 128kbit. Glory to Petrov! Augigy 2 zs p16v hw4 + Petrov's alsa package + DB = pleasure. NO clicks, NO hearable dstortions. Metal shade of libsamplerate and speex has gone away. So far i begin to doubt if it's worse to move to OSS with my setup. If OSS supported p16v the move would be reasoned.

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: Petrov's resampler for ALSA

Postby igorzwx » Wed Jan 14, 2015 7:25 pm

ossuserr wrote:I am enjoyin music now. Even mp3s 128kbit. Glory to Petrov! Augigy 2 zs p16v hw4 + Petrov's alsa package + DB = pleasure. NO clicks, NO hearable dstortions. Metal shade of libsamplerate and speex has gone away. So far i begin to doubt if it's worse to move to OSS with my setup. If OSS supported p16v the move would be reasoned.


You may better try LynxTWO and HW mixing _http://manuals.opensound.com/usersguide/lynxtwo.html

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: Petrov's resampler for ALSA

Postby ossuserr » Wed Jan 14, 2015 9:53 pm

I must become rich first.

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: Petrov's resampler for ALSA

Postby igorzwx » Thu Jan 15, 2015 6:44 pm

ossuserr wrote:Again my question is why Petrov uses inferoir DCT in alsa solution. Can you ask him to make FFT also?


Petrov told that his ALSA plugin has FFT resampler inside.

It can be easily enabled in /etc/fftrate.conf

fftrate.conf is in the deb-package:

Code: Select all

libasound2-plugin-fftrate_1.6.2_amd64/etc/fftrate.conf


It should be installed into /etc

To enable FFT, you should simply edit /etc/fftrate.conf
It should look like this:

Code: Select all

# Transform type
# Available: dct, fft (default: dct)
transform = fft

# Window type
# Available: vorbis, hanning, rect (default: vorbis)
#window = vorbis

# Set zummer for self detection
# Available: on, off (default: off)
#zummer = off


Then you can play your "song.wav" with aplay

Code: Select all

$ aplay -c 2 -f S32_LE -r 192000 /mnt/song.wav


and see whether it is enabled or not.
You may not need to reload ALSA.

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: Petrov's resampler for ALSA

Postby ossuserr » Thu Jan 15, 2015 7:48 pm

Glory to Petrov! I enabled fft, reloaded alsa and voila it works! It gives that more spacious sound like in old exact audio player.
Nice sound. No ear pain anymore. Plastic shade is much lessened. I would recommend Petrov to abandon DCT for the sake of FFT everywhere. So alsa is not crap if used with the right resampler. Now it's time for Petrov to patch jackd sourcs who require libsamplerate for installation.

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: Petrov's resampler for ALSA

Postby igorzwx » Thu Jan 15, 2015 8:15 pm

ossuserr wrote:Glory to Petrov! I enabled fft, reloaded alsa and voila it works! It gives that more spacious sound like in old exact audio player.
Nice sound. No ear pain anymore. Plastic shade is much lessened. I would recommend Petrov to abandon DCT for the sake of FFT everywhere. So alsa is not crap if used with the right resampler. Now it's time for Petrov to patch jackd sourcs who require libsamplerate for installation.


It is not very probable that Petrov will patch anything. He is currently very busy.

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: Petrov's resampler for ALSA

Postby ossuserr » Thu Jan 15, 2015 8:35 pm

That's a pity because all linuxoids would be happy. As for alsa official support trolls they told me they are not going to fix alsa or jackd for us...

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: Petrov's resampler for ALSA

Postby ossuserr » Sun Jun 28, 2015 1:31 pm

Can you give the link to Petrov's script which creates asound.conf for the resampler?

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: Petrov's resampler for ALSA

Postby igorzwx » Sun Jun 28, 2015 3:51 pm

ossuserr wrote:Can you give the link to Petrov's script which creates asound.conf for the resampler?


ALSA config-files for Petrov's ALSA-plugin/resampler can be created with "arateconf" ( /usr/bin/arateconf )
It is inside the package:

Выложил: _https://yadi.sk/d/FXbgCo7hdu5QN
Там две сборки (для x86 и x86_64) и два пакета:
собственно плагин и конфигуратор для генерации asound.conf.
_http://www.opensound.com/forum/viewtopic.php?f=3&t=3543&start=105#p20976


It is still available for download, and a copy of it is attached below (fftrate.zip)
Instructions are here: _http://www.opensound.com/forum/viewtopic.php?f=3&t=3543&start=105#p20976
and here: _http://www.opensound.com/forum/viewtopic.php?f=3&t=5788#p21058

I do not know any other Petrov's tools for creating ALSA config-files.
Attachments
fftrate.zip
Petrov's plugin for ALSA
(96.86 KiB) Downloaded 1211 times


Return to “Linux”

Who is online

Users browsing this forum: Baidu [Spider] and 90 guests