Audio playback frequency on Ubuntu 21.10
#1
It seems that Kodi is playing at 48kHz - my USB DAC displays the current rate (but sadly not the bit depth).

I'd rather have straight-through without resampling and fix at 44.1 - is there a way to do that?

I did try to download the source and poke around but there are some build issues, I'll post about that separately.
Reply
#2
(2021-10-20, 12:25)jmansion Wrote: It seems that Kodi is playing at 48kHz - my USB DAC displays the current rate (but sadly not the bit depth).

I'd rather have straight-through without resampling and fix at 44.1 - is there a way to do that?

I did try to download the source and poke around but there are some build issues, I'll post about that separately.
Didi you try to configure the Audio output via Kodi`s settings (System > Audio)?

1. Option (hardcoding to 44.1 kHz):
System > Audio > Output configuration > Fixed
System > Audio > Limit sampling rate (kHz) > 44.1

2. Option (Kodi tries to maintain the sampling frequence of the item played):
System > Audio > Output configuration > Best match
Reply
#3
(2021-10-20, 17:46)Buschel Wrote:
(2021-10-20, 12:25)jmansion Wrote: It seems that Kodi is playing at 48kHz - my USB DAC displays the current rate (but sadly not the bit depth).

I'd rather have straight-through without resampling and fix at 44.1 - is there a way to do that?

I did try to download the source and poke around but there are some build issues, I'll post about that separately.
Didi you try to configure the Audio output via Kodi`s settings (System > Audio)?

1. Option (hardcoding to 44.1 kHz):
System > Audio > Output configuration > Fixed
System > Audio > Limit sampling rate (kHz) > 44.1

2. Option (Kodi tries to maintain the sampling frequence of the item played):
System > Audio > Output configuration > Best match
Actually I hadn't because I was unaware - previously I had forced things through asound.conf.  However - these settings seem to have made no difference.

This is Ubuntu 21.10, and its switched to pipewire, which I assume is causing the issue.
Reply
#4
(2021-10-20, 19:51)jmansion Wrote: Actually I hadn't because I was unaware - previously I had forced things through asound.conf.  However - these settings seem to have made no difference.

This is Ubuntu 21.10, and its switched to pipewire, which I assume is causing the issue.

Then it looks like you should configure this in pipewire.conf (config). I personally avoid such kind of frameworks which resample back and forth. Also I am not sure if pipewire will skip resampling if you set the global samplerate to your desired frequency. With aloop I have seen a lot of problems with mismatching clocks and resampling. For audio purposes I am still preferring plain alsa.
Reply
#5
(2021-10-20, 20:54)Buschel Wrote:
(2021-10-20, 19:51)jmansion Wrote: Actually I hadn't because I was unaware - previously I had forced things through asound.conf.  However - these settings seem to have made no difference.

This is Ubuntu 21.10, and its switched to pipewire, which I assume is causing the issue.

Then it looks like you should configure this in pipewire.conf (config). I personally avoid such kind of frameworks which resample back and forth. Also I am not sure if pipewire will skip resampling if you set the global samplerate to your desired frequency. With aloop I have seen a lot of problems with mismatching clocks and resampling. For audio purposes I am still preferring plain alsa.

It gets stranger.  I have disabled pipewire globally in systemd.  Pulseaudio is not installed.

I have added ~/.asoundrc like this:

pcm.!default {
        type plug
        slave.pcm "fixed"
}

ctl.!default {
        type hw
        card 0
}

pcm.fixed {
        format S32_LW
        rate 44100
        type hw
        card 0
}

Now if I use speaker-test, I always get the DAC showing 44.1kHz.

But, when I start kodi (as me) the DAC immediately shows 48.0kHz - despite having configured for fixed output, limit to 44100.

I changed to the 'fixed' alias and now its working at 44.1 now, but why was it trying to use 48000 - all the source material is ripped from standard CDs, and it selected 48000 before I start any playback.

Still - working now, and now to see if I can replay through CamillaDSP.
Reply
#6
(2021-10-21, 18:58)jmansion Wrote: I changed to the 'fixed' alias and now its working at 44.1 now
Good to hear you already found a solution. What happens if you go for the Kodi seeting "System > Audio > Output configuration > Best match"? This should use the samplerate of your file for the playback.
(2021-10-21, 18:58)jmansion Wrote: but why was it trying to use 48000 - all the source material is ripped from standard CDs, and it selected 48000 before I start any playback.
I guess (but do not know) this is the default samplerate for Kodi. Video material typically uses a samplerate of 48 kHz (or the 48 kHz family).
Reply
#7
Kodi uses 44.1 by defaulf if the sink supports it. Kodi will furthermore exactly state what it found during startup. So - simply post a Debug Log and it can be found out.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply

Logout Mark Read Team Forum Stats Members Help
Audio playback frequency on Ubuntu 21.100