Thank you for your donation!


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


Playlist Too Large - Out Of Memory
#1
today I encountered an out of memory error in my browser.

Running moodeutl --mpdlog gives me this


Code:
Apr 14 14:28 : player: played "NAS/JaysNAS/Grateful Dead/gdCompilations/Noteworthy-Jam-Sandwiches/gd90-11-01.008068.Playin-DarkStar-Drums-Space-DarkStar-Playin.flac"
Apr 14 14:36 : exception: Integer expected: undefined
Apr 14 14:36 : mixer: Failed to set mixer for 'ALSA Default': failed to set ALSA volume: Invalid argument
Apr 14 14:36 : mixer: Failed to set mixer for 'ALSA Default': failed to set ALSA volume: Invalid argument
Apr 14 14:36 : mixer: Failed to set mixer for 'ALSA Default': failed to set ALSA volume: Invalid argument
Apr 14 14:40 : mixer: Failed to set mixer for 'ALSA Default': failed to set ALSA volume: Invalid argument
Apr 14 14:42 : exception: Playlist is too large
Apr 14 15:22 : mixer: Failed to set mixer for 'ALSA Default': failed to set ALSA volume: Invalid argument


I have never set up a playlist so I don't know what that actually means.  I did try clearing my playback history but the memory error still occurred.

mpc shows me this


Code:
XXX@moode:~ $ mpc lsplaylists
Favorites
Default Playlist

I just executed mpc clear and reloaded by browser.  i have successfully navigated thru a few folders

However, in PuTTY the session is now frozen.  (A DOS Ping still shows the device is reachable)  When clicking on a folder in the browser there is no activity.  (The red light on my Allo UsBridge is active, not 100% pegged but active

Do I reboot?  is my library (13 TB) being rebuilt?

Just before hitting send my PuTTY session 'woke up', i can scan thru folders 

a few seconds later it is now frozen again, PuTTY stalled, red light pegging, browser unresponsive

Ay suggestions on what to do?  Do i reboot my device?  Install a fresh copy of moode?  How do i prevent playlists from growing in the future, do i periodically issue an MPC clear?  moodeutl -m, shows me that i have 53 GB free on my disk

Thanks, Jay

Added - 3 minutes after sending everything is back and i am playing a track from my NAS
Reply
#2
@quimbo

It would appear there are at least two different issues here.

1) The message 

Code:
exception: Playlist is too large

is straight forward but its wording is a bit misleading. The relevant source-code comment reads

Code:
* Throws PlaylistError if the queue would be too large.

which refers to the song queue shown in moOde's playback panel. Elsewhere in the source code, the song queue is described as containing the "real" playlist.

What I believe is happening is you're trying to load the entire library into the playback queue, which easily exceeds the buffer capacity. Suggested solution: don't try to do that  Big Grin

2) The messages 

Code:
exception: Integer expected: undefined

and

Code:
mixer: Failed to set mixer for 'ALSA Default': failed to set ALSA volume: Invalid argument

seem to refer to a different issue or issues. More information is needed.

For starters, reboot and post the output from running the following from the command line

Code:
moodeutl -l

Regards,
Kent
Reply
#3
Also, MPD has resource limitations. The default for #songs in the Queue (playlist) is 16384.
https://mpd.readthedocs.io/en/latest/use...imitations
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#4
Thank you for the response, i guess its time to start reading the code 

Not sure how I would have tried to add that many to the queue

When i execute this command

Code:
mpc listall | wc

i get a large playlist:

Code:
260651 1520374 26292351


Seems to be a listing of all my tracks, not really a playlist


Code:
moodeutl -l


2
Quote:
Code:
0220414 171445 worker: --
20220414 171445 worker: -- Start moOde 8 series
20220414 171445 worker: --
20220414 171445 worker: Successfully daemonized
20220414 171449 worker: File check (OK)
20220414 171449 worker: Session vacuumed
20220414 171449 worker: Session loaded
20220414 171449 worker: Debug logging (OFF)
20220414 171449 worker: --
20220414 171449 worker: -- Audio debug
20220414 171449 worker: --
20220414 171449 worker: ALSA cards: (0:b1 | 1:Headphones | 2:USB | 3:empty
20220414 171449 worker: MPD config: (2:Schiit Bifrost 2 Unison USB | mixer:(PCM) | card:2)
20220414 171449 worker: ALSA mixer actual (PCM)
20220414 171449 worker: ALSA PCM volume set to ()
20220414 171449 worker: --
20220414 171449 worker: -- System
20220414 171449 worker: --
20220414 171451 worker: Host      (moode)
20220414 171452 worker: moOde     (8.0.2 2022-03-25)
20220414 171452 worker: RaspiOS   (11.2)
20220414 171452 worker: Kernel    (5.15.28-v7+ #1532)
20220414 171452 worker: Platform  (Allo USBridge SIG [CM3+ Lite 1GB v1.0])
20220414 171452 worker: ARM arch  (armv7l, 32-bit)
20220414 171452 worker: MPD ver   (0.23.5)
20220414 171452 worker: CPU gov   (ondemand)
20220414 171452 worker: USB boot  (not available)
20220414 171452 worker: File sys  (expanded)
20220414 171452 worker: HDMI port (Off)
20220414 171452 worker: Sys LED0  (On)
20220414 171452 worker: Sys LED1  (sysclass does not exist)
20220414 171452 worker: --
20220414 171452 worker: -- Network
20220414 171452 worker: --
20220414 171452 worker: eth0 adapter exists
20220414 171452 worker: eth0 wait for address (No)
20220414 171452 worker: IP addr (192.168.0.22)
20220414 171452 worker: Netmask (255.255.255.0)
20220414 171452 worker: Gateway (192.168.0.1)
20220414 171452 worker: Pri DNS (68.105.28.11)
20220414 171452 worker: Domain  ()
20220414 171452 worker: wlan0 adapter does not exist
20220414 171452 worker: --
20220414 171452 worker: -- Audio config
20220414 171452 worker: --
20220414 171452 worker: MPD conf update skipped (USB device)
20220414 171452 worker: ALSA card number (2)
20220414 171452 worker: MPD audio output (Schiit Bifrost 2 Unison USB)
20220414 171452 worker: Audio formats (S16_LE, S32_LE, S24_3LE)
20220414 171452 worker: ALSA mixer name (PCM)
20220414 171452 worker: MPD mixer type (hardware)
20220414 171453 worker: Hdwr volume controller exists
20220414 171453 worker: Max ALSA volume (100%)
20220414 171453 worker: ALSA output mode (Default: plughw)
20220414 171453 worker: ALSA loopback (Off)
20220414 171453 worker: Reset renderer active flags
20220414 171453 worker: CamillaDSP (off)
20220414 171453 worker: --
20220414 171453 worker: -- MPD startup
20220414 171453 worker: --
20220414 171459 worker: MPD started
20220414 171459 worker: MPD accepting connections
20220414 171459 worker: MPD output 1 ALSA Default (on)
20220414 171459 worker: MPD output 2 ALSA Bluetooth (off)
20220414 171459 worker: MPD output 3 HTTP Server (off)
20220414 171459 worker: MPD crossfade (off)
20220414 171459 worker: MPD ignore CUE files (no)
20220414 171459 worker: --
20220414 171459 worker: -- Feature availability
20220414 171459 worker: --
20220414 171459 worker: Source select (available)
20220414 171459 worker: Source select (source: MPD)
20220414 171459 worker: Source select (output: Schiit Bifrost 2 Unison USB)
20220414 171459 worker: Bluetooth (available)
20220414 171459 worker: Airplay renderer (available)
20220414 171459 worker: Spotify renderer (available)
20220414 171459 worker: Squeezelite (available)
20220414 171459 worker: RoonBridge renderer (not installed)
20220414 171459 worker: Multiroom sender (available)
20220414 171459 worker: Multiroom receiver (available)
20220414 171459 worker: UPnP renderer (available)
20220414 171459 worker: DLNA server (available)
20220414 171459 worker: UPnP browser (available)
20220414 171459 worker: GPIO button handler (available)
20220414 171459 worker: Stream recorder (n/a)
20220414 171459 worker: --
20220414 171459 worker: -- Music sources
20220414 171459 worker: --
20220414 171459 worker: USB sources (none attached)
20220414 171503 worker: NAS and UPnP sources (mountall initiated)
20220414 171503 worker: --
20220414 171503 worker: -- Other
20220414 171503 worker: --
20220414 171503 worker: USB volume knob (Off)
20220414 171503 worker: USB auto-mounter (udisks-glue)
20220414 171503 worker: Saved MPD vol level (0)
20220414 171503 worker: Preamp volume level (0)
20220414 171503 worker: MPD volume level (0) restored
20220414 171503 worker: ALSA PCM volume ()
20220414 171503 worker: Auto-play (Off)
20220414 171503 worker: Maintenance interval (120 minutes)
20220414 171503 worker: Screen saver activation (Never)
20220414 171503 worker: Session permissions (OK)
20220414 171503 worker: Watchdog started
20220414 171503 worker: Ready
Reply
#5
i think i get why piping the 'list' was as large 

This documentation from mpc commands


Code:
listall [<file>] - Lists <file> from playlist. If no <file> is specified, lists all songs.


is misleading as I appear to have wrongly assumed "lists all songs" lists everything in the playlist.

using this command, I can see that is wrong as this command lists just the tracks in the last 3 folders I played from after a reboot


Code:
mpc playlist -f "[[%artist% - ]%title%]"



Code:
Grateful Dead | 1971-02-18 - Bertha
Grateful Dead | 1971-01-24 - Truckin'
Grateful Dead | 1971-01-24 - China Cat Sunflower>
Grateful Dead | 1971-01-24 - I Know You Rider
Grateful Dead | 1971-01-24 - It Hurts Me Too
Grateful Dead | 1971-01-24 - Cumberland Blues
Grateful Dead | 1971-01-24 - Casey Jones
Grateful Dead | 1971-01-24 - Sugar Magnolia
Grateful Dead | 1971-01-24 - Hard to Handle
Grateful Dead | 1971-01-24 - Turn on Your Lovelight>
Grateful Dead | 1971-01-24 - Not Fade Away>
Grateful Dead | 1971-01-24 - Going Down the Road Feeling Bad>
Grateful Dead | 1971-01-24 - Lovelight reprise>
Grateful Dead | 1971-01-24 - Drums>
Grateful Dead | 1971-01-24 - Good Lovin'//
Al Di Meola - The Wizard
Al Di Meola - Land Of The Midnight Sun
Al Di Meola - Sarabande From Violin Sonata In B Minor
Al Di Meola - Love Theme from 'Pictures Of The Sea'
Al Di Meola - Suite - Golden Dawn
Al Di Meola - Short Tales Of The Black Forest
Bill Evans Trio - Israel
Bill Evans Trio - Haunted Heart
Bill Evans Trio - Beautiful Love (Take 2)
Bill Evans Trio - Beautiful Love (Take 1)
Bill Evans Trio - Elsa
Bill Evans Trio - Nardis
Bill Evans Trio - How Deep Is The Ocean?
Bill Evans Trio - I Wish I Knew
Bill Evans Trio - Sweet And Lovely
Bill Evans Trio - The Boy Next Door



and with a word count

Code:
mpc playlist -f "[[%artist% - ]%title%]" | wc

 31     239    1259
Reply
#6
To get the number of items currently in the MPD play queue try the command below. It counts the number of lines output from the mpc playlist command.

Code:
mpc playlist | wc -l
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#7
@quimbo

That's an old version of mpc, apparently.

Here's what man mpc reports on my moOde player

Code:
      listall [<file>] - Lists <file> from database.  If no
             <file> is specified, lists all songs in the database.

or, from mpc help,

Code:
 mpc listall [<file>]                                  List all songs in the music dir

So, regarding your first issue, from your earlier post we see the library has over 260K tracks. From Tim's post, the queue limit is 16384. An easy way to cause the error message you see would be to mount the music source, update the library, then select the entire library folder (or any large enough subfolder) and click add, play, or clear/play.

As for the second issue(s), are you still seeing the error messages in the log after rebooting?

There are several items in the moodeutl output which look odd to me but I have no knowledge of Schiit DACs. Just grep'ping for ALSA gets me

Code:
20220414 171449 worker: ALSA cards: (0:b1 | 1:Headphones | 2:USB | 3:empty
20220414 171449 worker: ALSA mixer actual (PCM)
20220414 171449 worker: ALSA PCM volume set to ()
20220414 171452 worker: ALSA card number (2)
20220414 171452 worker: ALSA mixer name (PCM)
20220414 171453 worker: Max ALSA volume (100%)
20220414 171453 worker: ALSA output mode (Default: plughw)
20220414 171453 worker: ALSA loopback (Off)
20220414 171459 worker: MPD output 1 ALSA Default (on)
20220414 171459 worker: MPD output 2 ALSA Bluetooth (off)
20220414 171503 worker: ALSA PCM volume ()

I would expect Card 2 to be identified by a vendor-specified string (e.g., my Khadas Tone1 board reports as "Tone1"; my cheapo USB-in/out adapter as "Device"), I would expect the ALSA mixer to be identified by a vendor-specified string (my Khadas board is "Tone1 "; the USB-in/out adapter as "Speaker").

The line "ALSA PCM volume set to ()" seems suspicious. The mixers for both my USB devices are set to (0)

What is the output of the alsacap command (when not playing a track or radio station)?

Regards,
Kent

PS - ya gotta love the word usage in MPD code/documentation and in common players. Directory vs folder, library vs database, song vs track (or even just file), queue vs playlist. Sigh.

PPS - nice list of tracks!
Reply
#8
Thank you for the reply. it's been over 20 years since I spent any considerable time in Unix land. Forgot about man, etc.

I have not updated the database in a few weeks, I did not click add, play, or clear/play as far as I know but apparently I did

Today i am actually at work, will run the command later tonight
Reply
#9
output of alsacap

Code:
*** Scanning for playback devices ***
Card 0, ID `b1', name `bcm2835 HDMI 1'
 Device 0, ID `bcm2835 HDMI 1', name `bcm2835 HDMI 1', 4 subdevices (4 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'
Card 1, ID `Headphones', name `bcm2835 Headphones'
 Device 0, ID `bcm2835 Headphones', name `bcm2835 Headphones', 4 subdevices (4 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'
Card 2, ID `USB', name `Schiit Bifrost 2 Unison USB'
 Device 0, ID `USB Audio', name `USB Audio', 1 subdevices (1 available)
   2 channels, sampling rate 44100..192000 Hz
   Sample formats: S16_LE, S32_LE, S24_3LE
   Buffer size range from 16 to 262144
   Period size range from 8 to 131072

     Subdevice 0, name `subdevice #0'
Reply
#10
Here is a script that will display the playlist duration

Code:
mpc playlist -f '%time%' | tr ':' ' ' | awk '
   BEGIN {i = 0}
   {i += $1*60 + $2}
   END{
       if (int(i/3600) > 0)
           print int(i/3600) "h " int((i%3600)/60) "m " int(i%60) "s"
       else if (int(i) > 0)
           print int((i%3600)/60) "m " int(i%60) "s"
       else
           print "(empty)"
   }
'

5h 1m 27s
Reply


Forum Jump: