Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


16bit seems to be upscaled to 24bit
#1
I have built a simple USB RGB LED indicator to show sample-rate and bit depth. It basically queries alsa for the playing soundcard and gets the info from hw_params (I used alsa rather than MPD as it also works for Spotify etc)

Works well except alsa indicates that all the CDs I ripped at 44100/16 are being played as 44100/24 so it would appear they are being upsampled (or more likely 16bit is simply being zero padded to 24bit). I had though this might be solved by switching from plughw to direct(hw) as that did refer to zero-padding the bit-depth. But this doesn't seem to make a difference.

No problem, obviously, but curious, is it possible to find the originating bit-depth? Be nice to get my indicator in-sync with the original source.

BTW - thanks for some fantastic software, a couple of months or so into using MoOde and still very impressed - simple but powerful!
Reply
#2
What audio format did specify for the CD rips (flac wav, mp3, etc) ?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
Tim - wow - quick response, thanks. They were all ripped as 44100/16 FLAC.
Reply
#4
Reboot and post the Moode startup log. I'll have a look.

Code:
moodeutl -l

What make/model audio device are you using?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#5
Tim - thanks. Obviously this is not an urgent or important problem but interesting to understand, perhaps.

I have two MoOde devices - both RPI 3+s and one has a Hifiberry DAC2 1.2 and that one I changed alsa output to direct(hw), the other still using the default plughw is an Allo Boss 1.2 card.

Here is the startup log from the HifiBerry
Code:
20220111 130200 worker: -- Start
20220111 130200 worker: Successfully daemonized
20220111 130200 worker: Integrity check (passed)
20220111 130200 worker: File check (OK)
20220111 130201 worker: Session vacuumed
20220111 130201 worker: Session loaded
20220111 130201 worker: Debug logging (OFF)
20220111 130201 worker: -- Audio debug
20220111 130201 worker: ALSA cards: (0:sndrpihifiberry | 1:empty | 2:empty | 3:empty
20220111 130201 worker: MPD config: (0:HiFiBerry DAC+ | mixer:(Digital) | card:0)
20220111 130201 worker: ALSA mixer actual (Digital)
20220111 130201 worker: ALSA Digital volume set to (0%)
20220111 130201 worker: -- System
20220111 130203 worker: Host     (moodeDine)
20220111 130203 worker: moOde    (7.6.1 2021-12-17)
20220111 130203 worker: RaspiOS  (10.6)
20220111 130203 worker: Kernel   (5.4.77-v7+ #1371)
20220111 130203 worker: Platform (Pi-3B+ 1.3 1GB)
20220111 130203 worker: ARM arch (armv7l, 32-bit kernel)
20220111 130203 worker: MPD ver  (0.23.4_p0x3)
20220111 130203 worker: CPU gov  (ondemand)
20220111 130203 worker: USB boot enabled
20220111 130203 worker: File system expanded
20220111 130203 worker: HDMI port off
20220111 130203 worker: -- Network
20220111 130203 worker: IP address check timeout (90 secs)
20220111 130203 worker: eth0 adapter exists
20220111 130203 worker: eth0 IP address check (No)
20220111 130203 worker: eth0 address not assigned
20220111 130203 worker: wlan0 adapter exists
20220111 130203 worker: wifi country (GB)
20220111 130203 worker: wlan0 trying SSID (SnailMesh)
20220111 130203 worker: IP addr (192.168.1.17)
20220111 130203 worker: Netmask (255.255.255.0)
20220111 130203 worker: Gateway (192.168.1.254)
20220111 130204 worker: Pri DNS (8.8.8.8)
20220111 130204 worker: Domain  (192.168.1.15)
20220111 130204 worker: Pi integrated wlan0 power save disabled
20220111 130204 worker: -- Audio config
20220111 130204 worker: MPD conf updated
20220111 130204 worker: ALSA card number (0)
20220111 130204 worker: MPD audio output (HiFiBerry DAC+)
20220111 130204 worker: Audio formats (S16_LE, S24_LE, S32_LE)
20220111 130204 worker: ALSA mixer name (Digital)
20220111 130204 worker: MPD mixer type (software)
20220111 130204 worker: Hdwr volume controller exists
20220111 130204 worker: Max ALSA volume (100%)
20220111 130204 worker: ALSA output mode (Direct: hw)
20220111 130204 worker: ALSA loopback (Off)
20220111 130204 worker: Reset renderer active flags
20220111 130204 worker: CamillaDSP (off)
20220111 130204 worker: -- MPD startup
20220111 130204 worker: MPD started
20220111 130205 worker: MPD accepting connections
20220111 130205 worker: MPD output 1 ALSA Default (on)
20220111 130205 worker: MPD output 2 ALSA Bluetooth (off)
20220111 130205 worker: MPD output 3 HTTP Server (off)
20220111 130205 worker: MPD crossfade (off)
20220111 130205 worker: MPD ignore CUE files (yes)
20220111 130205 worker: -- Feature availability
20220111 130205 worker: Source select (available)
20220111 130205 worker: Source select (source: MPD)
20220111 130205 worker: Source select (output: HiFiBerry DAC+)
20220111 130205 worker: Bluetooth (available)
20220111 130205 worker: Airplay renderer (available: started)
20220111 130205 worker: Spotify renderer (available)
20220111 130205 worker: Squeezelite (available)
20220111 130205 worker: RoonBridge renderer (not installed)
20220111 130205 worker: Multiroom sender (available)
20220111 130205 worker: Multiroom receiver (available)
20220111 130205 worker: UPnP renderer (available: started)
20220111 130205 worker: DLNA server (available)
20220111 130205 worker: UPnP browser (available)
20220111 130205 worker: GPIO button handler (available)
20220111 130205 worker: Stream recorder (n/a)
20220111 130205 worker: -- Music sources
20220111 130205 worker: USB sources (none attached)
20220111 130211 worker: NAS and UPnP sources (mountall initiated)
20220111 130211 worker: -- Other
20220111 130211 worker: USB volume knob (Off)
20220111 130211 worker: USB auto-mounter (udisks-glue)
20220111 130211 worker: LED0 (On)
20220111 130211 worker: LED1 (On)
20220111 130211 worker: Saved MPD vol level (0)
20220111 130211 worker: Preamp volume level (0)
20220111 130211 worker: MPD volume level (80) restored
20220111 130211 worker: ALSA Digital volume (100%)
20220111 130211 worker: Auto-play (Off)
20220111 130211 worker: Maintenance interval (3 hours)
20220111 130211 worker: Screen saver activation (Never)
20220111 130211 worker: Session permissions (OK)
20220111 130211 worker: Watchdog started
20220111 130211 worker: Ready


and here's the one from the Allo Boss
Code:
20220111 124354 worker: -- Start
20220111 124354 worker: Successfully daemonized
20220111 124354 worker: Integrity check (passed)
20220111 124355 worker: File check (OK)
20220111 124359 worker: Session vacuumed
20220111 124359 worker: Session loaded
20220111 124359 worker: Debug logging (OFF)
20220111 124359 worker: -- Audio debug
20220111 124359 worker: ALSA cards: (0:BossDAC | 1:empty | 2:empty | 3:empty
20220111 124359 worker: MPD config: (0:Allo Boss DAC | mixer:(Digital) | card:0)
20220111 124359 worker: ALSA mixer actual (Digital)
20220111 124359 worker: ALSA Digital volume set to (0%)
20220111 124359 worker: -- System
20220111 124401 worker: Host     (moodeTV)
20220111 124401 worker: moOde    (7.6.1 2021-12-17)
20220111 124401 worker: RaspiOS  (10.6)
20220111 124401 worker: Kernel   (5.4.77-v7+ #1371)
20220111 124401 worker: Platform (Pi-3B+ 1.3 1GB)
20220111 124401 worker: ARM arch (armv7l, 32-bit kernel)
20220111 124401 worker: MPD ver  (0.23.4_p0x3)
20220111 124401 worker: CPU gov  (ondemand)
20220111 124401 worker: USB boot enabled
20220111 124401 worker: File system expanded
20220111 124401 worker: HDMI port off
20220111 124401 worker: -- Network
20220111 124401 worker: IP address check timeout (90 secs)
20220111 124401 worker: eth0 adapter exists
20220111 124401 worker: eth0 IP address check (Yes)
20220111 124401 worker: IP addr (192.168.1.25)
20220111 124401 worker: Netmask (255.255.255.0)
20220111 124401 worker: Gateway (192.168.1.254)
20220111 124401 worker: Pri DNS (8.8)
20220111 124401 worker: Domain  (192.168.1.15)
20220111 124401 worker: wlan0 adapter does not exist
20220111 124401 worker: -- Audio config
20220111 124412 worker: MPD conf updated
20220111 124412 worker: ALSA card number (0)
20220111 124412 worker: MPD audio output (Allo Boss DAC)
20220111 124412 worker: Audio formats (S16_LE, S24_LE, S32_LE)
20220111 124412 worker: ALSA mixer name (Digital)
20220111 124412 worker: MPD mixer type (software)
20220111 124412 worker: Hdwr volume controller exists
20220111 124412 worker: Max ALSA volume (100%)
20220111 124412 worker: ALSA output mode (Default: plughw)
20220111 124412 worker: ALSA loopback (Off)
20220111 124412 worker: Reset renderer active flags
20220111 124412 worker: CamillaDSP (off)
20220111 124412 worker: -- MPD startup
20220111 124412 worker: MPD started
20220111 124413 worker: MPD accepting connections
20220111 124413 worker: MPD output 1 ALSA Default (on)
20220111 124413 worker: MPD output 2 ALSA Bluetooth (off)
20220111 124413 worker: MPD output 3 HTTP Server (off)
20220111 124413 worker: MPD crossfade (off)
20220111 124413 worker: MPD ignore CUE files (yes)
20220111 124413 worker: -- Feature availability
20220111 124413 worker: Source select (available)
20220111 124413 worker: Source select (source: MPD)
20220111 124413 worker: Source select (output: Allo Boss DAC)
20220111 124432 worker: Bluetooth pairing agent (started)
20220111 124432 worker: Bluetooth (available: started)
20220111 124432 worker: Airplay renderer (available: started)
20220111 124432 worker: Spotify renderer (available: started)
20220111 124432 worker: Squeezelite (available)
20220111 124432 worker: RoonBridge renderer (available)
20220111 124432 worker: Multiroom sender (available)
20220111 124432 worker: Multiroom receiver (available)
20220111 124432 worker: UPnP renderer (available: started)
20220111 124432 worker: DLNA server (available)
20220111 124432 worker: UPnP browser (available)
20220111 124432 worker: GPIO button handler (available)
20220111 124432 worker: Stream recorder (n/a)
20220111 124432 worker: -- Music sources
20220111 124432 worker: USB sources (none attached)
20220111 124442 worker: NAS and UPnP sources (mountall initiated)
20220111 124442 worker: -- Other
20220111 124442 worker: USB volume knob (Off)
20220111 124442 worker: USB auto-mounter (udisks-glue)
20220111 124442 worker: LED0 (Off)
20220111 124442 worker: LED1 (Off)
20220111 124442 worker: Saved MPD vol level (0)
20220111 124442 worker: Preamp volume level (0)
20220111 124442 worker: MPD volume level (82) restored
20220111 124442 worker: ALSA Digital volume (100%)
20220111 124442 worker: Auto-play (Off)
20220111 124442 worker: Maintenance interval (3 hours)
20220111 124442 worker: Screen saver activation (Never)
20220111 124442 worker: Session permissions (OK)
20220111 124442 worker: Watchdog started
20220111 124442 worker: Ready



This morning I tried a simple experiment and quickly stuck a Volumio instance on a soundcard - my indicator shows 44.1/16 bit for my CD rips as expected.

Out of interest here is proc/asound/cardx/pcm0p/sub0/hw_params from the Hifiberry with MoOde
Code:
access: MMAP_INTERLEAVED
format: S24_LE
subformat: STD
channels: 2
rate: 44100 (352800/8)
period_size: 4410
buffer_size: 22050

and here is Volumio, same track from the same NAS source,  on the same setup
Code:
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (352800/8)
period_size: 4410
buffer_size: 22050

interestingly the Allo Boss running same version of MoOde is slightly different
Code:
access: MMAP_INTERLEAVED
format: S24_LE
subformat: STD
channels: 2
rate: 44100 (705600/16)
period_size: 4410
buffer_size: 22050
which I assume is down to the alsa-driver for that card.

As I said no urgency or import to this but I'm trying to slowly understand all this stuff  Smile
Reply
#6
It's prolly due to MPD mixer = Software. Try setting it to Hardware.

Code:
20220111 124412 worker: MPD mixer type (software)
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#7
Got it in one!!!! I should have thought of that.

Both systems report 16 bit after the change.

Thanks for putting in the time for such a trivial anomaly!
Reply
#8
@iambrian

Out of idle curiosity, what does alsacap report for these two DACs?

E.g., for a moOde player I have at hand with a first-gen USB Khadas Tone Board attached:


Code:
pi@CM4:~ $ alsacap
*** Scanning for playback devices ***
Card 0, ID `b1', name `bcm2835 HDMI 1'
 Device 0, ID `bcm2835 HDMI 1', name `bcm2835 HDMI 1', 8 subdevices (7 available)
   1..8 channels, sampling rate 8000..192000 Hz
   Sample formats: U8, S16_LE
   Buffer size range from 80 to 131072
   Period size range from 80 to 131072

     Subdevice 0, name `subdevice #0'
     Subdevice 1, name `subdevice #1'
     Subdevice 2, name `subdevice #2'
     Subdevice 3, name `subdevice #3'
     Subdevice 4, name `subdevice #4'
     Subdevice 5, name `subdevice #5'
     Subdevice 6, name `subdevice #6'
     Subdevice 7, name `subdevice #7'
Card 1, ID `Tone1', name `Tone1'
 Device 0, ID `USB Audio', name `USB Audio', 1 subdevices (1 available)
   2 channels, sampling rate 44100..768000 Hz
   Sample formats: S32_LE, SPECIAL, DSD_U32_BE
   Buffer size range from 16 to 131072
   Period size range from 8 to 65536

     Subdevice 0, name `subdevice #0'

While, for another with a Creative Tech USB-Bluetooth audio adapter, I get

Code:
...
Card 2, ID `W2', name `Creative Bluetooth Audio W2'
 Device 0, ID `USB Audio', name `USB Audio', 1 subdevices (1 available)
   2 channels, sampling rate 48000..48000 Hz
   Sample formats: S16_LE
   Buffer size range from 96 to 262144
   Period size range from 48 to 131072

     Subdevice 0, name `subdevice #0'


[Sorry, I've got a HiFiBerry DAC stashed away in one crate or another but I'm too lazy to search for it this morning.]

Regards,
Kent
Reply
#9
Photo 
Here's alsacap

Hifiberry
Code:
Card 0, ID `sndrpihifiberry', name `snd_rpi_hifiberry_dacplus'
 Device 0, ID `HiFiBerry DAC+ Pro HiFi pcm512x-hifi-0', name `HiFiBerry DAC+ Pro HiFi pcm512x-hifi-0', 1 subdevices (1 available)
   2 channels, sampling rate 8000..352800 Hz
   Sample formats: S16_LE, S24_LE, S32_LE
   Buffer size range from 64 to 131072
   Period size range from 32 to 65536

     Subdevice 0, name `subdevice #0'

Allo Boss 1.2
Code:
*** Scanning for playback devices ***
Card 0, ID `BossDAC', name `BossDAC'
  Device 0, ID `Boss DAC HiFi [Master] pcm512x-hifi-0', name `Boss DAC HiFi [Master] pcm512x-hifi-0', 1 subdevices (1 available)
    2 channels, sampling rate 8000..384000 Hz
    Sample formats: S16_LE, S24_LE, S32_LE
    Buffer size range from 64 to 131072
    Period size range from 32 to 65536

      Subdevice 0, name `subdevice #0'

Thanks - didn't know about alsacap!
Reply
#10
(01-11-2022, 01:42 PM)Tim Curtis Wrote: It's prolly due to MPD mixer = Software. Try setting it to Hardware.

Code:
20220111 124412 worker: MPD mixer type (software)

Hi Tim,

what is the item in the UI responsible for this? I happen to see no "mixer" wording anywhere... :-(

Thanks, Al.
Reply


Forum Jump: